I just ran into this strange behavior. When I declare in my GLSL code (worldToTex is the only place this uniform is used in the shader):
[code]uniform float cHeightMapSize;
vec2 worldToTex(vec2 c) {
c += vec2(cHeightMapSize*.5);
c += vec2(.5);
c /= cHeightMapSize;
return c;
}[/code]
Use this as the XML material file:
<material>
<technique name="Techniques/Terrain.xml"/>
<parameter name="HeightMapSize" value="2048." />
<parameter name="TerrainDisplacement" value="16." />
</material>
And set it in the Lua script like this:
Nothing happens, I always get 0 for the value of the parameter.
But when I declare cHeightMapSize as a vec2 in the shader, initialize it to value="2048. 2048."in the XML, and in Lua call SetShaderParameter with Variant(Vector2(2048.,2048.)), everything works as expected. I can post the full code if necessary.