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

Package: Scriptable Render Pipeline Universal

-

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)

  1. 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

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.