[Resolved] alpha channel screenshot !

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

you have to switch on blending like

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.

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?

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