- Home /
Exit out of multipass shader
Hi, I have a multipass shader that is in the following format:
Shader "ShaderLib/MultipassShader" {
Properties {
}
Category {
SubShader {
Pass {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
VertexShaderOutput vert(appdata_base vi) {
...
}
half4 frag(VertexShaderOutput vo) : COLOR {
...
}
ENDCG
}
Pass {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
VertexShaderOutput vert(appdata_base vi) {
...
}
half4 frag(VertexShaderOutput vo) : COLOR {
...
}
ENDCG
}
Pass {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
VertexShaderOutput vert(appdata_base vi) {
...
}
half4 frag(VertexShaderOutput vo) : COLOR {
...
}
ENDCG
}
...
...
}
}
}
Is there a way to exit out of any pass (and bypass all the following passes), depending on some value I am reading from an input texture map?
Thanks!
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613064545im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to first draw all objects using one pass, then using another pass? 0 Answers
Shader compiler: internal error compiling shader snippet type=0 platform=0: 1 Answer
Shadow Support in Custom Shader 0 Answers
How would I grab the lighting pass in a post process shader for deferred lighting? 0 Answers