* Fixed Lighting.frag compile error when using vertex lighting

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8291 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
sha..rd 14 years ago
parent 0cf890d1ba
commit c8f96e47a4
  1. 9
      engine/src/core-data/Common/MatDefs/Light/Lighting.frag

@ -237,14 +237,15 @@ void main(){
#endif #endif
#ifdef VERTEX_LIGHTING #ifdef VERTEX_LIGHTING
vec2 light = vertexLightValues.xy;
#ifdef COLORRAMP #ifdef COLORRAMP
light.x = texture2D(m_ColorRamp, vec2(vertexLightValues.x, 0.0)).r; light.x = texture2D(m_ColorRamp, vec2(light.x, 0.0)).r;
light.y = texture2D(m_ColorRamp, vec2(vertexLightValues.y, 0.0)).r; light.y = texture2D(m_ColorRamp, vec2(light.y, 0.0)).r;
#endif #endif
gl_FragColor.rgb = AmbientSum * diffuseColor.rgb + gl_FragColor.rgb = AmbientSum * diffuseColor.rgb +
DiffuseSum.rgb * diffuseColor.rgb * vec3(vertexLightValues.x) + DiffuseSum.rgb * diffuseColor.rgb * vec3(light.x) +
SpecularSum * specularColor.rgb * vec3(vertexLightValues.y); SpecularSum * specularColor.rgb * vec3(light.y);
#else #else
vec4 lightDir = vLightDir; vec4 lightDir = vLightDir;
lightDir.xyz = normalize(lightDir.xyz); lightDir.xyz = normalize(lightDir.xyz);

Loading…
Cancel
Save