How to set multiple texture coordinate?

Mesh.setBuffer(Type.TexCoord, …) set first texture coordinate. right?

Then how to set 2nd texture coordinate?

there is none as far as i know.

youa re supposed to use shaders for more systems

I added TexCoord2 in the latest SVN

oh or that way, could be usefull :slight_smile:

Thank you!

But sometimes an application needs 3 or more texture coordinates.

I hope it support as many texture coordinates as OpenGL permits.

This is where it gets tricky, as far as I know there is no minimal amount specified.

So as always we have different imlementations ( for example my intel onboard in laptop only permits 1!)



So I would say for normal purposes you could say 1 is safe, 4 probably on game pc’s and i wouldn’t use any above. I strongly suggest to use shaders then as there is no limit (at least not that I know (except video ram and performance))

Oh I see. Maybe I have to use shader attribute instead of texture coordinate.

Usually you only need 2 texture coordinates, first set for a texture and second for a light-map.

Don’t forget that you can store 4D texture coordinates, with two sets, that’s already 8 possible values you can store.

Oh, thank you. That’s nice hint. I’ll use 4D texture.

Actually our project use more than 4 texture coordinates.

Any reason why you are using 4 texture coordinates? I am just curious.

Our baseball players has 5 textures.

1: diffuse

2: specular

3: normal

4: dirt

5: backnumber



specular and normal use the same texture coordinate but others use different texture coordinates.

It’s because we want to use less texture size.

Oh I see. But you’re not planning to port your game to jME3, or are you :stuck_out_tongue: ?

It should be fairly easy to add more texcoords, its just modifying an enum really.

I’d like to. but I don’t dare to port to jme3 because of stability and time constraints and backward compatibility(OpenGL 1.x).

It doesn’t mean jme3 is not stable, just because jme2 is proved to be stable for a long time.

I think jme3 will be the engine for the next project.

Nowadays, I’m porting our game’s library to jme3 to use it for the next project.