Alpha and shaders


    Jan 17 2007 | 10:33 pm
    When I send video source that has an alpha channel to a jit.gl.videoplane, the "color 1. 1. 1. $1" message will allow me to fade the plane in and out.
    However, when I apply a shader to the texture of the videoplane (using "sendtexture" and "shader" messages), it's no longer possible to control fading with the "color" message anymore. The effect of the shader is visible, but the "color" message no longer produces a fade.
    Perhaps the alpha information is getting lost through the shader? It seems the same for the 5 or 6 different shaders I tried.
    Max 4.6.2, Intel MacBook Pro
    Thanks for your help Kurt

    • Jan 17 2007 | 10:37 pm
      ahh so you do have an intel mac, (more incentive to update auvi to UB) hehehehe
      :D
    • Jan 17 2007 | 10:39 pm
      Hey Kurt!
      Try using a jit.gl.slab to process textures - I can properly control alpha via the color message when using slab 'chains', in fact, its vital for me!
      Some shaders build textures and have their own color controls on the jit.gl.shader, so if you need to use a shader, check its params, it may have a color or alpha param.
      -Anton
      On Jan 17, 2007, at 5:33 PM, Kurt Ralske wrote:
      > > > When I send video source that has an alpha channel to a > jit.gl.videoplane, the "color 1. 1. 1. $1" message will allow me to > fade the plane in and out. > > However, when I apply a shader to the texture of the videoplane > (using "sendtexture" and "shader" messages), it's no longer > possible to control fading with the "color" message anymore. > The effect of the shader is visible, but the "color" message no > longer produces a fade. > > Perhaps the alpha information is getting lost through the shader? > It seems the same for the 5 or 6 different shaders I tried. > > Max 4.6.2, Intel MacBook Pro > > Thanks for your help > Kurt
      v a d e //
      www.vade.info abstrakt.vade.info
    • Jan 17 2007 | 10:45 pm
      Dont even get me started on that ...
      On Jan 17, 2007, at 5:37 PM, Nicholas C. Raftis III wrote:
      > > ahh so you do have an intel mac, (more incentive to update auvi to > UB) hehehehe > > :D > > > -- > -=ili!ili=- www.Axiom-Crux.net -=ili!ili=-
      v a d e //
      www.vade.info abstrakt.vade.info
    • Jan 17 2007 | 10:51 pm
      On Jan 17, 2007, at 2:33 PM, Kurt Ralske wrote:
      > When I send video source that has an alpha channel to a > jit.gl.videoplane, the "color 1. 1. 1. $1" message will allow me to > fade the plane in and out. > > However, when I apply a shader to the texture of the videoplane > (using "sendtexture" and "shader" messages), it's no longer > possible to control fading with the "color" message anymore. > The effect of the shader is visible, but the "color" message no > longer produces a fade. > > Perhaps the alpha information is getting lost through the shader? > It seems the same for the 5 or 6 different shaders I tried.
      As you'll notice if you inspect the shader files, most of the video processing shaders do not multiply the output gl_FragColor with the current gl_Color. They are written with the assumption that they are going to be used in a slab-like setting, without using other things like lighting and material properties, gl_Color, etc. in the output calculation. I assume this is the cause of what you're experiencing.
      While you can modify any of the shaders to take this state information into account, I think that you'll probably get the results you're looking for by sending through jit.gl.slab- >jit.gl.videoplane, rather than using jit.gl.videoplane's shader attribute. If that doesn't work for whatever reason. I'd recommend making a set of shaders that functions the way you need. For more info check out the shader based tutorials, and various GLSL resources in the cycnling74.com resource guide and online.
      The GLSL language specification, Orange Book, and Clockwork coders tutorials are probably good places to start. http://www.opengl.org/documentation/glsl/ http://www.3dshaders.com/ http://www.clockworkcoders.com/oglsl/tutorials.html
      -Joshua
    • Jan 17 2007 | 10:59 pm
      Hi Kurt, Shaders use a different GPU pipeline than the fixed function pipeline everyone is used to and the glColor() uses. Unless a shader specifically uses the gl_Color parameter, the jit.gl.videoplane @color attribute will not actually have an effect. Instead, there is usually some parameter to the shader that sets the alpha of the final color or you have to set the alpha of the textures being used. As an example, the compositing shaders use the alpha channels of the 2 input textures to write the final alpha value.
      wes
      On 1/17/07, Nicholas C. Raftis III wrote: > > ahh so you do have an intel mac, (more incentive to update auvi to UB) hehehehe > > :D > > > -- > -=ili!ili=- www.Axiom-Crux.net -=ili!ili=- >