PDA

View Full Version : multitexturing questions



JanHH
06-21-2003, 04:11 PM
Hello,

some parts in the 3d scene of the program I am working on are supposed to use multitexturing, while others only need to have one texture.

Somehow I am unable to mix single- and multitexturing. The multitextured parts look ok, but once multitexturing is used, everything with only one texture looks broken.

So I have some questions:

- when using multitexturing for some parts (glMultiTexCoordARB), do I also have to use glMultTexCoordARB for the parts with only one texture, or can/do I have to use glTexCoord?

- I thought it would be right to use glMultiTexCoordARB for everything, with usign GL_TEXTURE0 for the parts with only one texture and as the first of the multitexture set, and GL_TEXTURE1 for the second multitexture, etc. Is this right?

- I read somewhere that when mixing single- and multitexturing, you have to enable and disable the corresponding texture units. Is this true, and how is this done?

- The program is running on gf4 ti. How many multitextures can be rendered in one pass?

Thanks a lot,
Jan

bostrov
06-21-2003, 08:58 PM
I use TEXTURE0 (and remember to disable TEXTURE1..TEXTUREn if you've already bound textures to them with glDisable( GL_TEXTURE_2D ) or whatever else have you) for single textured objects.

gf4ti has 4 texture units. You should check this on the fly with:
glGetIntegerv( GL_MAX_TEXTURE_UNITS_ARB, &m_TextureUnits );

m_TextureUnits will then contain how many texture units you have available.