Optimizing Your Code, or Making Your Own Pipeline?
In the previous chapter, we explored some of the tools Unity provides us with for creating efficient cross-platform shaders. We talked about built-in shader compilation tricks, shader branching, and useful macros.
But, of course, compiling shaders properly is not the only way you can optimize your rendering. If you want to get the most out of your shaders, you also need to make the right choices when actually coding them up.
Or, even better, if you know your renders require very specific processing, you might opt out of Unity’s default generalist pipelines and make your own!
So, in this chapter, we are going to explore a few tips and techniques for optimizing your shader code and gaining some precious extra milliseconds. To do so, we’ll talk about the following topics:
- Picking the right shading model
- Optimizing your runtime performance
- Creating your own SRP