421ee253e6
The main problem was using gl_FrontMaterial.ambient with a color mode of AMBIENT_AND_DIFFUSE i.e., the fixed function path would take both the ambient colors from the vertex color value. Also, some vertex shaders were not writing gl_FrontColor even though the fragment shader was accessing gl_Color. Author: Tim Moore <timoore@redhat.com>
17 lines
497 B
GLSL
17 lines
497 B
GLSL
varying vec4 rawpos;
|
|
varying vec4 ecPosition;
|
|
varying vec3 VNormal;
|
|
varying vec3 Normal;
|
|
|
|
void main(void)
|
|
{
|
|
rawpos = gl_Vertex;
|
|
ecPosition = gl_ModelViewMatrix * gl_Vertex;
|
|
VNormal = normalize(gl_NormalMatrix * gl_Normal);
|
|
Normal = normalize(gl_Normal);
|
|
|
|
gl_FrontColor = gl_FrontMaterial.emission
|
|
+ gl_Color * (gl_LightModel.ambient + gl_LightSource[0].ambient);
|
|
gl_Position = ftransform();
|
|
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
|
}
|