Skip to content

How to change the color of a Quad created with vsg::Builder #1211

Answered by robertosfield
mallonoce asked this question in Q&A
Discussion options

You must be logged in to vote

Changing the colour will require updating the material uniform or the colour vertex array, in each case there is a data object that you'll need to change on the CPU side and then have this transferred to the buffer on the GPU that the rendering uses. The VSG will setup the GPU side for you in the initial compile traversal setting up vsg::BufferInfo that associate the CPU side vsg::Data with the GPU side vk/vsg::Buffer and the location in the buffer that the data is mapped to.

When you want to dynamically update the data after it's been transferred to the GPU you need to tell the VSG that the the data is dynamic upfront via the vsg::Data::properites.dataVariance setting it to vsg::DYNAMIC_…

Replies: 1 comment 1 reply

Comment options

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

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