jit.gl.slab texture inputs?
Hi -
The jit.gl.slab object is very cool. By offloading many operations to the GPU I was able to get a 4x improvement in frame rate!
I am wondering, though, if there's a way to specify the texture inputs to jit.gl.slab some other way than by feeding in matrix inputs. It seems like once I have a jit.gl.texture object, there should be some way to bind a variable in GLSL to that named object rather than having to pass a Max message in from outside to it up. Does this make sense?
This would be useful not only for performance, but also for patcher tidiness.
Thanks,
James
evergreen eye visuals (http://www.eevisuals.com)
you can communicate with the texture unit inside slabs by using the
"sendoutput" message followed by a message to the texture unit. So if you
send the slab doing your processing the message "sendoutput name myTexture"
it will send out the texture with myTexture as it's name. Then all you need
to do is send the object you want to use the texture the message
"jit_gl_texture myTexture". It will then use the texture without having to
set up patch cords.
There's also a sendinput message for slabs
pelado
On Wed, Sep 3, 2008 at 7:51 AM, James Drage wrote:
>
> Hi -
>
> The jit.gl.slab object is very cool. By offloading many operations to the
> GPU I was able to get a 4x improvement in frame rate!
>
> I am wondering, though, if there's a way to specify the texture inputs to
> jit.gl.slab some other way than by feeding in matrix inputs. It seems like
> once I have a jit.gl.texture object, there should be some way to bind a
> variable in GLSL to that named object rather than having to pass a Max
> message in from outside to it up. Does this make sense?
>
> This would be useful not only for performance, but also for patcher
> tidiness.
>
> Thanks,
> James
> evergreen eye visuals (http://www.eevisuals.com)
>
Thanks for the quick response. It's not quite working but I think I'm on the right track.
I am pumping a matrix to a jit.gl.texture with name "input1".
I have a jit.gl.videoplane on the same context and if I send it a "texture input1" message, it renders correctly.
Now, I have a jit.gl.slab on the same context to which I send a "sendinput 0 name input1" message. It renders to a different jit.gl.texture object named source1. If I send "texture source1" to the jit.gl.videoplane, I only see the dreaded gray checkerboard of non-renderingness. I also tried "sendinput name input1" but this produces the error message "name input1 already in use. ob3d does not allow multiple bindings" four times (presumably because my jit.gl.slab has 4 inputs).
I'm sure it's something simple that I'm missing... couldn't find any details on the sendinput or sendoutput msgs in the documentation, and not much on the forums either.
James
Can you post a patch?
wes
Here's a simple patch which demonstrates what I'm seeing:
The problem is that jit.gl.texture doesn't alias like jit.matrix does.
You have a texture named tex1, so you can't name any of the internal
jit.gl.slab textures tex1. You can send a message jit_gl_texture tex1
to the object. You can also use sendoutput name tex1fx to se the
output texture's name.
This works, but it seems weird to have to send a jit_gl_texture message every frame.
I interpret jit.gl.texture as a facade for the actual GL texture object. So isn't there a way to hook up a permanent reference to the GL texture created by that object inside the jit.gl.slab? Can I do it in the GLSL perhaps?
James
Also, how does this work when the jit.gl.slab has multiple inputs?
James
This works perfectly with a jit.gl.slab with multiple inputs (you just sent separate "jit_gl_texture " messages to each input.
The frame rate is much higher than pumping the matrices from a jit.gl.texture, which addresses my concern of efficiency of moving extra bits around.
Thanks for your help!
James