[osg-users] Select StateSet subset to render basic colors

Chunyang Gou chunyang.gou at tassinternational.com
Wed Jul 26 02:18:02 PDT 2017


Hi,

I have an application which requires a specific rendering pass of a scenegraph with complete model assets (textures, materials, specialized gl programs, etc.). This pass is special in the sense it only uses per model instance IDs to render an "object ID world" image, instead of using the detailed model assets.

For that purpose I had to manually "pick" a subset of the model StateSet. One one hand, the full-stack statesets incurs performance degradation due to unnecessary GL state changes, so I'd like to strip them as much as possible. On the other hand, stateset attributes such as depth test/alpha test (osg::AlphaFunc, osg::Depth, etc.) are still needed for my purpose (i.e., "object ID world" rendering).

It turned out that this manual "selection" of stateset subset is trial-and-error and error prone.

Does anyone have better idea?

Many thanks!

... 

Thank you!

Cheers,
chunyanggou

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







More information about the osg-users mailing list