LWJGL
May 24, 2013, 07:24:31 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL is now using GitHub
 
   Home   Help Search Login Register  



Pages: [1]
  Print  
Author Topic: Fading effect  (Read 2166 times)
the2bears
Talks Too Much
***
Posts: 117



WWW
« on: August 07, 2005, 22:59:58 »

Here's a question I can't find the answer to:

Can I get alpha blending with glClearColor(...)?

Code:
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glClearColor(0f, 0f, 0f, 0.5f);
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT );


This doesn't seem to do anything other than clear the screen to black.  What I'd like to do is set up a fade effect, where rendered pixels slowly fade out due to the background clear.

Perhaps another way?  A full-screen texture instead?  

Bill
Logged

the2bears - the indie shmup blog
tomb
Talks Too Much
***
Posts: 148


« Reply #1 on: August 08, 2005, 03:22:45 »

Blending don't work with glClearColor. All it does is fill the color buffer with the specified values. You'll need to draw fullscreen quad with your alpha/color. No need to use a texture.
Logged
the2bears
Talks Too Much
***
Posts: 117



WWW
« Reply #2 on: August 08, 2005, 07:58:10 »

Ah... that makes sense of course.  Thanks!

Bill
Logged

the2bears - the indie shmup blog
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!