Jump to content
  • Advertisement
Sign in to follow this  
L0rdDiabl0

Bump Mapping Help

This topic is 5097 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to do some basic bump mapping, and i keep getting this error 'GL_DOT3_RGBA_EXT' : undeclared identifier Can someone please tell me what's wrong, here's my code: Another Question: What does all of glTexEnv parameters that i'm using means? i don't fully understand them, i just learned to use them by trial and error from other codes gluLookAt(0,0,4,0,0,0,0,1,0); glActiveTextureARB(GL_TEXTURE1_ARB); glBindTexture(GL_TEXTURE_2D, decalTexture); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT); glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_MODULATE); glTexEnvf(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, GL_PREVIOUS_EXT); glTexEnvf(GL_TEXTURE_ENV, GL_OPERAND0_RGB_EXT, GL_SRC_ALPHA); glTexEnvf(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_TEXTURE); glTexEnvf(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, GL_SRC_COLOR); glEnable(GL_TEXTURE_2D); if (BumpMap) { glActiveTextureARB(GL_TEXTURE0_ARB); glBindTexture(GL_TEXTURE_2D, normalMap); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT); glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_DOT3_RGBA_EXT); glTexEnvf(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, GL_PRIMARY_COLOR_EXT); glTexEnvf(GL_TEXTURE_ENV, GL_OPERAND0_RGB_EXT, GL_SRC_COLOR); glTexEnvf(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_TEXTURE); glTexEnvf(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, GL_SRC_COLOR); glEnable(GL_TEXTURE_2D); } glBegin(GL_QUADS); glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 1.0f, 1.0f); glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 1.0f, 1.0f); glVertex3f( 1.0f, 1.0f, 0.0f); glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 1.0f, 0.0f); glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 1.0f, 0.0f); glVertex3f( 1.0f, -1.0f, 0.0f); glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.0f, 0.0f); glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.0f, 0.0f); glVertex3f(-1.0f, -1.0f, 0.0f); glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.0f, 1.0f); glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.0f, 1.0f); glVertex3f(-1.0f, 1.0f, 0.0f); glEnd(); glActiveTextureARB(GL_TEXTURE0_ARB); glDisable(GL_TEXTURE_2D); glActiveTextureARB(GL_TEXTURE1_ARB); glDisable(GL_TEXTURE_2D);

Share this post


Link to post
Share on other sites
Advertisement
The undeclared identifier is because you're using an old version of the gl.h (1.1?), which donesn't know the value of GL_DOT3_RGBA_EXT, which is 0x8741. Well, most have the old 1.1 because that's what was shipped with the compilers, you just need a glext.h which is available from many places including http://g3d-cpp.sourceforge.net/html/glext_8h.html

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I'm including glext.h and getting the error

Share this post


Link to post
Share on other sites
Or if you can't handle inclulding glext.h, simply define the symbol in one of your headers or in the beginning of your source file

#ifndef GL_DOT3_RGBA_EXT
#define GL_DOT3_RGBA_EXT 0x8741
#endif

In the long run, if you have to use many other extensions, you should try to look for the reasons why including glext.h doesn't work.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I switched from _EXT to _ARB and everything worked fine, this is weird
Thanks for the help guys

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!