Binding Textures to jit.gl.shader

Aug 22, 2006 at 6:18am

Binding Textures to jit.gl.shader

Hello,

I am looking for an example of how to do multitextureing in jitter using jit.gl.shader objects rather than jit.gl.slab objects. My main problem is figureing out how to bind the set of textures properly. So far the only examples i could find that do multitexturing with shaders, is slab examples, but i am looking for jit.gl.shader example.

Thanks

#27241
Aug 22, 2006 at 6:25am

Code-wise, multitexturing is the same for both slab and shader. The
shader will have a tex0 and tex1 parameter that you bind to the
fragment program. However instead of sending a matrix or texture in
the 2 inlets of a slab, you simply make an ob3d with an array of
texture names like jit.gl.gridshape context @texture tex0 tex1 and
they will be passed in to the shader.

wes

On 8/21/06, Jason Schmitt wrote:
>
> Hello,
>
> I am looking for an example of how to do multitextureing in jitter using jit.gl.shader objects rather than jit.gl.slab objects. My main problem is figureing out how to bind the set of textures properly. So far the only examples i could find that do multitexturing with shaders, is slab examples, but i am looking for jit.gl.shader example.
>
> Thanks
>
>

#82225
Aug 22, 2006 at 6:27am

On Aug 21, 2006, at 11:18 PM, Jason Schmitt wrote:

> I am looking for an example of how to do multitextureing in jitter
> using jit.gl.shader objects rather than jit.gl.slab objects. My
> main problem is figureing out how to bind the set of textures
> properly. So far the only examples i could find that do
> multitexturing with shaders, is slab examples, but i am looking for
> jit.gl.shader example.

Bind the multiple textures using the target object. e.g.
jit.gl.gridshape @shader shadername @texture tex1name tex2name
tex3name …

For example jit.gl.slab is almost the same the following (you’ll need
to define the shader, texture input and texture output objects
separately of course):

jit.gl.gridshape @shape plane @shader shadername @texture input_tex_1
input_tex_2 @capture output_tex @reset_transform 2

-Joshua

#82226
Aug 23, 2006 at 5:25am

Thanks, I’ll try that…

#82227

You must be logged in to reply to this topic.