Creating your own SRP
Developing performant code is never easy, and rendering is no exception. The famous programming mantra of “make it work, make it right, make it fast” typically applies very well to coding shaders. Usually, you’ll need to iterate multiple times over your scripts to really get the effects right, and then when the optimization phase comes, you’ll have to once again rework the whole thing to squeeze the performance out of your code.
We’ve seen, in the two first sections of this chapter, that this optimization step can be about choosing the right option for your shader lighting mode, or even doing some low-level data type conversions. But there might come a day when these fall short for you – if your project is really too special, and if it leverages really unique visual features, then perhaps Unity’s built-in options won’t be enough.
Because, despite our best efforts, we haven’t yet reached a point...