- Home /
Shaders: Turn culling on/off by keyword
It seems that #pragma multi_compile together with keywords can be used only in CGPROGRAM ENDCG block.
What i need is just to turn on/off culling in runtime. like that:
SubShader {
Tags { "RenderType"="Opaque" }
LOD 100
#if defined (CULLING_OFF)
Cull Off
#endif
CGPROGRAM
//sufrace shader ...
but i get a syntax error there.
Comment
I'd like to know what the ideal solution to this is as well so we don't need to have different shaders entirely for different cull modes.
Your answer
![](https://koobas.hobune.stream/wayback/20220613144303im_/https://answers.unity.com/themes/thub/images/avi.jpg)