PDA

View Full Version : gl_BackColor bug



speedy
04-29-2006, 03:22 PM
void main()
{
gl_FrontColor = vec4(0.0,0.0,1.0,1.0);
gl_BackColor = vec4(0.5,0.5,0.5,1.0);
gl_Position = ftransform();
}
void main()
{
gl_FragColor = vec4(gl_Color);
} gl_BackColor gets ignored in the fragment shader.

repro:

0) start render monkey or shader designer and paste this code in
1) disable backface culling
2) set plane as a test model
3) rotate the plane - plane back and front face have the same blue color when they should have blue at front and grey at back.

Can any of you guys please double-check and confirm the bug?

Humus
04-29-2006, 04:15 PM
You have to enable GL_VERTEX_PROGRAM_TWO_SIDE_ARB.

yooyo
04-29-2006, 04:21 PM
@humus...
You are faster :)

@speedy:
Pozdrav!!!

speedy
05-02-2006, 04:37 PM
Thanks, it worked out well!

@yooyo:
Hvala! :D