Mapping multiple textures with glbindtexture and jit.gl.sketch

Feb 2, 2012 at 2:00am

Mapping multiple textures with glbindtexture and jit.gl.sketch

Hi everyone.
I'm having an issue with the mapping of multiple textures with the glbindtexture attribute in jit.gl.sketch. Since the patch I'm working on is huge, I have isolated and commented the important elements in this smaller exemple :

– Pasted Max Patch, click to expand. –

I would be so grateful if anyone could have a look at it and point me where my mistake(s) is because I have tried and tried without success..
Many thanks!
Simon

[attachment=184105,3295]

Attachments:
  1. glbindtextureIssuegoal.jpg
#61579
Feb 4, 2012 at 10:19pm

Sending the message ‘texgen projected’ to both jit.gl.texture objects seems to reveal a little more of the textures while using ‘glbindtexture’ (instead of 1 stretched pixel) but I still can’t manage to see the whole textures on the shapes. I know about the gltexcoord attribute but I haven’t figured how to use it without having to combine it with a glvertex (since I don’t want the vertex to be drawn).
Any tips would be appreciated, thanks.

simon

#222245
Feb 10, 2012 at 1:18pm

About to give up on this. Anything, anyone?

#222246
Feb 11, 2012 at 5:29pm

i think you have to incorporate the gltexgen sketch command to your command list to emulate the tex_plane_s/t attributes.

#222247
Feb 11, 2012 at 5:31pm

also, if you’re doing 2D physics, jit.phys.world in the soon to be released max 6 update has an attribute to enable 2D physics.

#222248
Feb 13, 2012 at 3:51am

Got it! Thanks for the tip Robert! The gltexgen attribute did what I needed. However I had to add a few attributes to the jit.gl.texture object to make it work. The autoscale had to be set to 0 and the texgen attribute had to be set to ‘objectspace’.

I updated my previous example with the solution in case someone ever needs to do the same trick:

– Pasted Max Patch, click to expand. –

Simon

#222249

You must be logged in to reply to this topic.