We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOpenGL and 3D Libraries › Rendering images with transparency in OpenGL
Page Index Toggle Pages: 1
Rendering images with transparency in OpenGL (Read 1152 times)
Rendering images with transparency in OpenGL
Sep 20th, 2009, 6:06pm
 
Hi,

I'm using an OpenGL canvas to do my rendering on. With the correct OpenGL blending mode set, I can generate images using ellipse and fill(255, x), and have my alpha/transparency respected.

I can additionally generate a PImage with alpha transparency: which is correctly formed when I save it to the filesystem and inspect it manually.

However, when I attempt to render this image using image(), the alpha transparency is ignored and the image is rendered as if it was (255) for every pixel.

How can I get images rendering with Alpha transparency in OpenGL?
Re: Rendering images with transparency in OpenGL
Reply #1 - Sep 20th, 2009, 6:26pm
 
It sounds like you might need a PGraphics object rather than PImage.  Once you create a PGraphics object you can draw directly into it, like an invisible Processing window, and all your alpha information will be preserved.

But if you're trying to use loadImage() and image() to load and render a file that you saved previously, then that should be working ...

--Ben
Page Index Toggle Pages: 1