[orx-temporal-blur] Add gain and color matrix controls

This commit is contained in:
Edwin Jakobs
2021-07-25 12:09:09 +02:00
parent f6263f76f5
commit c388cbe7e2
5 changed files with 125 additions and 27 deletions

View File

@@ -10,27 +10,6 @@ while processing the tail-end of the extension chain. This multi-sampling strate
entirely suited in real-time and/or interactive settings.
`orx-temporal-blur` works well with programs that use `seconds` for their animation input.
This includes `Animatables`, but only after the `Animatable` clock is synchronized with the `Program` clock.
(Which you should already have done when using `ScreenRecorder`)
Synchronizing clocks in OPENRNDR 0.3.36 (current release):
```
Animatable.clock(object: Clock {
override val time: Long
get() = (clock() * 1E3).toLong()
})
```
Synchronizing high precision clocks in OPENRNDR 0.3.37 (future release)
```
Animatable.clock(object: Clock {
override val time: Long
get() = timeNanos / 1000
override val timeNanos: Long
get() = (clock() * 1E6).toLong()
})
```
Note that time-step-based simulations or integrations will likely break because your drawing code will be executed multiple times
per frame.
@@ -39,9 +18,24 @@ per frame.
```kotlin
extend(TemporalBlur()) {
duration = 0.9
samples = 30
duration = 0.9 // duration is in frames
samples = 30
fps = 60.0
jitter = 1.0
}
```
## Color shifts
Additionally, a color matrix can be set per accumulation step. See [`DemoColorShift01.kt`](src/demo/kotlin/DemoColorShift01.kt)
```
extend(TemporalBlur()) {
colorMatrix = {
// `it` is 0.0 at start of frame, 1.0 at end of frame
tint(ColorRGBa.WHITE.mix(ColorRGBa.BLUE, it))
}
}
```