<div dir="ltr"><div><div><br>Does your vertex shader code perform any lighting calculations?<br><br></div>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.<br><br>Christian</div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-12-29 22:23 GMT+01:00 Andrew Cunningham <span dir="ltr"><<a href="mailto:osg@a-cunningham.com" target="_blank">osg@a-cunningham.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi guys,<br>
Can you help me out with this one more time:)<br>
<br>
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.<br>
<br>
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.<br>
<br>
Do I need to add a fragment shader? I am a bit lost here.<br>
<span class=""><br>
------------------<br>
Read this topic online here:<br>
</span><a href="http://forum.openscenegraph.org/viewtopic.php?p=69801#69801" rel="noreferrer" target="_blank">http://forum.openscenegraph.<wbr>org/viewtopic.php?p=69801#<wbr>69801</a><br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.<wbr>openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.<wbr>org/listinfo.cgi/osg-users-<wbr>openscenegraph.org</a><br>
</div></div></blockquote></div><br></div>