Sam, I think you are not calling setNumElements() on your uniform array. You could also do that in the osg::Uniform constructor.
Anyway, a uniform array of matrices is going to be limiting in terms of scale and speed -- I'd recommend a buffer object instead. (osgEarth uses an osg::TextureBuffer.) Glenn Waldron On Fri, Apr 15, 2016 at 2:35 PM, sam <brko...@gmail.com> wrote: > Hi All, > > I'm having some trouble getting my code to use hardware instancing. I've > referenced OSGEarth, DrawInstanced example, and a few different code > samples on the web. I've gotten pretty close but I seem to be at a bit of > an impasse. > > This screenshot shows what the map looks like with the default rendering: > > http://imgur.com/fKvunfd > > This screenshot shows what the map looks like after I apply my instance > rendering code to it: > > http://imgur.com/zZCzurr > > The map is composed of a lot of little nodes. I figured instanced > rendering would be helpful in this case. The map has ~4000 individual > nodes. Two of the nodes are repeated 465 and 266 times. I have trimmed down > my code and it is posted here: > > http://pastebin.com/ifSVSzD6 > > From what it looks like. Its rendering one copy of every nodes but not > anymore that that. I have commented out lines 215 to 224 as it doesn't work > at all. Any insight or help would be greatly appreciated. > > Thanks, Sam > > _______________________________________________ > 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