I’m trying to sample normalization cube map in such way:
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
[This message has been edited by h2 (edited 05-25-2002).]
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 ).
The problem isn’t in dotproduct. For example this shader does not work as it should be:
Hmmm, that’s strange. Did you remember to enclose the shader in calls to glBeginFragmentShaderATI() and glEndFragmentShaderATI() ?
how about showing the whole code?
and the general statement: make sure u use the newest drivers
Ok, guys. If you think that such sampling command is OK for cubemaps, I’ll continue hunting bugs in my code. Thanks for help!
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 .