View Full Version : Blending Woes...
05-04-2001, 10:43 PM
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 http://www.opengl.org/discussion_boards/ubb/smile.gif best method
05-05-2001, 12:21 AM
While zed's method certainly works, you might also want to guarentee that alpha blending is turned off by using glDisable(GL_BLEND).
05-05-2001, 01:29 AM
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...
05-05-2001, 11:44 AM
what parameters do you have in glBlendFunc() ?
05-05-2001, 06:21 PM
05-05-2001, 06:23 PM
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 http://www.opengl.org/discussion_boards/ubb/biggrin.gif if u wanna see a sphere bouncing up + down reflected in the floor check out the pong/breakout program on my site (url)
05-08-2001, 11:40 PM
Ha! I knew if was something REALLY obvious and stupid, thanks for the help!
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.