Does your vertex shader code perform any lighting calculations? I remember that in my instancing vertex shader code I had to explicitly perform required lighting calculations for ambient, diffuse, specular components (the usual Blinn-Phong lighting equations) and set the vertex colors accordingly.
Christian 2016-12-29 22:23 GMT+01:00 Andrew Cunningham <[email protected]>: > Hi guys, > Can you help me out with this one more time:) > > As I said, I am now able to draw my geometry ( a simple square) using > hardware instancing. It works perfectly with excellent performance for > millions of squares- except for one thing. > > Now I want to light the squares. I have turned on lighting, assigned a > normal array to the geometry being instanced and assigned material colors, > but I get unlit 'black squares' while the rest of my scene is lit just > fine. Clearly something to do with hardware instancing using the vertex > shader. > > Do I need to add a fragment shader? I am a bit lost here. > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=69801#69801 > > > > > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

