Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BezierPatchDrawer doesn't include shadeStyle parameter passed by the user #350

Open
hamoid opened this issue Dec 17, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@hamoid
Copy link
Member

hamoid commented Dec 17, 2024

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)
            }
        }
    }
}
@hamoid hamoid added the bug Something isn't working label Dec 17, 2024
@hamoid hamoid changed the title Bug report: BezierPatchDrawer doesn't include parameter passed by the user BezierPatchDrawer doesn't include parameter passed by the user Dec 17, 2024
@hamoid hamoid changed the title BezierPatchDrawer doesn't include parameter passed by the user BezierPatchDrawer doesn't include shadeStyle parameter passed by the user Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant