Unity Issue Tracker - Shadows are not present when using unity_SpriteColor and Alpha Clipping in Shader Graph
Closed
UUM-103513
Shadows are not present when using unity_SpriteColor and Alpha Clipping in Shader Graph
Unity: ShaderGraph
As Designed
6.2.X
6.1.X
6.0.X
User's custom function node needs to consider the shadow caster pass when using alpha.
such as:
#if defined(SHADERPASS_SHADOWCASTER)
SpriteColor.w = 1;
#endif
Reproduction steps:
1. Open the attached project "ReproProj"
2. Open the “/Assets/Scenes/SampleScene.unity” Scene
3. Observe that shadows are present in the Game view
4. Open the “/Assets/Sprite-Lit-Transparent.shadergraph“ by double-clicking in the Project window
5. In Graph Inspector, enable Alpha Clipping
6. Press CTRL + S to save
7. Observe the Game view
Expected result: Shadows exist and are not flickering
Actual result: Shadows are not present or appear to be flickering
Reproducible with: 6000.0.47f1, 6000.1.0b15, 6000.2.0a9
Could not test with: 2022.3.61f1 (Shader error in 'Shader Graphs/Master': undeclared identifier 'unity_SpriteColor' at /(336) (on d3d11))
Testing environment: Windows 10 Enterprise 21H2
Not reproducible on: No other environment tested
Note:
Reproducible when unity_SpriteColor * VertexColor is used with Alpha Clipping
Prioritise and Follow this issue
Have a workaround or additional info about this issue?