Advertisement

OpenGL Pixel fading

Started by February 06, 2000 08:40 AM
4 comments, last by Burning_Ice 25 years, 1 month ago
Hi I''ve seen some OpenGL Winamp plugins with stunning 2D-Graphics, and many of them don''t clear the screen after painting pixels/lines but they slowly fade out, in some plugins they even move in circles to the center of the screen or similar while fading out... I wonder if there are any open source winamp plugins that use this effect or if anyone can explain me how to achieve this Any help would be appreciated!
This is easy. Just don''t set the glClearColor to have full alpha.
Advertisement
This doesn''t work...
no matter what alpha my glClearColor has, it always clears everything
Do i have to set any Blending or Alphatest function?
Anyone?
Well, I have an idea, but I''m not sure if it''s optimised or anything...

After you swap buffers, do not glClear it. Instead, add a black polygon that covers your entire view with a non-full alpha and then redraw your scene. It would give the effect, but I''m not sure if it''s wise to do that in terms of performance.
Hm. Can''t figure it out right now, but if you simply want to disable colorwriting and enable alpha-clearing only, you can achieve this via the glColorMask function, I think.

NextS
P.S. I think someones idea shoudl work. If you start rotating the view, you have to redraw the entire scene anyway. So this should not be preformance critical. If you do not do anything to the scene, you should only render the black polygon with the alpha set, without rerendering the scene. In my opinion, alpha fading happens at non-performance critical time so this should not be an issue.

This topic is closed to new replies.

Advertisement