Search Issue Tracker
By Design
Votes
0
Found in
2021.3.46f1
2022.3.54f1
6000.0.30f1
6000.1.0a7
Issue ID
UUM-90481
Regression
No
Volumetrics break when using a Custom Pass to create a Thickness Buffer for Alpha Clipping
Reproduction steps:
1. Open the attached “Pressure.zip” project
2. Open the “OutdoorsScene”
3. Observe the Game view
4. Move the “Main Camera” inside the boundaries of the “Capsule” GameObject (around (-2;-1;9))
5. Observe the Game view
Expected result: The Volumetric Fog effect is visible in the Game view, like in 3rd step
Actual result: The Volumetric Fog effect is not visible in the Game view
Reproducible with: 2021.3.46f1, 2022.3.54f1, 6000.0.30f1, 6000.1.0a7
Reproducible on: Windows 11
Not reproducible on: no other environment tested
Note:
- Reproduces when ‘Injection Point’ is ‘Before Rendering’ or ‘After Opaque Depth And Normal’
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Warnings in the Bug Reporter window are cut off and not truncated when the Bug Reporter window is resized to its minimum size
- Color is incorrectly applied to objects when initialized with non-normalized parameters
- SerializationUtility.GetManagedReferencesWithMissingTypes() don't return null when “Prefab has missing SerializeReference Types“ warning banner is present
- Memory leak when VFX Graph is open and Camera has "Target Texture" enabled
- The Canvas component's warning box is missing an apostrophe when Additional Shader Channels is set to "Normal" and "Tangent" with Render Mode set to "Screen Space - Overlay"
Resolution Note:
Your "WaterSurface" shadergraph is screen-space sampling your _ExcluderDepthNear and _ExcluderDepthFar for all shader passes (opaque, depth, shadow-caster, etc.), which is causing non-camera-aligned passes to discard pixels incorrectly.
In your case, the "ShadowCaster" pass is sampling these camera-aligned textures and discarding shadow-map pixels incorrectly in `_ShadowmapCascadeAtlas` (used to later compute volumetric lighting), leading to its corruption and rendering artifacts (position the camera inside the capsule, open the `FrameDebugger` and observe the contents of your shadowmap at the end of the `RenderShadowMaps` section).
You have two possible workarounds here:
- If you're ok with the clipped-area not affecting the shadows/god-rays, you can add a custom HLSL block to your shadergraph, where you disable this near/far test when `SHADERPASS == SHADERPASS_SHADOWS`.
- If you want to affect the shadows/god-rays, you need near/far textures per-view (each camera, shadow-casting light, etc.) and sample the correct one based on which view you're rendering. This will increase the effect complexity significantly, but it's the only way to represent that volume-cutout correctly for all passes.