Skip to content

Optimizing scene, selecting geometries and changing materials #1215

Answered by vsg-dev
peterbako asked this question in Q&A
Discussion options

You must be logged in to vote

The graphics hardware/OepnGL just supports changing colour per primitive set or per vertex, so per face material changes you'll need to either ease separate PrimitiveSet per face or duplicate vertices in order to use per vertex colours.

Potentially you could subclass from osg::Drawable and implement the GL calls tuned for your usage case and for the subclass to have the public variables/member variables you need.

Perhaps if you have hardware that supports it you could try out RTX mesh shaders. For this you'd need to the MeshShaders branch of the OSG.

Longer term you might also want to consider the VulkanSceneGraph, both Vulkan and the VSG itself handle scenes where meshes are broken into …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@peterbako
Comment options

Answer selected by peterbako
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants