- Home /
Shader - Using Multiple Pass for different shader target
Hi Guys, I had a little problem when writing my own vertex/fragment shader.
at first, my shader requires at least SM (Shader Model) 3.0, then I want to create simpler one so it can targeting lower SM (2.0). so I'm trying to do something like this :
SubShader {
Pass {
CGPROGRAM
#pragma target 2.0
...
ENDCG
}
Pass {
CGPROGRAM
#pragma target 3.0
...
ENDCG
}
}
when I set graphic emulation to Shader Model 3, it works. However, it doesn't work when setting graphic emulation to Shader Model 2. How to make this thing work?
owww.... very simple solution, i never $$anonymous$$ding this before.
anyway thanks for your answer.
Answer by Eno-Khaon · Apr 20, 2015 at 09:38 PM
http://docs.unity3d.com/Manual/SL-Fallback.html
Write the Shader 3.0 version with a fallback of the separate 2.0 version.
Your answer
Follow this Question
Related Questions
Disabling a Pass or Subshader Programmatically 0 Answers
Multipass and how to do a Box Blur shader? 0 Answers
How does the unity terrain shader handle an arbitrary amount of textures ? 1 Answer
Shader - What is float3.xy? 1 Answer
Why Unity compiled shader doesn't use the GLSLPROGRAM/GLSL syntax? 0 Answers