Search Issue Tracker
By Design
By Design in 6000.1.X
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
- Icon section shows incomplete message and unusable check box in Build Profiles and Player Settings window instead of “Not applicable for this platform” for Dedicated Server Platform
- "Editor unavailable" message is displayed when navigating to "Get set up" tab in Unity Hub
- Assets are created in the Package folders when creating assets via custom buttons in the Inspector window or other windows
- “Select” windows are named differently on Windows and macOS
- [Windows] No minimum “Select” window size
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.
Resolution Note (6000.1.X):
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.