← All resources

Optimizing camera overhead to the absolute minimum

Blog Advanced

Jan Mróz

Proposed by Jan Mróz

Visit resource ↗

Description

Jan Mróz's April 2026 Procedural Pixels article attacks Unity URP auxiliary camera overhead when a project needs a tiny orthographic depth texture for gameplay effects such as waterfall occlusion.

Using a 256 by 4 depth target and obstacle depth comparison in shader code resembling shadow mapping, he profiles full Camera render-graph cost versus an 84-line LightweightCamera that skips culling and draws a known renderer list through ScriptableRenderContext command buffers.

Advanced Unity tech artists and graphics programmers comfortable modifying URP render events and matrix math are the audience; low-end mobile multi-camera limits motivate the problem.

The post links to his broader rendering-into-texture guide, includes HLSL and C# excerpts, and reports roughly thirty times lower CPU time on desktop and Android compared with a standard depth-only camera.

It is a scoped case study for teams stuck with plugins that spawn extra cameras for narrow depth passes.