Search Issue Tracker
Fixed
Fixed in 6000.0.48f1, 6000.1.0b15, 6000.2.0a9
Votes
9
Found in
2021.3.43f1
2022.3.44f1
6000.0.17f1
6000.1.0a7
6000.2.0a1
Issue ID
UUM-78812
Regression
No
Terrain Layers rendered in additional Texture passes render without "Main Light" and "Additional Lights" Lighting Features when using URP Deferred Rendering Path
Reproduction steps:
1. Open the attached “IN-77428_Deferred Lighting Bug.zip“ project (the link is in the internal comments)
2. Open the “SampleScene“
3. Observe the Game view
Expected result: “Spot Light” reflection looks like a full circle on the “Terrain” and Terrain Layers to the left and right of the Game view appear similar in brightness
Actual result: “Spot Light” reflection appears only on the left Terrain Layer (“Mud 2”) and the right Terrain Layer (“Forest 2”) is very dark (including the area where the two Terrain Layers are blended)
Reproducible with: 2021.3.43f1, 2022.3.44f1, 6000.0.17f1
Reproduced on: Windows 11 Pro (23H2)
Not reproduced on: No other environment tested
Notes:
- Could not reproduce in a new project (“Screen Space Ambient Occlusion” Renderer Feature seems to darken Terrain Layers 5 and above but not as much as in the user’s project and, in the user’s project, the “Screen Space Ambient Occlusion” Renderer Feature is not necessary to reproduce the issue)
- Reproducible in the Player
- Forward and Forward+ Rendering Paths produce expected results
- The “Global Illumination” Lighting feature is rendered even when using the Deferred Rendering Path (tested using Rendering Debugger window > Lighting > Lighting Debug Modes > Lighting Features)
Comments (3)
-
Ctlc
Dec 02, 2024 19:21
Finally pt.2:
In the TerrainLitAddFixed.shader, comment out the line:
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl"And:
#pragma multi_compile_fragment _ _RENDER_PASS_ENABLED -
Ctlc
Dec 02, 2024 15:49
For a workaround, you can create local copies of the TerrainLit and TerrainLitAdd -shaders from the packages, and in to your project.
Let's call the copies for example TerrainLitFixed.shader and TerrainLitAddFixed.shaderNext:
-Edit your new local TerrainLitAddFixed -shader, and give it some unique name within the shader code:
'Shader "Hidden/Universal Render Pipeline/Terrain/Lit (Add Pass Fixed)" ' for example.Then:
-Modify TerrainLitFixed -shader. Give it a unique shader name, for example:
'Shader "Universal Render Pipeline/Terrain/Lit (Fixed)"'.-Find the reference to "Lit (Add Pass)" at the bottom of the file, as a "Dependancy". Modify it to point to your new local terrain lit shader, so for example:
'Dependency "AddPassShader" = "Hidden/Universal Render Pipeline/Terrain/Lit (Add Pass Fixed)"'.Finally:
-Change the shader for your terrain material to use the Terrain/Lit (Fixed) -shader. -
Ctlc
Nov 25, 2024 16:22
Reproduces 100% of the time, with or without SSAO with the following steps:
1) Create new project on 6000.0.23f1 LTS, Windows 11 Home, 10.0.22631: 22631
SRP Universal 3D Core
2) Change "Rendering > Rendering Path" to "Deferred"
3) In the default (SampleScene) scene, create > 3D Object > Terrain4) With the terrain object selected, go to mode "Paint Terrain > Paint Texture"
5) "Edit Terrain Layers > Create Layer", select the "Default-Checker-Grey" as texture
6) Select the now created "NewLayer", and under the "Diffuse" -material properties, select "Color Tint" assign a unique color. This coloring is just to make it easier to visualize the bug
7) Repeat steps 5. and 6. for three additional times, so that there are in total 4 layers available for painting
8) Paint wide strips of the terrain with each unique texture layer, so that all four Terrain layers are in use
9) Create > 3D Object > Cylinder, give it a large scale size, as in X: 10, Y: 50, Z: 10, and position the cylinder to be on top of the terrain object. Make sure that the cylinder renders a shadow on to the terrain
10) Add a new "Terrain Layer" in the way that step 6. -describes, so that there are in total five paint layers
11) Paint a large area around the cylinder with the new "Terrain Layer"
12) Observe that the cylinder's shadow does not seem to draw on top of the new, fifth "Terrain Layer", and instead the fifth - and any additional "Terrain Layer" over four - seems to always be 'in shadow'. The first four "Terrain Layers" always work correctly
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
- Channel remapping dropdown in the Terrain Layer does not open when clicked on the title
- The Editor freezes indefinitely when a large number of elements are entered in the Subgraphs or Categories lists
- Some Visual Effects package Assets links to documentation are not working
- Heatmap asset’s documentation button in the Inspector window leads to “Sorry... that page seems to be missing!” page when clicked
- Crash on MonoBehaviour::CallMethodIfAvailable when performing various actions
Resolution Note (fix version 6000.2.0a9):
Changes the behavior of the terrain add pass when running in URP deferred. No longer places incorrect data in gbuffers that are meant to hold depth information or bitmasks.
Resolution Note (fix version 6000.1.0b15):
Changes the behavior of the terrain add pass when running in URP deferred. No longer places incorrect data in gbuffers that are meant to hold depth information or bitmasks.