Updating material shader Float parameter does not work

@curtisnewton said: not at all

i wrote an engine years ago, and i was just sending values back to shaders without recompiling every time
(glSetAttribute or something)

the point here is that…

it works with dissolve shader (using a vec2 uniform)
it does not with my shader (using a float uniform)

Because a vec2 is a real object. You aren’t changing the vec2 pointer just the values in it.

A float is a primitive. So you are just passing the value. There is no way to pass the address of a primitive variable in Java. You’d have to have it as the field of an object… like in… tada: Vector2f.

And wezrule’s point is that in a shader that has been defined as linking a particular uniform to a define will get recompiled every time you change that uniform. It’s a JME feature.

BTW, you’re “I know everything and you guys are all stupid” attitude won’t get very far… especially when you miss basic Java coding stuff.

1 Like