Considerations
The shader uses compilation flags to enable and disable different effects, meaning that only the code of enabled effects is included in each compiled shader variant. This ensures the GPU only computes the necessary parts, significantly reducing unnecessary calculations and memory usage.
The shader code has been hand-written line by line and is fast, uses as little memory as possible, and has no conditionals. Additionally, Unity will batch instances of the same material and sprite into a single draw call. For other Renderers, a GPU Instancing Toggle is available in the Advanced Configuration of the Material Inspector.
Last updated