[osg-users] How to improve frame rate when loading multiple buildings ??

David Heitbrink david-heitbrink at uiowa.edu
Wed Feb 22 10:51:26 PST 2017


I would try to look at instancing. The OSG Forest is a good example. 

Instancing is were you tell the GPU to draw an object X number of times, and  in the vertex shader you get a built in var gl_InstanceID, that tells you which item it is drawling (i.e. if you are drawling 100 versions, this will go from 0 to 99). So in the vertex shader you move each vertex to a new position, based the instance ID.

You might have to get a little creative in terms of textures management/mapping so each building has a different texture. You could say create a large texture mosaic, and adjust the texture coordinates based on your instance ID.

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=70316#70316








More information about the osg-users mailing list