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 & HelpPrograms › blend function
Page Index Toggle Pages: 1
blend function (Read 1617 times)
blend function
Apr 25th, 2005, 8:20pm
I am writing a fire algorithm that requires computing an average of the surrounding colors at each pixel. i have optimized this as much as i can, but several things i used to do in ASM aren't possible in Java. which is probably good!

but doesn't anyone know if there is a good function, perhaps the blend function (which i only sort-of understand) or an OpenGL function, that can blend 4 or more pixels at once? i guess i'm kind of looking for a high-performance convolution.

i'm getting 4 fps or so on a 50x50 screen, so it's pretty slow.

Re: blend function
Reply #1 - Apr 25th, 2005, 10:00pm
you should do the image editing inside a PImage object, where you can play with pixels all you want, and then just draw that using image(). otherwise you're dealing with a lot of gl overhead to get and set the pixels.

more info in the PImage reference:

basically just create the image, then after you mess with it, call updatePixels() on it before drawing to the screen.
Page Index Toggle Pages: 1