This is very funny in my opinion. I just made a program with a textured quad as a floor, and a sphere bouncing up and down on the floor. The sphere has a reflection which is done by just drawing another sphere under the floor and blending it with the floor using alpha blending. The program works perfectly. Except now i cant figure out how i set the alpha values. I change all the alpha values everywhere to 1 and I can still see the reflection. in glClearColor and glColor4f i changed the last value to 1.0 everywhere in the program, but the reflection remains. Help! I am confused.
well you dont need to change all the colours in the program as opengl is a state machine the current state is the one thats used.
ie u just need to change the previous colour to the sphere being drawn.
to not see the sphere reflection.
A/ dont draw it best method
While zed’s method certainly works, you might also want to guarentee that alpha blending is turned off by using glDisable(GL_BLEND).
I know how to disable blending, but since i cannot change the alpha values i cant determine how reflective the surface is! Say i wanted the surface to be REALLY reflective id set the alpha value to 0.1, but this doesnt work…
what parameters do you have in glBlendFunc() ?
Well, that explains it then. The destination color (the floor) isn’t effected by the alpha. Try glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
BTW if u wanna see a sphere bouncing up + down reflected in the floor check out the pong/breakout program on my site (url)
Ha! I knew if was something REALLY obvious and stupid, thanks for the help!