1234567891011121314151617181920212223242526272829303132 |
- void MainLight_half(float3 WorldPos, out half3 Dir, out half3 Color, out half DistanceAtten, out half ShadowAtten)
- {
- #if 1
- 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
- Dir = 0;
- }
- void SampleSH_half(half3 normalWS, out half3 Ambient)
- {
- // LPPV is not supported in Ligthweight Pipeline
- real4 SHCoefficients[7];
- SHCoefficients[0] = unity_SHAr;
- SHCoefficients[1] = unity_SHAg;
- SHCoefficients[2] = unity_SHAb;
- SHCoefficients[3] = unity_SHBr;
- SHCoefficients[4] = unity_SHBg;
- SHCoefficients[5] = unity_SHBb;
- SHCoefficients[6] = unity_SHC;
- Ambient = max(half3(0, 0, 0), SampleSH9(SHCoefficients, normalWS));
- }
|