Applying a texture with alpha content to jit.gl.sketch

Apr 9, 2012 at 9:28pm

Applying a texture with alpha content to jit.gl.sketch

Hi guys,

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

I understand how this works with jit.gl.gridshape [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 jit.gl.sketch, to see if I could get the brush effect on the stroke, I tried this by setting the jit.gl.sketch [@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 jit.gl.sketch just simply doesn’t allow alpha values for a captured texture, however I’m hoping you guys can prove me wrong!

cheers,

-chris

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

i don’t see where you are using jit.gl.sketch in the patch you pasted?

#226942
Apr 9, 2012 at 9:39pm

That isn’t my patch Robert, that’s one Nesa posted showing how to jit.gl.gridshape 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 jit.gl.sketch object (what I’m currently using in my project).

-chris

#226943
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.

#226944
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.

-chris

– Pasted Max Patch, click to expand. –
Attachments:
  1. brushtips.mov
#226945
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.

#226946
Apr 11, 2012 at 12:24pm

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

-chris

#226947
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:

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

i’ve modified your patch to include stroke texturing:

– Pasted Max Patch, click to expand. –
#226948
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!

-chris

#226949

You must be logged in to reply to this topic.