From c8f96e47a4914286bd35431b7bdb392c5967c2d0 Mon Sep 17 00:00:00 2001 From: "sha..rd" Date: Sat, 24 Sep 2011 18:00:14 +0000 Subject: [PATCH] * Fixed Lighting.frag compile error when using vertex lighting git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8291 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/core-data/Common/MatDefs/Light/Lighting.frag | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/engine/src/core-data/Common/MatDefs/Light/Lighting.frag b/engine/src/core-data/Common/MatDefs/Light/Lighting.frag index 0437858fa..ac2e2b87f 100644 --- a/engine/src/core-data/Common/MatDefs/Light/Lighting.frag +++ b/engine/src/core-data/Common/MatDefs/Light/Lighting.frag @@ -237,14 +237,15 @@ void main(){ #endif #ifdef VERTEX_LIGHTING + vec2 light = vertexLightValues.xy; #ifdef COLORRAMP - light.x = texture2D(m_ColorRamp, vec2(vertexLightValues.x, 0.0)).r; - light.y = texture2D(m_ColorRamp, vec2(vertexLightValues.y, 0.0)).r; + light.x = texture2D(m_ColorRamp, vec2(light.x, 0.0)).r; + light.y = texture2D(m_ColorRamp, vec2(light.y, 0.0)).r; #endif gl_FragColor.rgb = AmbientSum * diffuseColor.rgb + - DiffuseSum.rgb * diffuseColor.rgb * vec3(vertexLightValues.x) + - SpecularSum * specularColor.rgb * vec3(vertexLightValues.y); + DiffuseSum.rgb * diffuseColor.rgb * vec3(light.x) + + SpecularSum * specularColor.rgb * vec3(light.y); #else vec4 lightDir = vLightDir; lightDir.xyz = normalize(lightDir.xyz);