Skip to content

t1k:unity:rendering:urp

FieldValue
Modulerendering
Version3.1.7
Efforthigh
Tools

Keywords: rendering, unity, Universal Render Pipeline, URP

/t1k:unity:rendering:urp

Unity 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: 17.x (Unity 6000.x) | Rendering Path: Forward (default) | Render Graph: enabled by default
PathWhen to UseAdditional LightsPerformance
ForwardSimple scenes, mobilePer-object limit (4–8)Best mobile
Forward+Many lightsClustered, no per-object limitGood desktop
DeferredMany lights + SSAOG-buffer based, unlimitedDesktop/console

Set in: URP Asset → Rendering → Rendering Path

Gotcha — RenderingMode enum (CRITICAL): In UniversalRendererData.asset, m_RenderingMode is NOT sequential: 0=Forward, 1=Deferred, 2=Forward+. Setting 1 gives Deferred, NOT Forward+. Always use 2 for Forward+.

SettingLocationNotes
Rendering PathRenderingForward / Forward+ / Deferred
Depth TextureGeneralRequired for depth-based effects
Opaque TextureGeneralRequired for distortion/refraction
Main Light ShadowsShadowsResolution, cascade count (1–4)
HDRQualityEnable for post-processing
SRP BatcherAdvancedAlways keep enabled
GPU Resident DrawerAdvancedAuto-batches static meshes via BRG
GPU Occlusion CullingAdvancedEnable with GPU Resident Drawer
// Base Camera: Render Type = Base
// Overlay Camera: Render Type = Overlay, Clear Depth only
var 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.

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.

→ 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_fog

Replaces standard batching with BatchRendererGroup for compatible renderers.

m_GPUResidentDrawerModeMeaning
0Disabled — standard SRP Batcher only
1Instanced 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).

  • unity-shader-graph — HLSL/Shader Graph, SRP Batcher | dots-graphics — ECS rendering | dots-battlefield — vertex color terrain
FileContents
references/post-processing-guide.mdVolume setup, built-in overrides, scripting volumes, HDR, performance
references/urp-render-features.mdScriptableRendererFeature, RenderPassEvent injection points
references/urp-shader-keywords.mdMulti-compile pragmas for shadows, lights, fog, SSAO, DOTS
references/urp-debugging-guide.mdCommon URP issue diagnosis — pink materials, black objects, shadows, SRP Batcher
references/rendermeshindirect-gotchas.mdGraphics.RenderMeshIndirect under RenderGraph — RenderParams layer-mask silent skip, UnityStats undercount, supportsIndirectArgumentsBuffer capability probe
  • 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.renderScale is 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 leaves renderingLayerMask = 0, which makes URP filter the draw out (cull dispatch runs, instanceCount is non-zero, zero pixels paint). Construct via the new RenderParams(material) CONSTRUCTOR (sets the project-default layer mask), or set renderingLayerMask explicitly. GPU-indirect analog of the matProps-dropped-under-RenderGraph lesson. Also: UnityStats.triangles does NOT count indirect instances (verify with a screenshot, not the tri count); the capability property is SystemInfo.supportsIndirectArgumentsBuffer (Arguments plural, Buffer singular — there is no supportsIndirectArgumentBuffers). → See references/rendermeshindirect-gotchas.md.