Field Value Module renderingVersion 3.1.7Effort highTools —
Keywords: optimization, rendering, shadows, unity
/t1k:unity:rendering:shadow-optimization
shadow, shadow map, shadow resolution, cascade, soft shadows
light probe, light probe group, probe placement
baked indirect, mixed lighting, lightmap bake
shadow acne, shadow bias, shadow distance
ShadowCastingMode, shadow casting
m_MainLightShadowmapResolution : 1024 # 256/512/1024/2048/4096
m_ShadowDistance : 30 # Max shadow render distance (meters)
m_ShadowCascadeCount : 2 # 1-4 cascades
m_Cascade2Split : 0.3 # % of distance for near cascade
m_SoftShadowsSupported : 1 # 0=off, 1=on
m_SoftShadowQuality : 2 # 0=Low, 1=Medium, 2=High
m_ShadowDepthBias : 2 # Reduce shadow acne (1-3)
m_ShadowNormalBias : 2 # Reduce shadow acne (1-3)
Arena Resolution Distance Cascades Split Small (20×20) 512 20 1 — Medium (40×40) 1024 30 2 0.3 Large (80×80) 2048 50 3 0.1/0.3 Open world 4096 100+ 4 0.067/0.2/0.467
1 cascade : Uniform texel density — ok for small arenas
2 cascades : Near cascade (30% distance) gets 4× texel density — best for fixed-camera arenas
3-4 cascades : Needed for large worlds with close-up + distant shadows
renderer.shadowCastingMode = ShadowCastingMode.Off; // No shadow
renderer.shadowCastingMode = ShadowCastingMode.On; // Normal shadow
renderer.shadowCastingMode = ShadowCastingMode.TwoSided; // Both faces cast
renderer.shadowCastingMode = ShadowCastingMode.ShadowsOnly; // Invisible, shadow only
Entity Type Shadow Reason Units (characters) ON Visual grounding Trees/obstacles ON Environment grounding Boundary walls ON Arena structure Terrain Receive only Ground plane Arrows/projectiles OFF Too fast, invisible AOE/VFX (transparent) OFF No meaningful shadow Particles OFF Performance waste UI elements OFF 2D overlay
const float probeSpacing = 2f ; // 2m grid
const float groundOffset = 0.5f ; // Near ground
const float upperHeight = 3f ; // Captures tree canopy shadows
// 2-layer grid: ground + upper
positions. Add ( new Vector3 (px, groundOffset, pz));
positions. Add ( new Vector3 (px, upperHeight, pz));
(ArenaWidth/spacing + 1) × (ArenaDepth/spacing + 1) × 2 layers
40×40 arena, 2m spacing → 21×21×2 = 882 probes
Entities Graphics auto-samples light probes — NO extra components needed
Probes must be in main scene (not SubScene)
Zero runtime cost — probes are baked SH coefficients
Directional Light → lightmapBakeType = LightmapBakeType.Mixed
URP Asset → m_MixedLightingSupported: 1 (default)
Static flags on all arena objects (isStatic = true)
Window → Rendering → Lighting → “Generate Lighting” (manual bake)
Realtime shadows for ALL objects (static + dynamic)
Baked indirect bounce for static geometry only
Units auto-sample light probes for ambient variation
Shadowmask NOT supported by Entities Graphics — use Baked Indirect only
SubScene = 1 lightmap per SubScene — ok for single SubScene
Auto-generate lighting DISABLED with Entities Graphics installed — must bake manually
GPU Resident Drawer “OnDemand” shadow bug — use “EveryFrame” mode if shadows flicker (note: invisible entities are more likely ChunkWorldRenderBounds NaN corruption — see #9)
Bias too low → shadow acne (striping). Bias too high → peter-panning (shadows detach)
Shadow distance > arena diagonal wastes texels on empty space
Soft shadows add ~0.1ms GPU cost — negligible on modern GPUs
Forward+ has no GBuffer pass — affects impostor baking, not shadows
→ See references/shadow-safety-guide.md for Safe vs Unsafe shadow change table, CRITICAL lighting corruption gotchas, and Rendering Debugger workflow.