Hello, I’m trying to optimize my 2d game’s rendering performance and could use some help.
Unity: 2021.3.33f1
Universal RP 12.1.13
I’m stepping through the Frame Debugger and noticed something curious - Each 2d light is rendered 3x before the lighting loop finishes. The screenshots below will show how I’ve determined this:
This is what the final render should look like. I’ve decreased the global light intensity and upped the 2d light’s intensity to make it more obvious.
The Frame Debugger shows me that the 2d light drawing sequence (for Blend Style 0) starts with a “clear”. So far so good:
Then it draws the first mesh. Still looking good:
But THEN it clears again, clears one more time, draws the same mesh again, clears again, then draws the mesh one more time:
All said and done, it takes 7 draw calls instead of 2. If I have more lights, it does this pattern:
Clear
Draw all n lights
Clear
Clear
Draw all n lights
Clear
Draw all n lights
So it’s basically doing 2n+3 more draw calls than necessary.
Here are screenshots of the particular light in question, as well as my 2d Renderer Data
Can someone help me understand if this is expected, and why? Or does this seem like a misconfiguration of my lights? Any help would be greatly appreciated.
Thank you!










