View Full Version : Float cubemap
09-21-2005, 05:36 AM
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.
09-21-2005, 06: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:
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.
09-25-2005, 05: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!
09-26-2005, 10: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.
10-03-2005, 02: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?
10-03-2005, 04: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.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.