- Home /
Disabling a Pass or Subshader Programmatically
I'm looking for a way to enable/disable a subshader or a pass based on the state of the game (preferably the pass). I need to remove it from the pipeline when it is disabled, similar to how LOD works.
I haven't found a proper way to do this through any kind of tag.
I am considering two hacks in order to accomplish this: 1. Set a very high LOD for the disabled state, then turn down the LOD when i want it to render. 2. Use the Rendering Path. For instance, if my project uses Forward Rendering, I can set the shader to use Vertex Lit and therefore it won't render.
Another option is simply to replace the shader back and forth, but this solution won't scale with the large amount of content in my project.
What is the best way to accomplish this?
I want to know the answer too. How to switch on/off each passes or subshaders. Anyone knows? btw your LOD hack sounds very interesting!