123456789101112131415161718192021222324252627282930313233343536373839404142 |
- void MainLight_half(float3 WorldPos, out half3 Direction, out half3 Color, out half DistanceAtten, out half ShadowAtten,out half3 SkyColor)
- {
- #if SHADERGRAPH_PREVIEW
- Direction = half3(0.5, 0.5, 0);
- SkyColor=0;
- Color = 1;
- DistanceAtten = 1;
- ShadowAtten = 1;
- #else
- #if SHADOWS_SCREEN
- half4 clipPos = TransformWorldToHClip(WorldPos);
- half4 shadowCoord = ComputeScreenPos(clipPos);
- #else
- half4 shadowCoord = TransformWorldToShadowCoord(WorldPos);
- #endif
- Light mainLight = GetMainLight(shadowCoord);
- Direction = mainLight.direction;
- Color = mainLight.color;
- SkyColor=SHADERGRAPH_AMBIENT_SKY;
- DistanceAtten = mainLight.distanceAttenuation;
- ShadowAtten = mainLight.shadowAttenuation;
- #endif
- }
|