Alpha substitution


    Aug 28 2006 | 10:36 pm
    I'm swapping in a new alpha channel, and wondering if there is a more efficient method than the following. I'm able to get a nice 30fps with 10 objects receiving 320x240 video "streams" but when I throw in this alpha map swap step, it kills the framerate. Is there a way to do an op command that just performs the function on a single plane? I feel like I'm missing something very obvious.

    • Aug 28 2006 | 11:06 pm
      On Aug 28, 2006, at 3:37 PM, Leo Mayberry wrote:
      >
      > I'm swapping in a new alpha channel, and wondering if there is a
      > more efficient method than the following. I'm able to get a nice
      > 30fps with 10 objects receiving 320x240 video "streams" but when I
      > throw in this alpha map swap step, it kills the framerate. Is
      > there a way to do an op command that just performs the function on
      > a single plane? I feel like I'm missing something very obvious.
      I might suggest using multi-texturing for your purposes. At bottom is
      a simple example patch. You only need to load the mask texture once
      to the graphics card. This is also useful for adding masks to UYVY
      textures.
      Another option would be to use jit.gl.slab with something like the
      cc.alphaglue.jxs example shader to glue the alpha channel from one
      texture resource to another texture resource on the GPU. This is
      probably only an advantage over teh multi-texturing approach if you
      want to perform additional processing of the texture with other
      instances of jit.gl.slab.
      -Joshua
    • Nov 06 2006 | 9:40 am
      i think there is a typo, line 7 should be
    • Nov 06 2006 | 10:07 am
      to add, why am i getting grey (should be white) in this patch
      max v2;
    • Nov 06 2006 | 10:13 am
      You need to add a call to glcolor in yourt sketch commands
    • Nov 06 2006 | 10:16 am
      glcolor 1. 1. 1. 1. added to the cmdlist got it.