[orx-fx] Add comments to demos

This commit is contained in:
Abe Pazos
2025-09-23 19:20:42 +02:00
parent 857f3458e3
commit fd022e9d0e
16 changed files with 203 additions and 70 deletions

View File

@@ -8,6 +8,20 @@ import org.openrndr.extra.fx.patterns.Checkers
import org.openrndr.math.Vector2
import kotlin.math.sin
/**
* Demonstration of how to use the [BlendSpectral] filter to combine two images, using
* this pigment-simulation color mixing approach.
*
* The program:
* - generates two images
* - blurs one of them
* - creates and draws a checkers-pattern as the background
* - mixes and draws both images
*
* The `fill` factor, which controls how the top and the bottom colors are mixed, is animated.
*
* The `clip` parameter is also animated and toggles every 6 seconds.
*/
fun main() = application {
configure {
width = 800
@@ -35,7 +49,7 @@ fun main() = application {
extend {
drawer.image(checked)
blendSpectral.fill = sin(seconds) * 0.5 + 0.5
blendSpectral.clip = seconds.mod(4.0) > 2.0
blendSpectral.clip = seconds.mod(12.0) > 6.0
blendSpectral.apply(a, b, mixed)
drawer.image(mixed)
}