Hello,
the dissolve shader wich use a vec2 unifor parameter to apply realtime effect modification is working great
i try to do the same with a shader of mine, but using a float uniform
initialisation of shader material :
[java]
Float stripesValue=0;
mat.setFloat(“StripesValue”, stripesValue);
[/java]
update during game loop :
this does not work
[java]
stripesValue=(float)Math.random();
[/java]
this does work
[java]
stripesValue=(float)Math.random();
Node n=(Node) ((Node)spatial).getChild(0);
Geometry geo=(Geometry) n.getChild(0);
geo.getMaterial().setFloat(“StripesValue”, stripesValue);
[/java]
why do i nead to update “manualy” the parameter for a Float, when for a Vector2 (or vec2) it does the trick automaticaly ?
for the dissolve shader
[java]
dissolveVector.x+=0.1;
[/java]
this code works without having to update the parameter to the material
i guess it has to do with the fact that a vector contains instances of x and y
but the float i pass as parameter is an instance too
is this a bug ?
thx