PDA

View Full Version : how to EMBM on Radeon



Heron
02-09-2004, 12:01 AM
Hi all,
I wanna use EMBM in OpenGL on the Radeon 9500pro,our codes just like bellow

......................................
glClientActiveTextureARB( GL_TEXTURE0_ARB );
glActiveTextureARB( GL_TEXTURE0_ARB );
glBindTexture(GL_TEXTURE_2D, evnTexture);
glEnable ( GL_TEXTURE_2D );
glTexEnvi ( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE );

glClientActiveTextureARB(GL_TEXTURE1_ARB);
glActiveTextureARB (GL_TEXTURE1_ARB);
glBindTexture (GL_TEXTURE_2D, bumpTexture);
glEnable ( GL_TEXTURE_2D );
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);
glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_BUMP_ENVMAP_ATI);
glTexEnvf(GL_TEXTURE_ENV, GL_BUMP_TARGET_ATI, GL_TEXTURE0_ARB);
GLfloat bumpMatrix[4] = {0.5f, 0.0f, 0.5f, 0.0f};
glColor4f( 1.0f,1.0f,1.0f, 1.0f );
glTexBumpParameterfvATI(GL_BUMP_ROT_MATRIX_ATI, bumpMatrix);

...RenderPolys....


I can not find what's wrong with my codes for I can not see any bumpmap effect on the surface.

Need your help,
Yours Heron

NitroGL
02-09-2004, 07:33 AM
Are you generating texture coords for the env map?



glActiveTextureARB(GL_TEXTURE0_ARB);
glBindTexture(GL_TEXTURE_2D, evnTexture);
glEnable(GL_TEXTURE_2D);
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);

glActiveTextureARB(GL_TEXTURE1_ARB);
glBindTexture(GL_TEXTURE_2D, bumpTexture);
glEnable(GL_TEXTURE_2D);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_BUMP_ENVMAP_ATI);
glTexEnvi(GL_TEXTURE_ENV, GL_BUMP_TARGET_ATI, GL_TEXTURE0_ARB);
GLfloat bumpMatrix[4] = {0.5f, 0.0f, 0.5f, 0.0f};
glTexBumpParameterfvATI(GL_BUMP_ROT_MATRIX_ATI, bumpMatrix);


[This message has been edited by NitroGL (edited 02-09-2004).]

Heron
02-09-2004, 10:15 PM
I will give a try....

Heron
02-10-2004, 08:50 PM
Thx to NitroGL,

I've checked my codes.Yeah,I really forgot to set the UV of the bumpmap texture unit.
Now ,it works,
Cheers