Initial commit

This commit is contained in:
gunnbr committed 2021-01-11 22:20:43 -08:00
1 parent ee9615239e
commit 16feac691f
4093 files changed
+1030491

No files matched your search

@@ -0,0 +1,31 @@
#ifndef GETLIGHTURP_INCLUDED
#define GETLIGHTURP_INCLUDED
void MainLightURP_half(float3 i_worldPos, out half3 i_lightDir, out half3 i_color )
{
#if defined (SHADERGRAPH_PREVIEW) || !defined(_PW_SF_SSS_ON)
i_lightDir = half3(0.5, 0.5, 0);
i_color = 1;
#else
#if SHADOWS_SCREEN
half4 clipPos = TransformWorldToHClip(i_worldPos);
half4 shadowCoord = ComputeScreenPos(clipPos);
#else
half4 shadowCoord = TransformWorldToShadowCoord(i_worldPos);
#endif
Light mainLight = GetMainLight(shadowCoord);
i_lightDir = mainLight.direction;
i_color = mainLight.color * mainLight.distanceAttenuation * mainLight.shadowAttenuation;
#endif
}
#else
void MainLightURP_half(float3 i_worldPos, out half3 i_lightDir, out half3 i_color )
{
i_lightDir = float3(1, 0, 0);
i_color = 0;
}
#endif