Recently I've been experimenting with shaders in Unity, particularly terrain beautification with better blending and bump-mapping. It's been a haphazard self-teaching and experimentation process so far. I have a few questions which may fall under basics or advanced.
- What's the best practice for making shaders cross-platform? At the moment I'm developing on Mac only, so hard to know.
- So far my shaders have had no significant effect on frame-rate. What tends to have the most effect? Textures, number of shaders, number of instructions per shader, branching?
- Do I need to offer cut-down versions for lower spec'd hardware, and if so how does it know which version to use?
- Is it worth branching if most of the time a huge amount of work can be skipped, e.g. only do bump-mapping within distance x of the camera?
- When blending bump-mapped textures would it pay off to waste texture space by using a completely flat normal texture rather than having a special case for textures with no bump-map?
- What is the instruction count limit based on? Some shaders I've seen seem very "busy" but don't exceed the limits.