PDA

View Full Version : Float pbuffer



capedica
06-01-2005, 06:11 AM
Hi,
i've realized a simple class to manage pbuffer and all functions correctly, now i'd like to add support for float pbuffer, after a seach on web i've found nothing of interesting, someone knows links where to learn?
To use float pbuffer i've to use special extensions, different from ati to nvidia, or does exist common extensions? and which card does support it?
Thank you

Java Cool Dude
06-01-2005, 07:19 AM
Before calling the chooseFormat routine, add these attributes

if(pBufferFormat & PBUFFER_FORMAT_FLOAT)
{
attributes[i++] = WGL_PIXEL_TYPE_ARB;
if(GLEE_NV_float_buffer)
{
attributes[i++] = WGL_TYPE_RGBA_ARB;
attributes[i++] = WGL_FLOAT_COMPONENTS_NV;
attributes[i++] = GL_TRUE;
}
else
{
if(GLEE_WGL_ATI_pixel_format_float)
attributes[i++] = WGL_TYPE_RGBA_FLOAT_ATI;
else
attributes[i++] = WGL_TYPE_RGBA_ARB;
}
}

capedica
06-06-2005, 04:59 AM
i've tried in this way:
i have an application that use a pbuffer (8 bit for 4 component) to build a texture and use it on a cube. All works fine.
Now i've simply added this line to use float pbuffer and changed color bit to 32:


int attrList[] =
{
WGL_SUPPORT_OPENGL_ARB, true,
WGL_DRAW_TO_PBUFFER_ARB, true,
WGL_RED_BITS_ARB, 32,
WGL_GREEN_BITS_ARB, 32,
WGL_BLUE_BITS_ARB, 32,
WGL_ALPHA_BITS_ARB, 32,
WGL_DEPTH_BITS_ARB, 24,
WGL_DOUBLE_BUFFER_ARB, false,
WGL_PIXEL_TYPE_ARB,WGL_TYPE_RGBA_FLOAT_ATI,
0
};
.......
if(!wglChoosePixelFormatARB(tempCurrenthDC, attrList, NULL, 1,&pixelFormat, &numFormats));
.......
........It gives me not errors but framerate now is under 1 fps, is this correct?
(i have a radeon 9700)

Chuck0
06-06-2005, 08:24 AM
try to disable blending and alpha testing.
seems you ran into a software emulated state configuration.

capedica
06-13-2005, 12:01 AM
Thank you,i've forgotten to disable alpha test and blending, now it's ok...

YengaMatic
06-13-2005, 02:09 AM
Why do you have to disable alpha test and blending?

capedica
06-13-2005, 02:52 AM
if i don't disable alpha testing (blending is not necessary), framerate goes down 1 fps (maybe opengl switch to software mode)...

Humus
06-13-2005, 01:10 PM
Originally posted by YengaMatic:
Why do you have to disable alpha test and blending?The hardware doesn't support blending on floating point textures.