Skip to content

How to modify shader by adding or removing defines during Viewer::update() #970

Discussion options

You must be logged in to vote

There isn't an example that illustrates change the defines at runtime.

If you need to change the stages are runtime you are essentially requiring a whole new pipeline to be created, it's not a lightweight dynamic change like updating the contents of a vertex array, uniform or texture.

What you may be able to do is use separate GraphicsPipeline's with the different defines combinations and then assign them as required or use a SwitchState to toggle between them.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by robertosfield
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