I can’t figure out why the shader embedded in the attached file doesn’t work without the hard coded position and scale variables. I’m trying to write a hardware instancing shader that uses glDrawElementsInstancedEXT() to draw multiple instances of a box where the position and scale of the box is computed on the GPU using uniform arrays indexed by gl_InstanceID. It seems like my uniform arrays are not being initialized even though the scene graph has a StateSet that contains the Uniform attributes. The only way for me to make it work the way I want is to explicitly set the position and scale in the shader with some hard coded values, but once I remove that code it stops working.
Any idea what I’m doing wrong?
Thanks.
Alex
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org