[PD] [Gem] Modifying single pixel of pix image

Claude Heiland-Allen claude at mathr.co.uk
Sun Apr 9 13:12:12 CEST 2017

Hi Roman,

> Le 09/04/2017 à 09:23, Roman Haefeli a écrit :
>> Thank you, Christof and Cyrille, for your insights. I think I
>> understood the concept. But do I need even framebuffer ping-ponging
>> when I only _add_ to the framebuffer? Let's say I add more and more
>> pixel-sized white squares to the buffer, I can use this as my mask, no?
>>>>>> Gesendet: Samstag, 08. April 2017 um 10:02 Uhr
>>>>>> Von: "Roman Haefeli" <reduzent at gmail.com>
>>>>>> An: pd-list <pd-list at iem.at>
>>>>>> Betreff: Re: [PD] [Gem] Modifying single pixel of pix image
>>>>>> On Sam, 2017-04-08 at 08:29 +0200, Christof Ressi wrote:
>>>>>>> If it can be on the GPU, use a fragment shader! Do you work
>>>>>>> with a
>>>>>>> formula or do you set the alpha values by hand?
>>>>>> By Hand (maybe later by a formula). Is it possible?
>>>>>> The idea is to have two overlaying images. The visible one
>>>>>> slowly
>>>>>> decomposes over time so that the image behind appears. I
>>>>>> thought about
>>>>>> setting alpha to for more and more pixels as a way to decompose
>>>>>> the
>>>>>> front image. Maybe there is another/better way?

For a "dissolve" effect I suggest creating a greyscale noise texture,
and thresholding with a uniform parameter in a fragment shader, before
using it as binary alpha to combine two image textures.  Then you can
manipulate the threshold to animate the effect.

Essentially this stores the entire history of the dissolve in a
grayscale image, where the grey level determines the time of the
transition for that pixel.  You might want higher bit depth, or floating
point, for the gray texture for a smoother effect.

Note that this does assume that the whole future/history is available in
advance, if it isn't then the framebuffer methods are more appropriate.


More information about the Pd-list mailing list