Changed ambient light in OpenGL 2.0 path to be modulated by material color to match other render paths.

ver1_5_1
Chris Laurel 2006-08-08 06:59:07 +00:00
parent f12fb1d0c9
commit 734f6490c1
1 changed files with 7 additions and 5 deletions

View File

@ -419,13 +419,13 @@ GLSL_RenderContext::setLightingParameters(CelestiaGLProgram& prog, Color materia
shaderProps.lightModel == ShaderProperties::RingIllumModel)
{
prog.fragLightColor[i] = Vec3f(lightColor.x * diffuseColor.x,
lightColor.y * diffuseColor.y,
lightColor.z * diffuseColor.z);
lightColor.y * diffuseColor.y,
lightColor.z * diffuseColor.z);
if (shaderProps.hasSpecular())
{
prog.fragLightSpecColor[i] = Vec3f(lightColor.x * specularColor.x,
lightColor.y * specularColor.y,
lightColor.z * specularColor.z);
lightColor.y * specularColor.y,
lightColor.z * specularColor.z);
}
}
else
@ -446,7 +446,9 @@ GLSL_RenderContext::setLightingParameters(CelestiaGLProgram& prog, Color materia
}
prog.eyePosition = lightingState.eyePos_obj;
prog.ambientColor = lightingState.ambientColor;
prog.ambientColor = Vec3f(lightingState.ambientColor.x * diffuseColor.x,
lightingState.ambientColor.y * diffuseColor.y,
lightingState.ambientColor.z * diffuseColor.z);
prog.opacity = materialDiffuse.alpha();
}