PDA

View Full Version : Using glMultiTexCoord for texture atlases..



youdonotexist
10-23-2008, 10:45 AM
I'm having trouble understanding how to use glMultiTexCoord to render only a sub-region of a texture to an object.

I understand that glMultiTexCoord in ES 1.2 is equivalent to glTexCoord in the Current Opengl Implementation.

The confusing arises because.. in all the examples for glTexCord, the calls are made between the begin/end statements. ES doesn't have these.

Also, does the glMultiTexCoord replace the glTexCoordPointer? An example of using glMultiTexCoord for a single texture would be greatly appreciated!

Thanks,
Mike

Xmas
10-24-2008, 02:19 AM
Also, does the glMultiTexCoord replace the glTexCoordPointer? An example of using glMultiTexCoord for a single texture would be greatly appreciated!
glMultiTexCoord in OpenGL ES is of extremely limited use. All you can do with it is set constant texture coordinates for whole draw calls which, in turn, will give you the same colour sampled from the texture for every fragment. So usually you could just as well use a constant colour.

To map a texture to a mesh you need a texture coordinate array and use glTexCoordPointer.