Applying a texture with alpha content to

    Apr 09 2012 | 9:28 pm
    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!

    • Apr 09 2012 | 9:32 pm
      i don't see where you are using in the patch you pasted?
    • Apr 09 2012 | 9:39 pm
      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 | 4:18 pm
      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 | 5:37 pm
      I can't find the old patch I did before, but basically here's a quick patch of what I'm trying to do.
    • Apr 11 2012 | 10:04 am
      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 | 12:24 pm
      I want to draw the brush texture using gl.sketch.
    • Apr 11 2012 | 9:51 pm
      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
      i've modified your patch to include stroke texturing:
    • Apr 11 2012 | 10:22 pm
      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!
    • May 21 2014 | 10:35 am
      Nice patch! What I don't understand is why "strokeparam texture" needs to turn on/off while drawing for this to work?
      I tried it with the automatic drawing mode and a mouse drawing mode I implemented:
      Cheers, Maarten