Merge pull request #1140 from Lopuska/patch-18

ambient normal on GLSL
This commit is contained in:
Luis Anton Rebollo 2015-02-07 20:43:08 +01:00
commit d26c846c31
4 changed files with 4 additions and 2 deletions

View file

@ -36,6 +36,7 @@ uniform vec4 inLightColor[4];
#endif
uniform vec4 ambient;
#define ambientCameraFactor 0.3
uniform float specularPower;
uniform vec4 specularColor;

View file

@ -202,7 +202,7 @@ void main()
float Sat_NL_Att = saturate( dotNL * shadowed ) * lightBrightness;
vec3 lightColorOut = lightMapParams.rgb * lightColor.rgb;
vec4 addToResult = lightAmbient;
vec4 addToResult = (lightAmbient * (1 - ambientCameraFactor)) + ( lightAmbient * ambientCameraFactor * saturate(dot(normalize(-vsEyeRay), normal)) );
// TODO: This needs to be removed when lightmapping is disabled
// as its extra work per-pixel on dynamic lit scenes.

View file

@ -36,6 +36,7 @@ uniform vec4 inLightColor[4];
#endif
uniform vec4 ambient;
#define ambientCameraFactor 0.3
uniform float specularPower;
uniform vec4 specularColor;

View file

@ -202,7 +202,7 @@ void main()
float Sat_NL_Att = saturate( dotNL * shadowed ) * lightBrightness;
vec3 lightColorOut = lightMapParams.rgb * lightColor.rgb;
vec4 addToResult = lightAmbient;
vec4 addToResult = (lightAmbient * (1 - ambientCameraFactor)) + ( lightAmbient * ambientCameraFactor * saturate(dot(normalize(-vsEyeRay), normal)) );
// TODO: This needs to be removed when lightmapping is disabled
// as its extra work per-pixel on dynamic lit scenes.