[unity] Fixed shader compilation error on PS4 platform related to static const in function. Closes #1600.

This commit is contained in:
Harald Csaszar 2020-01-14 19:26:45 +01:00
parent 3cf66670cc
commit 9acf99e763

View File

@ -167,16 +167,15 @@ inline VertexLightInfo getVertexLightAttenuatedInfo(int index, float3 viewPos)
return lightInfo; return lightInfo;
} }
//Magic constants used to tweak ambient to approximate pixel shader spherical harmonics
static const fixed3 worldUp = fixed3(0, 1, 0);
static const float skyGroundDotMul = 2.5;
static const float minEquatorMix = 0.5;
static const float equatorColorBlur = 0.33;
fixed3 calculateAmbientLight(half3 normalWorld) fixed3 calculateAmbientLight(half3 normalWorld)
{ {
#if defined(_SPHERICAL_HARMONICS) #if defined(_SPHERICAL_HARMONICS)
//Magic constants used to tweak ambient to approximate pixel shader spherical harmonics
static const fixed3 worldUp = fixed3(0,1,0);
static const float skyGroundDotMul = 2.5;
static const float minEquatorMix = 0.5;
static const float equatorColorBlur = 0.33;
float upDot = dot(normalWorld, worldUp); float upDot = dot(normalWorld, worldUp);
//Fade between a flat lerp from sky to ground and a 3 way lerp based on how bright the equator light is. //Fade between a flat lerp from sky to ground and a 3 way lerp based on how bright the equator light is.