I don't have experience with true OpenGL instancing. But...

the last pseudo-instanced renderer I worked on was based on the
osgforest osg sample. It even runs on outdated Intel GMA 945 chipsets,
using ARB fragment shaders performing the dynamic repositioning of the
geometry. The osgforest sample currently has a billboard geometry, but
changing that to display cubes wouldn't be so difficult. Drawing 10000
billboards isn't much of a problem with this code.

The displacement for the coordinates is passed to the shader as
glColor() which is a quick but efficient hack. There are many more
openGL states that you could abuse if you need color support. Of
course using the ARB's ProgramEnvParameter/ProgramLocalParameter API
would also be an option. I think glColor() was chosen because it might
be more efficient than a ProgramLocalParameter.

A more self contained version of this billboard renderer is in my
osgrvo2 code sample that I submitted to osg-submissions recently. It
properly checks for availability of the required ARB extensions.

Christian
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to