Archived

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

Zerosignull

Multitexturing wont work help plz!

Recommended Posts

Hi, im having problem''s multitexturin in opengl. my main problem is that when i assign a texture to my seccond TMU it doesnt do ne thing all i c is the texture from tmu 1. Does the texture in the second TMU have to be in any particular format or can i just use ne texture???...i think ive set if up right ... theses are global: #include "glext.h" #....... PFNGLMULTITEXCOORD2FARBPROC glMultiTexCoord2fARB = NULL; PFNGLCLIENTACTIVETEXTUREARBPROC glActiveTextureARB = NULL; PFNGLCLIENTACTIVETEXTUREARBPROC glClientActiveTextureARB = NULL; these go in a function: mglLoadTextures(0,"ZeroTex.bmp"); mglLoadTextures(1,"lavax.bmp"); glMultiTexCoord2fARB = (PFNGLMULTITEXCOORD2FARBPROC) wglGetProcAddress("glMultiTexCoord2fARB"); glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC) wglGetProcAddress("glActiveTextureARB"); glClientActiveTextureARB = (PFNGLCLIENTACTIVETEXTUREARBPROC) wglGetProcAddress("glClientActiveTextureARB"); this goes wherer i want to draw: glActiveTextureARB(GL_TEXTURE0_ARB); glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, texture[0]); glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT); glTexEnvf (GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_REPLACE); glActiveTextureARB(GL_TEXTURE1_ARB); glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, texture[1]); glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT); glTexEnvf (GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_ADD); glBegin(GL_QUADS); glMultiTexCoord2fARB(GL_TEXTURE0_ARB,0,1); glMultiTexCoord2fARB(GL_TEXTURE1_ARB,1,0); glVertex3f (-0.25, 0.25, 0.0); glMultiTexCoord2fARB(GL_TEXTURE0_ARB,1,1); glMultiTexCoord2fARB(GL_TEXTURE1_ARB,0,0); glVertex3f (0.25, 0.25, 0.0); glMultiTexCoord2fARB(GL_TEXTURE0_ARB,1,0); glMultiTexCoord2fARB(GL_TEXTURE1_ARB,0,1); glVertex3f (0.25, -0.25, 0.0); glMultiTexCoord2fARB(GL_TEXTURE0_ARB,0,0); glMultiTexCoord2fARB(GL_TEXTURE1_ARB,1,1); glVertex3f (-0.25, -0.25, 0.0); glEnd(); ne help would be apreciated and i have a v3 so i know i have 2 tmu thnx Click to goto my page

Share this post


Link to post
Share on other sites
Of course V3 supports multitexturing. As did V2.
I don''t see a particular problem with this code, but maybe the blend mode you specify isn''t support. Try using modulate instead. If your textures work correctly using single texturing, they should also work when multitexturing.

Share this post


Link to post
Share on other sites