PDA

View Full Version : Cube map sampling problem



h2
05-25-2002, 05:43 AM
Hi,
I'm trying to sample normalization cube map in such way:
glSampleMapATI (GL_REG_2_ATI,GL_TEXTURE2_ARB,GL_SWIZZLE_STR_ATI);
But I obtain some crap (it looks just like cube maps texturing is disabled, but it is enabled!). I am pretty sure that the problem is in this shader (i.e. texture stages setup is correct) since when I'm doing same things in FF pipeline it works.
Does someone have an idea what is wrong? Your help is highly appreciated. I'm stuck with it for several days http://www.opengl.org/discussion_boards/ubb/frown.gif


[This message has been edited by h2 (edited 05-25-2002).]

PH
05-25-2002, 05:53 AM
The above line should work. Make sure you expand the vector using ( GL_BIAS_BIT_ATI | GL_2X_BIT_ATI ) in your dotproduct calculations ( I assume you want to do bumpmapping / per-pixel lighting ).

h2
05-25-2002, 06:03 AM
The problem isn't in dotproduct. For example this shader does not work as it should be:
glSampleMapATI (GL_REG_2_ATI,GL_TEXTURE2_ARB,GL_SWIZZLE_STR_ATI);
glColorFragmentOp1ATI (MOV_ATI,GL_REG_0_ATI,0,0,GL_REG_2_ATI,0,0);

PH
05-25-2002, 06:13 AM
Hmmm, that's strange. Did you remember to enclose the shader in calls to glBeginFragmentShaderATI() and glEndFragmentShaderATI() ?

davepermen
05-25-2002, 06:49 AM
how about showing the whole code?

and the general statement: make sure u use the newest drivers http://www.opengl.org/discussion_boards/ubb/smile.gif http://www.opengl.org/discussion_boards/ubb/smile.gif

h2
05-25-2002, 08:11 AM
Ok, guys. If you think that such sampling command is OK for cubemaps, Iíll continue hunting bugs in my code. Thanks for help!

PH
05-25-2002, 10:02 AM
I tried the above shader with a normalization cubemap bound to texture2 and the results were as expected, so the problem must be elsewhere - anyway, have a nice bug hunt http://www.opengl.org/discussion_boards/ubb/smile.gif.