Quick question for all you shader wizzards out there, target platform is IOS.
Let’s say I want 3 different things for a shader:
1. Unlit + Lightmap Support * Color.
2. Unlit + Lightmap Support.
3. Unlit * Color (no lightmap support).
Now I can write the shader with a bunch of #ifdef regions, branching to all 3 different outcomes depending on settings I choose from script. It keeps all the code in 1 place and makes it easier for organization.
Or I could write 3 different versions of the same shader. I’m not a big fan because I don’t like code duplication, and it also makes it harder to organize everything and keep track of all the changes.
The question is, how much of an impact does a shader with too many branches have on the performance in an IOS game? If anyone has some “PRO” pointers for me I would really appreciate it, as always
Thanks for your time guys,
Stephane