Open
Description
Operating System
Linux
OPENRNDR version
0.4.4 or SNAPSHOT
ORX version
0.4.4 or SNAPSHOT
Java version (if applicable)
No response
Describe the bug
When using drawer.bezierPatch()
with a shadeStyle
and passing a parameter("foo", 1.0)
, the parameter is not present in the generated shader. Commenting out drawer.bezierPatch()
makes the program run.
GLSL compilation problems in
0:35(16): error: `p_foo' undeclared
0:35(11): error: cannot construct `vec4' from a non-numeric data type
Steps to reproduce the bug
import org.openrndr.application
import org.openrndr.draw.loadImage
import org.openrndr.draw.shadeStyle
import org.openrndr.extra.shapes.bezierPatch
import org.openrndr.extra.shapes.drawers.bezierPatch
import org.openrndr.math.Polar
import kotlin.math.sin
fun main() {
application {
program {
val tex = loadImage("data/images/pm5544.png")
extend {
drawer.shadeStyle = shadeStyle {
//fragmentTransform = "x_fill = texture(p_tex, va_texCoord0.xy);"
//parameter("tex", tex)
fragmentTransform = "x_fill = vec4(p_foo);"
parameter("foo", 1.0)
}
val bp = bezierPatch(
List(4) {
(drawer.bounds.center +
Polar(it * 90.0, sin(seconds + it) * 100.0 + 150.0).cartesian).xy0
}
)
drawer.bezierPatch(bp)
}
}
}
}