PDA

View Full Version : Float cubemap



capedica
09-21-2005, 04:36 AM
Hi,
before starting a programming session, can you tell me if i can build a float cubemap? is it the same method for building normal cubemap but with format GL_FLOAT?
When i bind a float 2d texture i have to make distinction between ati and nvidia (glBindTexture(GL_TEXTURE_RECTANGLE_NV,t->stored) for nvidia or glBindTexture(GL_TEXTURE_2D,t->stored) for ati), is there a similiar distinction with float cubemap?
Thank you very much.

Relic
09-21-2005, 05:17 AM
On NVIDIA the answer is yes, you can. Supported formats vary, though. Check the tables 4.6 and 5.6 in the GPU programming guide:
http://developer.nvidia.com/object/gpu_programming_guide.html
Pretty helpful doc to answer such questions, you know. ;)
Looks like the older chips only supported up to 32 bits and the newer can handle 128 bits per cubemap texel.

ChiefWiggum
09-25-2005, 04:02 AM
By the way, you can use GL_TEXTURE_RECTANGLE_ARB now, it works on both ATI and Nvidia. The enum is actually the same as GL_TEXTURE_RECTANGLE_NV on an nvidia card, because its pretty much the same extension!

Humus
09-26-2005, 09:31 PM
It's still better though to use GL_TEXTURE_2D than rectangles since that's faster and also more in line with where things are heading for the future.

capedica
10-03-2005, 01:04 AM
I'm creating float cubemap in this way:



for (int cube=0;cube<6;cube++)
{
if (cube==0) target = GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB;
if (cube==1) target = GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB;
if (cube==2) target = GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB;
if (cube==3) target = GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB;
if (cube==4) target = GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB;
if (cube==5) target = GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB;
....
....
glTexImage2D(target,0,GL_RGB32F_ARB,Width,Heigth,0 ,GL_RGB,GL_FLOAT,tempOffset); in this way on Ati card all function properly.
On Nvidia card i've tried simply to change GL_RGB32F to GL_FLOAT_RGB32_NV (if i don't do this application switch to software mode), but it doesn't function. Any ideas?
Thank you

Overmind
10-03-2005, 03:10 AM
The NV float formats will only work with the TEXTURE_RECTANGLE target, so for cubemaps you have to use the ARB float formats (assuming your card supports the ARB float extension, AFAIK the GFFX does not).

Look in the document Relic posted to see what formats your graphic card supports, if you use something else you'll most likely get software fallback.