Hello!
I´m using the shaders as shown below. Unfortunately, the secondary color doesn´t work as supposed. After some tests I found out that already the vertex shader does not what it should.
The vertex-shader line “gl_FrontSecondaryColor=gl_SecondaryColor;” seems to copy the wrong color, instead of the secondary, the primary color gets stored in gl_FrontSecondaryColor.
I´m using Catalyst 4.6 on a R9800pro. The bug(?) is already present on Catalyst 4.5.
I´d be happy if anyone could confirm this bug or (the better case show me what I´m doing wrong.
thx alot
PS: I AM using glSecondaryColor3fv() to upload the right color.
/*vertex shader */
varying vec3 normal;
varying vec3 viewvec;
void main()
{
gl_Position=ftransform();
gl_FrontColor=gl_Color;
gl_FrontSecondaryColor=gl_SecondaryColor;
gl_TexCoord[0]=gl_MultiTexCoord0;
viewvec=gl_Vertex.xyz-gl_ObjectPlaneS[0].xyz;
normal=gl_Normal;
}
/* fragment shader */
uniform samplerCube environmentmap;
uniform samplerCube radiancemap;
uniform sampler2D diffusetexture;
uniform sampler2D speculartexture;
varying vec3 normal;
varying vec3 viewvec;
void main()
{
vec3 temp=normalize(normal);
vec3 dir=reflect(viewvec, temp);
gl_FragColor=textureCube(environmentmap, dir)*gl_SecondaryColor*texture2D(speculartexture, gl_TexCoord[0].xy);
gl_FragColor+=textureCube(radiancemap, normal)*gl_Color*texture2D(diffusetexture, gl_TexCoord[0].xy);
}