Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  [Resolved] alpha channel screenshot !  (Read 779 times)
0 Members and 2 Guests are viewing this topic.
Offline mathlamenace

JGO n00b
*

Posts: 14



« on: 2006-09-12 07:06:19 »

Hello,

I have a model (with some tranparent parts) render on a background cleared with (0f,0f,0f,0f). But when I make a screenshot (with alpha fixed on true), I have no alpha chanel in my picture, only a black background. I have tried both TGA and png format. Hoiw can I obtain the alpha chanel on my screenshot. Is there any otion to check in opengl context ?

Mathlamenace
Offline kappa
« League of Dukes »

JGO Kernel
*****

Posts: 2360
Medals: 59


★★★★★


« Reply #1 on: 2006-09-12 09:09:23 »

you have to switch on blending like

1  
2  
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
glEnable(GL_BLEND);


sorry about code not being in jogl, but should be pretty easy to find the same calls.
Offline Ken Russell

JGO Kernel
*****

Posts: 3446
Medals: 3


Java games rock!


« Reply #2 on: 2006-09-12 12:05:34 »

You're using the com.sun.opengl.util.Screenshot class?

Have you specified e.g. 8 bits of alpha in your GLCapabilities when creating your GLCanvas?

The JGears demo uses the alpha channel in the same way a screenshot with a transparent background would. I think either a TGA or a PNG screenshot should capture the alpha channel correctly. How do you know it isn't there? Have you opened the resulting screenshot with e.g. the GIMP and checked whether you can see the background through the image?
Games published by our own members! Go get 'em!
Offline mathlamenace

JGO n00b
*

Posts: 14



« Reply #3 on: 2006-09-12 17:28:37 »

I use com.sun.opengl.util.Screenshot class and I have forgot to specify 8 bits of alpha in my GLCapabilities. Adding this solves the problem

Thank you very much !

Mathlamenace
Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.095 seconds with 20 queries.