glClearColor & glClear dont seem to give proper results!!!
When i clear the backbuffer using glClear and GL_BLEND enabled , does OpenGL actually perform blending? I thought it should , because glClearColor takes the alpha component as fourth parameter . bUt that does not seem to happen ... the whole screen is painted with the new color and nothing that was previously drawn is seen through the new layer of color !!
Does anyone have some idea on how to get glClear working ???
Quote:Original post by shekharpk19
When i clear the backbuffer using glClear and GL_BLEND enabled , does OpenGL actually perform blending?
No. It just inconditionally writes the clear color to the buffer.
Quote: I thought it should , because glClearColor takes the alpha component as fourth parameter.
It'll set the alpha value in the color buffer. Some blending modes do use the target alpha value.
Quote:Does anyone have some idea on how to get glClear working ???
For what you want to do, it's not glClear() that you need, but to render a colored quad over the whole scene.
thats how it works, it just replaces all the pixels in the buffer with the values you set up.
If you want to blend you'd have to draw a screen aligned quad over the old image with blending active.
If you want to blend you'd have to draw a screen aligned quad over the old image with blending active.
That's how glClear Works. It's an instant wash of the buffer. It takes an alpha component because gl supports rgba rendering. Meaning aswell as rendering colour to the drawbuffer it also has an alpha component for each pixel - usefull for rgba texture generation etc. glClear just washes the entire surface.
For extra functionality like that wash the screen yourself - switch to an ortho mode & wash a quad over the screen ;]
extra :: lols everyone makes the same reply
extra :: extra :: wow & only 1 second difference between fruny & teh phantom
For extra functionality like that wash the screen yourself - switch to an ortho mode & wash a quad over the screen ;]
extra :: lols everyone makes the same reply
extra :: extra :: wow & only 1 second difference between fruny & teh phantom
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement