LWJGL
June 20, 2013, 03:23:58 *
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: Screenshot with Transparency  (Read 564 times)
n4pgamer
Newbie
*
Posts: 9


« on: January 30, 2012, 10:31:39 »

Hello.

Does someone know if it is actually possible to take screen shots in OpenGL with transparency ? So where I didn't draw any pixels I want alpha being lower than 255.
Now GL11.glReadPixels(0, 0, w, h, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, buffer); puts pixel data with alpha to full 255 (-1 in java byte) into my buffer.

I have the following settings that might have to do something with this problem:
Code:
GL11.glAlphaFunc(GL11.GL_GREATER, 0.0f);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glClearColor(0, 0, 0, 0);

Also I draw 32-bit textures which are smoothed not pixelated.

Does someone know where to look or what to do ?

Cheers!

When I set GL11.glClearColor(0, 1, 0, 0); I get a green background. That means the alpha values in the buffer are set to 255 by default and it doesn't get "cleared" at all right ?
Is it possible to write alpha values to the buffer or create an off-screen-buffer and copy the pixels to the current draw-buffer ?
Logged
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!