Skip to content

Dynamically submit color arrays and switch pipelines #1314

Discussion options

You must be logged in to vote

Looking at your shader, it looks to me like you could update the IntensityParam uniform per frame and should perform well. Having conditionals in the vertex shader might be performance bottleneck but I think modern hardware is so fast you'll be probably be limited more by memory bandwidth reading all the vertex data.

What you set up the vsg::DescriptorBuffer to pass the IntensityParam uniform you should just need to set up the data's property.dataVariance to vsg::DYNAMIC_DATA, then call dirty() on the data when you update it.

Have a look at the vsgExamples that set up DYNAMIC_DATA, they do it with different data, for vertex arrays, to textures to uniforms:

./examples/volume/vsgvolume/vsgv…

Replies: 3 comments 2 replies

Comment options

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

Comment options

You must be logged in to vote
0 replies
Comment options

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

Answer selected by zhuzhiyong8679
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