Forums > Jitter

Mapping multiple textures with glbindtexture and jit.gl.sketch

February 2, 2012 | 2:00 am

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

February 4, 2012 | 10:19 pm

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


February 10, 2012 | 1:18 pm

About to give up on this. Anything, anyone?


February 11, 2012 | 5:29 pm

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


February 11, 2012 | 5:31 pm

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.


February 13, 2012 | 3:51 am

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


Viewing 6 posts - 1 through 6 (of 6 total)