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 › Masking layer over background image
Page Index Toggle Pages: 1
Masking layer over background image (Read 1632 times)
Masking layer over background image
Sep 12th, 2009, 6:36pm
 
Hi,

I'm using OpenGL and processing to play a series of images.

I'd like add a layer over these images, that is a mostly black canvas with elliptical areas of transparency at various X,Y coords.

I've managed to draw transparent ellipses over the images: but I can't work out how to generate a mostly-black canvas with transparent patches to render.

Can anyone help me?

Cheers,
Will.
Re: Masking layer over background image
Reply #1 - Sep 12th, 2009, 7:16pm
 
Note: I've got this working using a P3D offscreen graphics buffer which I use to mask a black PImage and then render: but this is awfully slow and OpenGL won't let me use offscreen buffers.
Re: Masking layer over background image
Reply #2 - Sep 12th, 2009, 9:44pm
 
I don't know if this will be fast enough for your purposes either, but in this thread:
http://processing.org/discourse/yabb2/num_1251260591.html
Cedric mentions "breakShape" which would seem to fit your purpose.  But as we discovered, it doesn't work in GL mode, so you'd have to create a secondary PGraphics object with P2D rendering mode in order to generate the mask image.  -- Ben
Re: Masking layer over background image
Reply #3 - Sep 13th, 2009, 1:43pm
 
if that doesnt work, i would just create an transparent PNG and overlay it. There you can also add a smooth blurry transparency transition. That should do the job
Page Index Toggle Pages: 1