t1k:unity:rendering:urp
| Field | Value |
|---|---|
| Module | rendering |
| Version | 3.1.7 |
| Effort | high |
| Tools | — |
Keywords: rendering, unity, Universal Render Pipeline, URP
How to invoke
Section titled “How to invoke”/t1k:unity:rendering:urpUnity URP — Pipeline Configuration & Rendering
Section titled “Unity URP — Pipeline Configuration & Rendering”Pipeline-level reference for URP in Unity 6 (com.unity.render-pipelines.universal v17.x).
For shader code/HLSL, see unity-shader-graph. For ECS rendering, see dots-graphics.
URP Version
Section titled “URP Version”- URP: 17.x (Unity 6000.x) | Rendering Path: Forward (default) | Render Graph: enabled by default
Rendering Paths
Section titled “Rendering Paths”| Path | When to Use | Additional Lights | Performance |
|---|---|---|---|
| Forward | Simple scenes, mobile | Per-object limit (4–8) | Best mobile |
| Forward+ | Many lights | Clustered, no per-object limit | Good desktop |
| Deferred | Many lights + SSAO | G-buffer based, unlimited | Desktop/console |
Set in: URP Asset → Rendering → Rendering Path
Gotcha — RenderingMode enum (CRITICAL): In
UniversalRendererData.asset,m_RenderingModeis NOT sequential:0=Forward, 1=Deferred, 2=Forward+. Setting1gives Deferred, NOT Forward+. Always use2for Forward+.
URP Asset Key Settings
Section titled “URP Asset Key Settings”| Setting | Location | Notes |
|---|---|---|
| Rendering Path | Rendering | Forward / Forward+ / Deferred |
| Depth Texture | General | Required for depth-based effects |
| Opaque Texture | General | Required for distortion/refraction |
| Main Light Shadows | Shadows | Resolution, cascade count (1–4) |
| HDR | Quality | Enable for post-processing |
| SRP Batcher | Advanced | Always keep enabled |
| GPU Resident Drawer | Advanced | Auto-batches static meshes via BRG |
| GPU Occlusion Culling | Advanced | Enable with GPU Resident Drawer |
Camera Stacking
Section titled “Camera Stacking”// Base Camera: Render Type = Base// Overlay Camera: Render Type = Overlay, Clear Depth onlyvar baseCamData = baseCamera.GetUniversalAdditionalCameraData();baseCamData.cameraStack.Add(overlayCamera);Post-processing applies to Base Camera only. Overlay cameras inherit base output.
→ See references/post-processing-guide.md for Volume system setup, built-in overrides, scripting volumes, custom post-processing, HDR requirements, and performance notes.
Render Features
Section titled “Render Features”Inject custom render passes at specific URP loop points:
public class MyFeature : ScriptableRendererFeature{ public override void Create() { /* create passes */ } public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData data) { myPass.renderPassEvent = RenderPassEvent.AfterRenderingOpaques; renderer.EnqueuePass(myPass); }}→ See references/urp-render-features.md for full pass implementation patterns and injection points.
Shader Multi-Compile Keywords
Section titled “Shader Multi-Compile Keywords”→ See references/urp-shader-keywords.md for complete keyword list.
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE#pragma multi_compile _ _SHADOWS_SOFT#pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS#pragma multi_compile_fogGPU Resident Drawer (Unity 6)
Section titled “GPU Resident Drawer (Unity 6)”Replaces standard batching with BatchRendererGroup for compatible renderers.
m_GPUResidentDrawerMode | Meaning |
|---|---|
0 | Disabled — standard SRP Batcher only |
1 | Instanced Drawing — auto-batches via BRG (recommended for DOTS) |
Requirements: isStatic = true or ECS entities, SRP Batcher compatible materials, compute shader support.
Gotchas: incompatible with dynamic batching; Linux may lack BatchBufferTarget support; custom shaders need #pragma multi_compile _ DOTS_INSTANCING_ON.
→ See references/urp-debugging-guide.md for the full URP issue diagnosis table (7 symptoms with causes and fixes).
Cross-References
Section titled “Cross-References”unity-shader-graph— HLSL/Shader Graph, SRP Batcher |dots-graphics— ECS rendering |dots-battlefield— vertex color terrain
Reference Files
Section titled “Reference Files”| File | Contents |
|---|---|
references/post-processing-guide.md | Volume setup, built-in overrides, scripting volumes, HDR, performance |
references/urp-render-features.md | ScriptableRendererFeature, RenderPassEvent injection points |
references/urp-shader-keywords.md | Multi-compile pragmas for shadows, lights, fog, SSAO, DOTS |
references/urp-debugging-guide.md | Common URP issue diagnosis — pink materials, black objects, shadows, SRP Batcher |
references/rendermeshindirect-gotchas.md | Graphics.RenderMeshIndirect under RenderGraph — RenderParams layer-mask silent skip, UnityStats undercount, supportsIndirectArgumentsBuffer capability probe |
Gotchas
Section titled “Gotchas”- URP Asset and Renderer Asset are separate references — switching one without the other shows blank scenes.
- Forward+ requires URP 14+ — earlier versions silently fall back to Forward, masking light-count issues.
- Render scale at runtime via
UniversalRenderPipeline.asset.renderScaleis per-asset, not per-camera — set on the asset reference, not the camera component. Graphics.RenderMeshIndirect+new RenderParams { ... }object-initializer silently skips the draw under RenderGraph — the initializer leavesrenderingLayerMask = 0, which makes URP filter the draw out (cull dispatch runs,instanceCountis non-zero, zero pixels paint). Construct via thenew RenderParams(material)CONSTRUCTOR (sets the project-default layer mask), or setrenderingLayerMaskexplicitly. GPU-indirect analog of thematProps-dropped-under-RenderGraph lesson. Also:UnityStats.trianglesdoes NOT count indirect instances (verify with a screenshot, not the tri count); the capability property isSystemInfo.supportsIndirectArgumentsBuffer(Arguments plural, Buffer singular — there is nosupportsIndirectArgumentBuffers). → Seereferences/rendermeshindirect-gotchas.md.