Files
Temp.BattleRoyale.Map.Unity/Assets/LUMINATE/Shaders/HLSL/GapperGamesCustomLighting.hlsl
CortexCore a379dc5cd3 1
2024-05-13 01:28:33 +08:00

21 lines
552 B
HLSL

#ifndef MainLight
#define MainLight
void MainLight_half(float3 WorldPos, out half3 Dir, out half3 Color, out half DistanceAtten, out half ShadowAtten)
{
#ifdef SHADERGRAPH_PREVIEW
Dir = half3(0.5, 0.5, 0);
Color = 1;
DistanceAtten = 1;
ShadowAtten = 1;
#else
half4 shadowCoord = TransformWorldToShadowCoord(WorldPos);
Light mainLight = GetMainLight(shadowCoord);
Dir = mainLight.direction;
Color = mainLight.color;
DistanceAtten = mainLight.distanceAttenuation;
ShadowAtten = mainLight.shadowAttenuation;
#endif
}
#endif