passing param to shader in a cmdlist


    Jul 02 2008 | 6:47 am
    following http://www.cycling74.com/forums/index.php?t=msg&goto=63168
    how do i pass parameters to shaders when using the glbindprogram call?
    for example
    reset,
    glbindprogram blur,
    glparam width 0.3 0.3, (??)
    circle 0.5,
    glbindprogram

    • Jul 02 2008 | 6:52 am
      I'm not sure that you can actually. You may want to use some form of
      scripting instead.
      wes
      On Tue, Jul 1, 2008 at 11:47 PM, yair reshef wrote:
      > following http://www.cycling74.com/forums/index.php?t=msg&goto=63168
      > how do i pass parameters to shaders when using the glbindprogram call?
      > for example
      >
      > reset,
      > glbindprogram blur,
      > glparam width 0.3 0.3, (??)
      > circle 0.5,
      > glbindprogram
      >
      >
      >
      >
    • Jul 02 2008 | 7:32 am
      i found no example of param/gl_commands manipulation via scripting.
      i need the sketch command list as i am texturing a sliced open cylinder,
      which i can only generate using direct cmd commands.
      thanks wes
      On Wed, Jul 2, 2008 at 8:52 AM, Wesley Smith wrote:
      > I'm not sure that you can actually. You may want to use some form of
      > scripting instead.
      > wes
      >
      > On Tue, Jul 1, 2008 at 11:47 PM, yair reshef wrote:
      > > following http://www.cycling74.com/forums/index.php?t=msg&goto=63168
      > > how do i pass parameters to shaders when using the glbindprogram call?
      > > for example
      > >
      > > reset,
      > > glbindprogram blur,
      > > glparam width 0.3 0.3, (??)
      > > circle 0.5,
      > > glbindprogram
      > >
      > >
      > >
      > >
      >
    • Jul 02 2008 | 7:43 am
      You could easily recreate this in jit.gl.lua. As for the param thing,
      in JS it would be
      shader = new JitterObject("jit.gl.shader", ctx);
      shader.param("paramname", vals);
      I hope this is somewhere near the mark as it's the first JS I've
      written in about 2 years :) Anyway, that's the idea. param is a
      method of a shader object in whatever scripting environment , java
      etc. you use.
      wes