Mesh Question

Is it possible to set multiple textures for a mesh? Or must I use seperate meshes for each texture

@Jordan a mesh can only use one texture. This is a mirroring of how OpenGL works underneath. A mesh is one “draw” command, issued to OpenGL. One draw command in OpenGL can only be used with a single active texture, a single shader, single blending mode, and so on.

Oh, ok. Thanks for the speedy reply

But you can combine your textures into a single “atlas” and adjust the texture coordinates according to where the subimage lies on the atlas.

(I’ve done this for rendering a die.)

.@Andrew_Stacey, how would I go about doing this? What is an “atlas”? Subimage?
Jordan

You make one big image and then draw on it all the images you want to use at disjoint places. So for my die, I stacked the six faces on top of each other in a single image. (I actually made the image 8 times larger than a single face to make the coordinate calculations more accurate). I set this image as the texture for my mesh. Then my texture coordinates referenced the “subimages”, ie faces, of this big image.

So for the first face, my texture coordinates were set up so that instead of the corners being at (0,0), (1,0), (0,1), and (1,1) they were at (0,0), (1,0), (0,.125), and (1,.125).

Oooh! So you would make the ‘net’ of the shape (or whatever it is you are displaying)!