Search Issue Tracker
Fixed in 13.1.1
Fixed in 12.1.1
Votes
0
Found in [Package]
12.0.0
Issue ID
1349095
Regression
No
[ShaderGraph] Shadow bias is broken in generated HLSL when modifying the normal in Vertex shader
If you modify a normal in the vertex shader but don't use it in the fragment shader, shadows are broken if you have any normal bias (which is the default). This is due to the shader generator not writing the modified normal world space position back to the vertex structure, which causes it to use the original, unmodified normal for shadow calculations. This breaks almost all non-trivial vertex animation.
How to reproduce:
1. Open the attached project's Scene labeled "SampleScene"
2. Enter the Play Mode
3. In Game View, inspect the "Cube" GameObject's shadow as it spins
Expected result: The shadow looks the same as when rotating the GameObject without using Shaders
Actual result: There are seams in the GameObject's shadow as it rotates
Reproducible with: 10.6.0 (2020.3.16f1), 11.0.0 (2021.1.17f1), 12.0.0 (2021.2.0b5, 2022.1.0a4)
Couldn't test with: 7.7.1 (2019.4.29f1) (Vertex shader in ShaderGraph not available)
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
- “Remove Unused Overrides” available on not loaded Scene and throws “ArgumentException: The scene is not loaded” warning
- Adaptive Probe Volume occlusion edge is calculated incorrectly when viewing probes near geometry edges
- Sampling a texture using an HLSL file throws shader errors and the code does not compile
- "Graphics.CopyTexture called with null source texture" error when Base Camera of an Overlay Camera is removed with DX11 Graphics API and Compatibility Mode enabled
- WebGL sends wrong value with large numbers when SendMessage function is used
Resolution Note (fix version 13.1.1):
Fixed in 2022.1.0a16
The shadow caster now requires the newest changes to Normals.
Resolution Note (fix version 12.1.1):
Fixed in 2021.2.2f1
Resolution Note:
Fixed in Shader Graph 10.8.1