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
- Out-of-bounds memory access with multiple CanvasRenderers under a Canvas when using Mesh API
- Inspector tries to access file after it was deleted when the file was locked in Inspector window
- Changing Transform values in Search window Inspector loses focus while dragging and stopping mouse without releasing dragging action
- Saving changes on the dirty VFX Graph during the Play mode throws "The referenced script (Unknown) on this Behaviour is missing!" warnings
- VFX Graph Debug Info overlaps the "Initialize" block debug info by default
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