Performance: 2D camera setup
MEDIUM IMPACT
This affects the rendering speed and smoothness of the 2D game view by controlling what and how much is drawn on screen.
Camera.main.orthographicSize = 5; // Small view focused on player area Camera.main.cullingMask = LayerMask.GetMask("Player", "Environment"); // Only render needed layers
Camera.main.orthographicSize = 1000; // Very large view showing many off-screen objects Camera.main.cullingMask = ~0; // Render all layers including unused ones
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Large orthographic size with all layers | N/A | N/A | High GPU overdraw and many draw calls | [X] Bad |
| Small orthographic size with limited layers | N/A | N/A | Low GPU overdraw and fewer draw calls | [OK] Good |