- Home /
Does setting several Fallbacks in shaders have any effect?
I'm writing some shaders but I don't really know how to test this.
I'd like to know how exactly the fallback in shaders works. Can only one be used or, if there's more do they have any effect? For example say my first fallback is a Transparent Bumped Specular, then under that I have a second fallback Vertexlit, just in case the first fallback isn't met. I've tried it and it doesn't cause any errors, but the docs don't say anything about having more than one fallback they only talk about one.
So does this work or not?
Answer by GerryM · May 16, 2013 at 10:42 PM
Fallback just adds the specified shader's subshaders to the list of subshaders of your shader.
Unity will pick the first subshader suitable for the graphics card/settings.
Adding several fallbacks is possible, but quite useless, as your first fallback will usually handle all cases down to the most simple shader. This is the case, if you add the default diffuse for example.
However, if you want to use several custom fallbacks (which themselves only might contain one subshader for example), you can of course use several ones.
As for testing fallbacks, this is a completely different issue. As you probably don't care about which card can handle which setting, the easiest way to test is to simply delete the more advanced subshaders to see the other ones in action.
Your answer

Follow this Question
Related Questions
Shader Fallback changed in 3.4? 1 Answer
Fallback shaders not working in Asset Bundle? 0 Answers
Shader Fallback Windows Store App 1 Answer
Per Vertex WrapLambert Fallback 0 Answers
How to force the compilation of a shader in Unity? 5 Answers