Skip to main content
GameDev.net gamedev.net
🔒 Locked

Bump Mapping Help

Started by L0rdDiabl0 Jul 7, 2004 at 3:12 AM 5 replies 1.3k views
Original Post
L0rdDiabl0
L0rdDiabl0
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);
Corrail
Corrail
Did you include the glext.h ?
http://oss.sgi.com/projects/ogl-sample/ABI/glext.h
--------------------------------------------------------There is a theory which states that if ever anybody discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.There is another theory which states that this has already happened...
nife
nife
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
Killers don't end up in jailThey end up on a high-score!
L0rdDiabl0
L0rdDiabl0
Sorry, i replied before logging

I'm including glext.h and getting the error
vincoof
vincoof
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.