Add gradientPerturb (3d version only)

This commit is contained in:
Edwin Jakobs
2020-04-06 22:06:40 +02:00
parent ac248b1a2e
commit 36f5d5b96d
4 changed files with 158 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.colorBuffer
import org.openrndr.extra.noise.gradientPerturbFractal
import org.openrndr.extra.noise.simplex
import org.openrndr.math.Vector3
import kotlin.math.absoluteValue
fun main() {
application {
program {
val cb = colorBuffer(width, height)
val shad = cb.shadow
extend {
for (y in 0 until height) {
for (x in 0 until width) {
val p = gradientPerturbFractal(300, frequency = 0.8, position = Vector3(x/320.0,y/240.0, seconds))
val d = simplex(300, p.x, p.y, p.z).absoluteValue
shad[x, y] = ColorRGBa(d, d, d, 1.0)
}
}
shad.upload()
drawer.image(cb)
}
}
}
}