fade pixel to black…but in gl-land

Aug 17, 2011 at 5:01pm

fade pixel to black…but in gl-land

Hi all,
This is a continuation of a discussion found here:

http://cycling74.com/forums/topic.php?id=32539

A really useful patch! But now I need to draw with an alpha value, and so must leave the comforts of jit.lcd land and move into jit.gl.sketch land. Possible? Below is a patch showing the original “fade to black” patch and my attempt at converting to gl, and where I am stuck.

Thanks in advance for any pointers!
David

– Pasted Max Patch, click to expand. –
#58520
Aug 17, 2011 at 5:58pm

you just need to capture the sketch output to a named texture, and bang that texture into your slap chain. i also changed co.multiply to cc.scalebias as you just need to scale a single texture, not multiply two textures.

– Pasted Max Patch, click to expand. –
#210285
Aug 17, 2011 at 6:21pm

Brilliant! Thank you for the help!!

One small follow-up…the squares never fade completely to black (related to scalebias ?). Any pointers on making sure the square fades completely to black?

Thanks again!
David

#210286
Aug 18, 2011 at 12:39am

Yup…I’m baffled…spent the day trying to figure this out and can’t seem to solve it. I can never get it to fade to black. Any ideas?

Thanks,
David

#210287
Aug 18, 2011 at 12:50am

either set the param scale to less than .99 or maybe send the output to some kind of threshold or contrast shader?
not sure, i think it’s a gpu thing.

#210288
Aug 18, 2011 at 7:50pm

Hi Rob,
Thanks for the pointers. I’ve been tinkering around with other options and still haven’t found anything that works the way I’m hoping it to work (and still look pretty). I’ve tried on several different GPU’s and still have the same issue, too. So maybe there’s another approach.

Here’s a patch that’s closer to the how I am applying the “fade to black” idea. The patch randomly draws two paths. The paths have a life-expentency, meaning that the oldest portion of each path will eventually fade to nothing. Playing with the scale parameter for the scalebias shader certainly helped with the “residual” trails being left on screen (although still present), but at the expense of a really short life span for the trail. Instead of scalebias I’ve also tried the co.multiply.jxs shader, vade’s 2 channel mixer shaders, and a few other random shaders, all of which left this residual trail vs. black when it has finished fading out. So maybe another path to create my…paths…is in order?

As always, any pointers/suggestions/words of wisdom are greatly appreciated.

Cheers,
David

– Pasted Max Patch, click to expand. –
#210289
Aug 22, 2011 at 3:32pm

Any thoughts on different approaches to this before I admit defeat here?

Thanks again for any pointers!

David

#210290

You must be logged in to reply to this topic.