[orx-temporal-blur] Add gain and color matrix controls
This commit is contained in:
22
orx-temporal-blur/src/demo/kotlin/DemoBasic01.kt
Normal file
22
orx-temporal-blur/src/demo/kotlin/DemoBasic01.kt
Normal file
@@ -0,0 +1,22 @@
|
||||
import org.openrndr.applicationSynchronous
|
||||
import org.openrndr.extensions.SingleScreenshot
|
||||
import org.openrndr.extra.temporalblur.TemporalBlur
|
||||
import org.openrndr.math.Polar
|
||||
|
||||
fun main() = applicationSynchronous {
|
||||
program {
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend(TemporalBlur()) {
|
||||
samples = 10
|
||||
duration = 0.9
|
||||
}
|
||||
|
||||
extend {
|
||||
drawer.circle(Polar(seconds * 360.0, 200.0).cartesian + drawer.bounds.center, 50.0)
|
||||
}
|
||||
}
|
||||
}
|
||||
38
orx-temporal-blur/src/demo/kotlin/DemoColorShift01.kt
Normal file
38
orx-temporal-blur/src/demo/kotlin/DemoColorShift01.kt
Normal file
@@ -0,0 +1,38 @@
|
||||
import org.openrndr.applicationSynchronous
|
||||
import org.openrndr.color.ColorRGBa
|
||||
import org.openrndr.draw.tint
|
||||
import org.openrndr.extensions.SingleScreenshot
|
||||
import org.openrndr.extra.temporalblur.TemporalBlur
|
||||
import org.openrndr.math.Polar
|
||||
import kotlin.math.cos
|
||||
|
||||
fun main() = applicationSynchronous {
|
||||
program {
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend(TemporalBlur()) {
|
||||
samples = 100
|
||||
duration = 10.0
|
||||
colorMatrix = {
|
||||
// `it` is 0.0 at start of frame, 1.0 at end of frame
|
||||
tint(ColorRGBa.WHITE.mix(ColorRGBa.BLUE, it))
|
||||
}
|
||||
gain = 1.2
|
||||
}
|
||||
|
||||
extend {
|
||||
for (i in 0 until 10) {
|
||||
drawer.circle(
|
||||
Polar(
|
||||
seconds * 760.0 + i * 30,
|
||||
140.0 + cos(i + seconds) * 40.0
|
||||
).cartesian + drawer.bounds.center,
|
||||
50.0
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user