[osg-users] Tearing hair out over simple GLSL instancing

Christian Buchner christian.buchner at gmail.com
Fri Dec 30 02:05:18 PST 2016


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 <osg at a-cunningham.com>:

> 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
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20161230/5751c390/attachment-0003.htm>


More information about the osg-users mailing list