How to modify shader by adding or removing defines during Viewer::update() #970
-
There are many examples, usually named "dynamic", that modify the scene during the update phase of the presentation/event loop. However, I'm struggling to change the shader stages attached to a GraphicsPipeline within a scene graph from within this loop. I'm working up a minimal example, but maybe there is already an example that I missed or something I should look into? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
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. |
Beta Was this translation helpful? Give feedback.
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.