Archived

This topic is now archived and is closed to further replies.

Ataru

Multi-textures -- why?

Recommended Posts

Ataru    133
My home system runs a GeForce3, and my project uses mult-texturing. This works everywhere I''ve tried it, but today I run it on a school machine, GeForce4 MX 460, and multi-texturing does not work. My system has detected the extension, so the video card should support it. Can anyone see anything in this code that would suggest why on a certain NVIDIA chip multi-texturing does not work?
  
void t_displayRec()
{
  glEnableClientState(GL_VERTEX_ARRAY);

  glClientActiveTextureARB(GL_TEXTURE0_ARB);
  glEnableClientState(GL_TEXTURE_COORD_ARRAY);
  glTexCoordPointer(2, GL_FLOAT, 0, tVA_tex);

  glClientActiveTextureARB(GL_TEXTURE1_ARB);
  glEnableClientState(GL_TEXTURE_COORD_ARRAY);
  glTexCoordPointer(2, GL_FLOAT, 0, tVA_blend);

  glClientActiveTextureARB(GL_TEXTURE2_ARB);
  glEnableClientState(GL_TEXTURE_COORD_ARRAY);
  glTexCoordPointer(2, GL_FLOAT, 0, tVA_tex);
  
  glActiveTextureARB(GL_TEXTURE0_ARB);
  glEnable(GL_TEXTURE_2D);
  terrainTex.Use();
 
  glActiveTextureARB(GL_TEXTURE1_ARB);
  glEnable(GL_TEXTURE_2D);
  terrainRough.Use();

  glActiveTextureARB(GL_TEXTURE2_ARB);
  glEnable(GL_TEXTURE_2D);
  am_currentLightMap();

  glVertexPointer(3,GL_FLOAT,0,tVA_vertices);

  curTimeStep++;

  t_createQuadTree(quad_root, MAX_LEVEL-1);
  t_displayRec(quad_root);

  glDisableClientState(GL_VERTEX_ARRAY);  

  glActiveTextureARB(GL_TEXTURE2_ARB);
  glDisable(GL_TEXTURE_2D);
  glDisableClientState(GL_TEXTURE_COORD_ARRAY);

  glActiveTextureARB(GL_TEXTURE1_ARB);
  glDisable(GL_TEXTURE_2D);
  glDisableClientState(GL_TEXTURE_COORD_ARRAY);
  
  glActiveTextureARB(GL_TEXTURE0_ARB);
  glDisable(GL_TEXTURE_2D);
  glDisableClientState(GL_TEXTURE_COORD_ARRAY);

  
}
  
I see texture 1, but texture 2 and 3 are missing. I can''t see why this wouldn''t work on another NVIDIA card.

Share this post


Link to post
Share on other sites
Ataru    133
O.k, it does actually work when multi-texturing 2 textures, but not 3. Is it possible a geoforce4 card can only multi-texture 2 textures in one pass?

Is there a way to find out how many textures can be layered?

Share this post


Link to post
Share on other sites
Yann L    1802
GeForce4 Ti cards have 4 texture units. A GeForce4 MX , however, is nothing but a modified GeForce2, and only supports two units.

quote:

Is there a way to find out how many textures can be layered?


glGetIntegerv(GL_MAX_TEXTURE_UNITS(_ARB), &count);


[edited by - Yann L on January 30, 2003 2:05:59 PM]

Share this post


Link to post
Share on other sites