Also you can declare #version 110  in both shaders, fix any errors that appears and see if it makes any difference (this can be useful on nvidia cards)
26.10.2011, 22:52, "Pecoraro, Alexander N" <alexander.n.pecor...@lmco.com>:

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

Reply via email to