[osg-users] binding a shader uniform to a matrix transform node
botorabi at gmx.net
Tue Jul 15 11:01:50 PDT 2008
i am trying to setup a couple of meshes which should share the same geodes (vegetation meshes). the only difference between the meshes of same type is the transformation and a height bias which is used by a vertex shader program.
the height bias is defined as an uniform in the vertex program. i cannot set the uniform in the geometry's state set as the height bias must be set for every mesh individually. so i tried to set the uniform in the matrix transform nodes which contains the geodes. however it seems that the value of the uniform does not arrive with right value in the vertex shader. if the uniform is set in geodes' stateset the value is ok, though.
now my question: may i try another approach? is something wrong with setting an uniform ina matrix transform node?
thanks for any help
p.s.: here is a snippet of the osg file:
type float 1 FloatArray 1
0.5 0 0 0
0 0.5 0 0
0 0 0.5 0
-0.0344534 0.0439845 -0.674881 1
More information about the osg-users