[orx-shade-styles] Write comments on demos
This commit is contained in:
@@ -6,6 +6,13 @@ import org.openrndr.extra.camera.Camera2D
|
||||
import org.openrndr.extra.imageFit.imageFit
|
||||
import org.openrndr.extra.shadestyles.fills.noise.noise
|
||||
|
||||
/**
|
||||
* Demonstrates how to render a color image as black and white
|
||||
* using the `whiteNoise` variant of the `noise` shade style.
|
||||
*
|
||||
* A custom `blendFunction` is used to control how pixel colors are
|
||||
* transformed.
|
||||
*/
|
||||
fun main() {
|
||||
application {
|
||||
configure {
|
||||
@@ -22,7 +29,7 @@ fun main() {
|
||||
}
|
||||
blendFunction = """vec4 blend(vec4 o, float n) {
|
||||
| float luma = dot(o.rgb, vec3(1.0/3.0));
|
||||
| return vec4(vec3(smoothstep(luma+0.01, luma-0.01, n)), 1.0);
|
||||
| return vec4(vec3(smoothstep(luma+0.05, luma-0.05, n)), 1.0);
|
||||
|}""".trimMargin()
|
||||
}
|
||||
drawer.imageFit(image, drawer.bounds)
|
||||
|
||||
Reference in New Issue
Block a user