Hello,
I’ve been playing around with the new live coding version of OPENRNDR with oliveProgram as shown in Edwin’s great introduction talk over at github. I like the logic behind this, enabling layers and the ease of postFX with shaders. Two questions - is there any documentation about the available shaders that can be applied and is there a good way in which one can extend classes for incorporating one’s own shaders?
Secondly, I’ve encountered a troublesome crash lately using Olive. My computer freezes and the mouse pad locks suddenly. No solution but to reboot. This problem I noticed occurred after automating the offset values for the Perturb fx. This is the line :
post(Perturb()) {
phase = simplex(0, seconds * 0.10) * 0.75 + 0.10
offset = Vector2(0.0, simplex(0, seconds * 0.05) * 0.75)
}.addTo(gui)
My program uses a font import and follows the basic structure that Edwin showed in his video, manipulating layers with different post FX. I’m working with a MacBook Pro Retina 13inch (2015) running the latest version of Catalina. Here’s the whole program just in case I’m doing something terribly wrong elsewhere.
/**
* openrndr-template
* Created by tisane on 21/05/2020.
*/
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.loadFont
import org.openrndr.extra.compositor.*
import org.openrndr.extra.fx.blend.Add
import org.openrndr.extra.fx.blend.Multiply
import org.openrndr.extra.fx.blend.Screen
import org.openrndr.extra.fx.color.ColorCorrection
import org.openrndr.extra.fx.distort.Perturb
import org.openrndr.extra.fx.patterns.Checkers
import org.openrndr.extra.gui.GUI
import org.openrndr.extra.gui.addTo
import org.openrndr.extra.noise.simplex
import org.openrndr.extra.olive.oliveProgram
import org.openrndr.math.Vector2
/**
* This is a template for a live program.
* REF : https://www.youtube.com/watch?v=qdgnRct0_nw&feature=youtu.be&t=12428
* It uses oliveProgram {} instead of program {}. All code inside the
* oliveProgram {} can be changed while the program is running.
*/
fun main() = application {
configure {
width = 900
height = 800
}
oliveProgram {
val gui = GUI()
val c: Composite = compose {
// Background layer
layer {
//post(Checkers())
backgroundColor = ColorRGBa.BLACK
}
layer {
val font = loadFont(
"data/IBMPlexSans-Bold.ttf",
200.0
)
// TEXT LAYER 1
layer {
draw {
drawer.fill = ColorRGBa.YELLOW
drawer.fontMap = font
for (y in 0 until 5) {
var xOff = simplex(0, seconds * 1.15) * 200.0 + 100.0
drawer.text("RNDR", 300.0, y * 125.0+200.0)
}
}
}
// TEXT LAYER 2
layer {
draw {
drawer.fill = ColorRGBa.BLUE
drawer.fontMap = font
for (y in 0 until 5) {
var xOff = simplex(0, y * 0.25) * 15.0 + 300.0
drawer.text("RNDR", xOff+2.0, y * 125.0+200.0)
}
}
//blend(Multiply())
}
// Filters >>>
post(Perturb()) {
//scale = simplex(0, seconds * 0.015) * 0.50 + 1.50
phase = simplex(0, seconds * 0.10) * 0.75 + 0.10
//offset = Vector2(0.0, simplex(0, seconds * 0.05) * 0.75)
//gain = simplex(0, seconds * 0.005) * 0.25 + 0.10
}.addTo(gui)
post(ColorCorrection()).addTo(gui)
}
}
extend(gui)
extend {
c.draw(drawer)
}
}
}
```