Search Issue Tracker
Duplicate
Votes
0
Found in [Package]
6.9.1, 7.1.1
Issue ID
1186296
Regression
No
Reading shadow attenuation from Shadows.hlsl does not work in a Custom Sub Graph function
How to reproduce:
1. Download the tester-attached package(Shadow Attenuation.unitypackage)
2. Create a new Universal Render Pipeline project
3. Import the package and set the included Render Pipeline Asset
4. Open the "Shadow Issues/2. Shadow Attenuation/Shadow Attenuation" Scene
5. Enable and observe the GetMainLight, GetMainLight(ShadowCoord) and MainLightRealtimeShadow GameObjects
Expected result: the GameObjects project shadows
Actual result: the GameObjects do not project shadows
Reproducible with: 2019.2.7f2, 2019.3.0b4, 2020.1.0a5
Could not test with: 2017.4.32f1(ShaderGraph unavailable), 2018.4.10f1(Shader incompatibility issues)
Reproducible with package versions: 6.9.1, 7.1.1
Could not test with package versions: 6.9.0(Shader Incompatibility issues)
-
Resolution Note:
Using the built-in functions for lighting in Universal requires certain defines to be enabled and properties to be generated that Shader Graph does not currently support.
The suggested workaround is to copy the specific lines needed into your custom function. See MainLightRealtimeShadow function inside of "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl"
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
- Usage of Adaptive Probe Volumes throws a lot of IndexOutOfRangeException and Assertion Failed errors
- Prefab overrides don't recover missing managed references
- Trail Renderer visual doesn't match the positions of vertices when they have been offset
- [Mobile] The Material is not visible when using the Decal Renderer Feature
- Uncaught TypeError: Cannot read properties of undefined is thrown when the tab is inactive for several minutes
This is a duplicate of issue #1175274