PDA

View Full Version : GL_ATIX_envmap_bumpmap question



h2
05-13-2001, 08:07 AM
Hi,

I've lost a bit in specs. It this sequence:

glTexEnvi (GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_COMBINE_EXT );
glTexEnvi (GL_TEXTURE_ENV,GL_COMBINE_RGB_EXT,GL_BUMP_ENVMAP_ ATIX);
glTexEnvi(GL_TEXTURE_ENV,GL_BUMP_TARGET_ATIX,GL_TE XTURE1_ARB);

is all that I need to do to turn on bumpmap for tex.unit 2 (i assume that I've already binded textures and enabled texturing on units 1 & 2, current unit is 1)? Is any special setup for EXT_texture_env_combine required to make ATIX_bump_envmap work?


[This message has been edited by h2 (edited 05-13-2001).]

HFAFiend
05-13-2001, 11:42 AM
What exactly does that extension do?

Humus
05-13-2001, 01:21 PM
It's an EMBM extension.


Some cut'n'paste code from my EMBM demo:



glActiveTexture(GL_TEXTURE0_ARB);
glEnable(GL_TEXTURE_2D);
envMap->setCurrent();

glActiveTexture(GL_TEXTURE2_ARB);
glEnable(GL_TEXTURE_2D);
bumpMap->setCurrent();

glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_BUMP_ENVMAP_ATIX);
glTexEnvi(GL_TEXTURE_ENV, GL_BUMP_TARGET_ATIX, GL_TEXTURE0_ARB);


float rotMatrix[4];

rotMatrix[0] = 0.01f;
rotMatrix[1] = 0;
rotMatrix[2] = 0;
rotMatrix[3] = 0.01f;

glTexBumpParameterfvATIX(GL_BUMP_ROT_MATRIX_ATIX, (float *) &rotMatrix);

h2
05-14-2001, 01:34 AM
Humus,

Thanks.

chrisATI
05-14-2001, 04:27 PM
Originally posted by h2:
Hi,

I've lost a bit in specs. It this sequence:

glTexEnvi (GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_COMBINE_EXT );
glTexEnvi (GL_TEXTURE_ENV,GL_COMBINE_RGB_EXT,GL_BUMP_ENVMAP_ ATIX);
glTexEnvi(GL_TEXTURE_ENV,GL_BUMP_TARGET_ATIX,GL_TE XTURE1_ARB);

is all that I need to do to turn on bumpmap for tex.unit 2 (i assume that I've already binded textures and enabled texturing on units 1 & 2, current unit is 1)? Is any special setup for EXT_texture_env_combine required to make ATIX_bump_envmap work?


[This message has been edited by h2 (edited 05-13-2001).]
just a side note: make sure that the DUDV offset texture always lives in tex unit 2.

h2
05-15-2001, 02:49 AM
chrisATI,

You mean GL_TEXTURE2_ARB or 2nd tex.unit (aka GL_TEXTURE1_ARB)?

It seems that GL_BUMP_TEX_UNITS_ATIX returns non-zero value (something like 32245) only for GL_TEXTURE0_ARB. I wonder why.

Humus
05-15-2001, 08:28 AM
The Radeon only supports bumpmaps on the third texturing unit (GL_TEXTURE2_ARB).

chrisATI
05-15-2001, 10:19 AM
Originally posted by h2:
chrisATI,

You mean GL_TEXTURE2_ARB or 2nd tex.unit (aka GL_TEXTURE1_ARB)?

It seems that GL_BUMP_TEX_UNITS_ATIX returns non-zero value (something like 32245) only for GL_TEXTURE0_ARB. I wonder why.

DUDV offset map must live on GL_TEXTURE2_ARB

--chris

Humus
05-15-2001, 02:39 PM
btw ... the extension provides an interface for querying which texture units supports DUDV maps.