Archived

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

code_evo

hmm... multitexturing & VAs

Recommended Posts

hey... can anyone tell me why i''m only getting multiTexture[0] blended over the model, not blended over texture unit 0? Texture unit 0 doesnt show up at all. Thanks. glEnableClientState( GL_VERTEX_ARRAY ); glEnableClientState( GL_NORMAL_ARRAY ); glNormalPointer ( GL_FLOAT, 0, vaData.normals); glClientActiveTextureARB(GL_TEXTURE0_ARB); glEnable(GL_TEXTURE_2D); glEnableClientState(GL_TEXTURE_COORD_ARRAY); glTexCoordPointer(3, GL_FLOAT, 0, vaData[i].texCoords); glBindTexture(GL_TEXTURE_2D, vaData[i].textureID); glClientActiveTextureARB(GL_TEXTURE1_ARB); glEnable(GL_TEXTURE_2D); glEnableClientState(GL_TEXTURE_COORD_ARRAY); glEnable(GL_BLEND); glTexCoordPointer(3, GL_FLOAT, 0, vaData[i].texCoords); glBindTexture(GL_TEXTURE_2D, this->multiTexture[0]); glColor3ub(255, 255, 255); glVertexPointer (3, GL_FLOAT, 0, vaData[i].vertices); glDrawArrays(GL_TRIANGLES, 0, vaData[i].numVertices / 3); glDisable(GL_BLEND);

Share this post


Link to post
Share on other sites
glClientActiveTextureARB is used for setting the texture coordinates for each texture addressing unit. For setting the texture that is to be used for each texture unit, you must first specify the unit via glActiveTextureARB.

Share this post


Link to post
Share on other sites