Summary
In this chapter, we discussed some inner workings of Unity’s shader compilation system, and how advanced technical artists can leverage a few settings and clever tricks to further improve the performance of their shaders.
We began by presenting some important points about shader management in Unity, such as caching, asynchronous compilation, and AssetBundles organization.
We then explored the various forms of branching we can use in our Unity shaders, and what should be used in which case, between static branching, dynamic branching, and shader variants.
At the end, we listed some commonly used #pragma
directives, and we saw how built-in macros and preprocessor directives can help us with platform-dependent compilation and cross-platform distribution.
In the next chapter, we will continue this talk on shader optimization and dive more into practical tips for improving the performance of your shaders through coding decisions. We will also quickly introduce...