Applying a texture with alpha content to

Apr 9, 2012 at 9:28pm

Applying a texture with alpha content to

Hi guys,

So in a broad sense I’m trying to apply a texture with alpha properties to a object so it creates a nice brush effect.
If you take a look at the patch below, Nesa created a texture by using, and some clever alpha stuff.

I understand how this works with [plane], as the erase_color is set to 0 (nothing gets erased), and the series of planes with brush images create a nice brush effect.

However, I tried to then send this texture to a, to see if I could get the brush effect on the stroke, I tried this by setting the [@capture] to capture the brush texture from the patch below, however it only seems to receive the color of the texture, but not the alpha content/effect.

Now my conclusion is that just simply doesn’t allow alpha values for a captured texture, however I’m hoping you guys can prove me wrong!



– Pasted Max Patch, click to expand. –
Apr 9, 2012 at 9:32pm

i don’t see where you are using in the patch you pasted?

Apr 9, 2012 at 9:39pm

That isn’t my patch Robert, that’s one Nesa posted showing how to and alpha’d images to create the effect.
I was wondering if there’s a way of applying this texture (alpha’d images), to a object (what I’m currently using in my project).


Apr 10, 2012 at 4:18pm

it should work fine with a gl.sketch. you might have to blend_enable explicitly in the command list, i’m not really sure.
post you’re attempt to get it working and we can offer some help.

Apr 10, 2012 at 5:37pm

I can’t find the old patch I did before, but basically here’s a quick patch of what I’m trying to do.


– Pasted Max Patch, click to expand. –
Apr 11, 2012 at 10:04am

do you want to capture the output of your gl.sketch to texture, and use that texture as the brush image?

or do you want to draw the brush texture using gl.sketch (which requires binding the texture in your sketch command-list before drawing any geometry) ?

it’s not clear from your example patch or your description which result you are going for.

Apr 11, 2012 at 12:24pm

I want to draw the brush texture using gl.sketch.


Apr 11, 2012 at 9:51pm

if you want to texture your strokes, then you don’t want to set the @capture attribute of gl.sketch to your stroke texture, but instead bind that stroke-texture in the cmd-list.
you also need to set the texture strokeparam.
lastly, the texture needs to be non-rectangular to work with strokes

some more info in this post:

i’ve modified your patch to include stroke texturing:

– Pasted Max Patch, click to expand. –
Apr 11, 2012 at 10:22pm

Wow. Thanks Rob, thanks for going the extra mile and modifying the patch!

There’s been so many posts around this, but I struggled to piece it together mentally, so again thanks for helping me out this much!



You must be logged in to reply to this topic.