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
- Undoing Animator Parameter name change breaks references to it
- Crash on BV4_OverlapBoxAll when moving in play mode
- Custom mesh water surface normal map fades out when Y Position increases
- Sprite renderer does not issue draw calls correctly when using SRP Batcher
- [Android] Flickering artifacts when using "ScriptableRenderer.EnqueuePass(RenderPassEvent.BeforeRenderingPostProcessing)" multiple times
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.