Profiling your shaders
Now that we know how we can reduce the overhead that our shaders might take, let's take a look at how to find problematic shaders in a scene where you might have a lot of shaders or a ton of objects, shaders, and scripts all running at the same time. Finding a single object or shader among a whole game can be quite daunting, but Unity provides us with its built-in Profiler. This allows us to see, on a frame-by-frame basis, what is happening in the game, and each item that is being used by the GPU and CPU.
Using Profiler, we can isolate items such as shaders, geometry, and general rendering items using its interface to create blocks of profiling jobs. We can filter out items until we are looking at the performance of just a single object. This lets us see the effects that the object has on the CPU and GPU while it is performing its functions at runtime.
Let's take a look through the different sections of Profiler and learn how to debug our scenes...