Update Runtime/Passes/AdditionalLightsShadowCasterPass to support poi…
…nt lights Like with spot lights, resolution for each shadow map is computed every frame in order to fit all of them in the common shadow atlas. Some of the current limitations: - ShadowBias possibly needs more precise values - FovBias possibly needs more precise values - Unused shadow faces allocate a slot in the common shadow atlas - Draw calls are generated even for shadow frustums that do not contain shadow casters - Not tested: Standalone players - Not tested: Dynamic scenes - Not tested: Performances - Not tested: Code path using Structured Buffers to pass shadow information to GPU (during shadow pass and lighting loop) - Not tested: Deferred Renderer
Fix point light shadow normal bias issues
Normal bias for point lights now behaves similarly as for spot lights
Include point light shadow fov bias when computing their normal bias …
…- This makes point light shadows look closer to spot light shadows
For punctual lights, use per-vertex light direction when applying sha…
…dow normal bias - This fixes the issue of shadows that changed when point light was rotated. Built-In RP uses a similar approach to apply punctual light shadow normal bias. See UnityWorldSpaceLightDir called by UnityClipSpaceShadowCasterPos in UnityCG.cginc: https://github.cds.internal.unity3d.com/unity/unity/commit/93015b67a6e1afdfe00867fdd3a336eaa835f54d#diff-c2818feb2f37e566cf36ca5cab57a99eR533 https://github.cds.internal.unity3d.com/unity/unity/blob/93015b67a6e1afdfe00867fdd3a336eaa835f54d/External/shaderlab/CGIncludes/UnityCG.cginc#L76
Fix in all supported resolutions point light shadow frustum fov biase…
…s, to avoid missing shadows at cube face boundaries
Point Light Shadows work also when using StructuredBuffers to pass sh…
…adow data to the lighting shaders + Fixed indexing issue when using non-shadow-casting additional light Some known issues still happening: - If only a single light in the scene is set to use soft shadows, all punctual light shadows will be soft (even if their setting is "Hard") - Toggling setting "Soft Shadows" in UniversalRP asset also impacts shape of shadows from punctual light set to cast "Hard Shadows"
Update UniversalGraphicsTest scene 105_TransparentReceiveShadows's sp…
…ot light shadow's Normal Bias to match reference image - Since revision ed8fcbe Normal Bias is applied using actual spot light direction
Apply change ed8fcbe to Terrain shaders too (i.e for punctual lights,…
… use per-vertex light direction when applying shadow normal bias)
Fix issue: "disabling Soft Shadows in UniversalRP.asset changes shape…
… of Hard Shadows"
Assign ShadowSplitData info to ShadowDrawingSettings before passing i…
…t to ScriptableRenderContext.DrawShadows - Reduces the number of shadow casters rendered to the shadow map
Update comment about Directional Light Shadow culling
See also native-side changes introduced for Persistent Intermediate Renderer: https://github.cds.internal.unity3d.com/unity/unity/commit/89f4e3b https://github.cds.internal.unity3d.com/unity/unity/commit/fbe6025 https://github.cds.internal.unity3d.com/unity/unity/commit/8652678
Add UniversalGraphicsTest suite scene checking for regressions with a…
…dditional light shadows Test fails if "hard shadows" setting is replaced by "soft shadows" setting Test fails if "soft shadows" setting is replaced by "hard shadows" setting Test fails if "no shadows" setting is replaced by "shadows" setting Test fails if one of the punctual lights in the scene is not rendered