Summary
In this chapter, we explored various techniques and tools for improving the efficiency of our shader code.
We first talked about lighting models and discussed how Unity provides us with several built-in ones. We saw that they always do a trade-off between realism and power usage and that your target platform has a big impact on the kind of lighting you can use in your games.
Then, we dove into low-level optimization and studied different scoped improvements for shader code, from per-platform computation precision to mathematical operation complexity, alpha testing caveats, and even SRP Batcher compatibility.
Finally, we had a peek at another approach and introduced the basics of writing a custom SRP shader in Unity to completely tune the rendering process to our liking. We saw how the engine gives us easy-to-use and safe tools for customizing our visuals, and how we can debug the render steps in detail thanks to the Frame Debugger window.
As a final note, always...