Jump to content
  • Advertisement
Sign in to follow this  
BlazingClaymore

OpenGL NEED HELP!!!!!! OpenGL EMBM - Environment-Mapped Bump Mapping

This topic is 4165 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

Ok can someone, anyone please tell me how to use EMBM in OpenGL there really is no good sample code out there. Even if you can just point me in the right direction. I'm almost done with my game but I must have EMBM. please help me I'v googled until I can't google no more. ohh and also if anyone know anything about skeletal animation. that would be nice to.;) [Edited by - BlazingClaymore on April 21, 2007 11:57:55 PM]

Share this post


Link to post
Share on other sites
Advertisement
Look up doing standard normal mapping/bump mapping for lighting in a shader first.

Once you can do that, to do EMBM, you take the resulting normal from the normalmap/bumpmap and use it to sample a cube map.

Not much to it really, once you have the normalmapping out of the way =)

Share this post


Link to post
Share on other sites
Thank you for helping me but I was hoping there is a way to do it without using shaders. There is a tag I found GL_BUMP_TARGET_ATI I thank it may have something to do with it I tried using it like this.


glActiveTexture(GL_TEXTURE0_ARB);
glEnable(GL_TEXTURE_2D);
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, GL_RGB8, 256, 256, 0, GL_BGR_EXT, GL_UNSIGNED_BYTE, texturess[1]->data);
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Y, 0, GL_RGB8, 256, 256, 0, GL_BGR_EXT, GL_UNSIGNED_BYTE, texturess[2]->data);
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Z, 0, GL_RGB8, 256, 256, 0, GL_BGR_EXT, GL_UNSIGNED_BYTE, texturess[3]->data);
glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_X, 0, GL_RGB8, 256, 256, 0, GL_BGR_EXT, GL_UNSIGNED_BYTE, texturess[4]->data);
glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, GL_RGB8, 256, 256, 0, GL_BGR_EXT, GL_UNSIGNED_BYTE, texturess[5]->data);
glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, GL_RGB8, 256, 256, 0, GL_BGR_EXT, GL_UNSIGNED_BYTE, texturess[6]->data);
glTexParameteri(GL_TEXTURE_CUBE_MAP_EXT, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_CUBE_MAP_EXT, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_CUBE_MAP_EXT, GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
glTexParameteri(GL_TEXTURE_CUBE_MAP_EXT, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE_EXT);
glTexParameteri(GL_TEXTURE_CUBE_MAP_EXT, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE_EXT);
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_EXT);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_EXT);
glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_EXT);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE) ;

glActiveTexture(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, textures[0]);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);


glActiveTexture(GL_TEXTURE2_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, textures[8]);
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_TEXTURE1);

But it don't do anything.?

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!