Search Issue Tracker
By Design
Votes
0
Found in [Package]
10.0.0-preview.1
Issue ID
1256703
Regression
No
[URP] variables SHAr, SHAg, SHAb are receiving wrong values if there is no shadow pass in the shader
How to reproduce:
1. Download the attached project named "Case_1256703"
2. Open the NewScene and observe 3 Cyan primitives
3. Open Frame Debugger select the Draw mesh and check the SHAr, SHAg and SHAb values
4. Open AmbientAsColor.shader, and make sure that shader pass line (UsePass "Test/AmbientAsColorWithShadowCaster/SHADOWCASTER") is commented.
5. In the Project View find a material named AmbientAsColorWithShadowCaster.mat and select it
6. Observe the Scene view
Expected result: All 3 primitives are cyan and return the same SHA values in the Frame Debugger as before
Actual result: 2 primitives are grey and return different SHA values in the Frame Debugger
Reproducible with: 2019.4.1f1(7.1.8, 7.4.1), 2020.1.0b13(8.1.0, 9.0.0-preview.14), 2020.2.0a15(10.0.0-preview.0)
Could not test with: 2018.4.24f1(URP not available)
Notes:
1. Graphics APIs tested: D3D11, D3D12, Vulkan
2. The issue does not occur if line (UsePass "Test/AmbientAsColorWithShadowCaster/SHADOWCASTER") is not commented
3. The issue can be resolved by reimporting the affected materials(Track_1256703_V2). However, selecting the material afterwards will break it again.
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
- Any small change in UI Builder Inspector refreshes Editor Inspector
- Inaccurate Box Collider boundaries on a rotated child Cube when the parent GameObject Scale is non-uniform
- [Android] "SHADOWS_SCREEN" set as shader Keyword when no "_ShadowMapTexture" is bound leads to freeze on a build on some Mali GPU devices
- The global scene list is overridden in a project built with command line when the Override Global Scene List setting is disabled in the build profile
- Global Scenes are not included in the Build when building multiple Build Profiles at the same time
Resolution Note:
The issue is that 'DrawMesh' does not setup any built in constant buffers when drawing, so the draw operations are picking up whatever is left over in those buffers. In this case, when it doesn't work, the rendered Game Object is using the SRP Batcher which does not fill/update that information resulting in zero SHA values. In the working case the shader is no longer SRPBatcher compatible, so takes a different path which fills out that data, and the 'DrawMesh' commands just happen to make use of it.