SPLighting: fix syntax errors with vertex lighting + color ramp
This commit is contained in:
parent
5cf6b0c9a6
commit
0c846eaf6a
@ -45,6 +45,9 @@ attribute vec3 inNormal;
|
|||||||
#else
|
#else
|
||||||
varying vec3 specularAccum;
|
varying vec3 specularAccum;
|
||||||
varying vec4 diffuseAccum;
|
varying vec4 diffuseAccum;
|
||||||
|
#ifdef COLORRAMP
|
||||||
|
uniform sampler2D m_ColorRamp;
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USE_REFLECTION
|
#ifdef USE_REFLECTION
|
||||||
@ -160,14 +163,14 @@ void main(){
|
|||||||
#if __VERSION__ >= 110
|
#if __VERSION__ >= 110
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
vec2 v = computeLighting(wvNormal, viewDir, lightDir.xyz, lightDir.w * spotFallOff, m_Shininess);
|
vec2 light = computeLighting(wvNormal, viewDir, lightDir.xyz, lightDir.w * spotFallOff, m_Shininess);
|
||||||
|
|
||||||
#ifdef COLORRAMP
|
#ifdef COLORRAMP
|
||||||
diffuseAccum += texture2D(m_ColorRamp, vec2(light.x, 0.0)).rgb * diffuseColor;
|
diffuseAccum.rgb += texture2D(m_ColorRamp, vec2(light.x, 0.0)).rgb * diffuseColor.rgb;
|
||||||
specularAccum += texture2D(m_ColorRamp, vec2(light.y, 0.0)).rgb * specularColor;
|
specularAccum.rgb += texture2D(m_ColorRamp, vec2(light.y, 0.0)).rgb * specularColor;
|
||||||
#else
|
#else
|
||||||
diffuseAccum += v.x * diffuseColor;
|
diffuseAccum.rgb += light.x * diffuseColor.rgb;
|
||||||
specularAccum += v.y * specularColor;
|
specularAccum.rgb += light.y * specularColor;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user