Real Quick Question on EMBM

Started by
5 comments, last by Eps 19 years, 8 months ago
In the opengl extension registry for ATI_env_bumpmap it says. This (du,dv) offset is also rotated through a user-specified rotation matrix to get the texture coordinates into the appropriate space. Is this essentially saying you need to put it into tangent space?
Advertisement
No, the matrix is 2x2. EMBM really is just a hackish way to achieve environment bump mapping that really isn't grounded in theory very well. It can look good on hardware that suppports nothing else though and is much cheaper than the "correct" way to do it.
Could you maybe point me in the direction of the "correct" way to do it?
Look up reflective bumpmapping.
If at first you don't succeed, redefine success.
Okay, I googled it and read an Nvidia pdf document on the idea of reflective bumpmapping. Maybe I'm interpreting this wrong, but I don't see how it takes your geometry into the reflection. It seems to only read off of the cube-map, which is practically the same thing as all your skybox textures in one large texture. I want my terrain geometry included in the reflection.
Quote:Original post by Eps
I want my terrain geometry included in the reflection.

Then you have to render it to cubemap yourself. No other (cheap) way around it.
You should never let your fears become the boundaries of your dreams.
Well it seems that reflective bumpmapping is oriented more for non-planer surfaces. Lucky for me, I am using a planer surface and so EMBM suits me just right. I'm creating water for a project and have been able to reflect everything onto it with no problems. I can bump map it as well. However I'm having problems perturbing the reflected texture. I hate to just ask what's wrong with code, but maybe a snippet will give a better idea of what I'm trying to do.

// UNIT 0glActiveTexture(GL_TEXTURE0_ARB);glEnable(GL_TEXTURE_2D);glBindTexture(GL_TEXTURE_2D, texID);// UNIT 1glActiveTexture(GL_TEXTURE1_ARB);glEnable(GL_TEXTURE_2D);glBindTexture(GL_TEXTURE_2D, offID);glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, BUMP_ENVMAP_ATI);// UNIT 2glActiveTexture(GL_TEXTURE2_ARB);glEnable(GL_TEXTURE_2D);glBindTexture(GL_TEXTURE_2D, bumpID);glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_DOT3_RGB_EXT); glTexEnvf(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, GL_TEXTURE);glTexEnvf(GL_TEXTURE_ENV, GL_OPERAND0_RGB_EXT, GL_SRC_COLOR);glTexEnvf(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_PRIMARY_COLOR_EXT);glTexEnvf(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, GL_SRC_COLOR);


Now obviously on texture unit 2 I am applying the bumpmapping wrong, which I assume I need to correct by using BUMP_TARGET_ATI. Would this be the correct order of operations once that change is made? Also, I can't seem to find any good documentation on how to do this.

This topic is closed to new replies.

Advertisement