Skip to content

Commit 82f1284

Browse files
svc-reach-platform-supportEvergreen
authored andcommitted
[Port] [6000.0] [UUM-78803] Implement Main Light Direction node on builtin
https://jira.unity3d.com/browse/UUM-78803 This PR adds an implementation of the Main Light Direction node on builtin. I couldn't find any official indication it was unsupported, and `_WorldSpaceLightPos0` works fine.
1 parent f69bb8c commit 82f1284

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/ShaderLibrary/ShaderGraphFunctions.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ float3x3 BuildTangentToWorld(float4 tangentWS, float3 normalWS)
9292

9393
float3 shadergraph_MainLightDirection()
9494
{
95-
return 0.0f;
95+
return -_WorldSpaceLightPos0.xyz * (1.0 - _WorldSpaceLightPos0.w);
9696
}
9797

9898
float3 shadergraph_RendererBoundsWS_Min()

0 commit comments

Comments
 (0)