16 bit float vertex buffer object & FBO
Does anybody already has experience with using 16 bit floats for render to vertex buffer via FBO/PBO ?
I found its possible to use GL_HALF_FLOAT_ARB for VBO/PBO and GL_RGBA16F_ARB for the FBO texture, but my framerate dropped quite a lot by doing this - also I just had garbage on the screen, so I suppose the formats might not match..
I think its in general useful to store vertex buffers as 16Bit floats instead of 32 bit ones, since they just contain local object coordinates. For game-characters it should be the best way.
-sven
My config is a GF6600GT, winXP, 81.98 drivers.
I create the FBO texture via
glTexImage2D(
GL_TEXTURE_RECTANGLE_ARB,0,
GL_RGBA16F_ARB,x,y,0,
GL_RGBA,GL_HALF_FLOAT_ARB,0);
set the vertex pointer via
glVertexPointer ( 4, GL_HALF_FLOAT_ARB,0, (char *) 0);
and copy by
glReadPixels(0,0,width,height , GL_RGBA, GL_HALF_FLOAT_ARB, 0);
Before I forgot to use half float for the readpixels,
since I use it its quite fast - however, its not working,
there is nothing on the screen...
is there any mistake ?
It worked fine with a 32 Bit FLOATs so far.
Which drivers are you using ? I got some trouble using FBO/PBO and
32 Bit FLOAT textures and the newest NVidia drivers, so I continued using
the old ones.
-sven
I create the FBO texture via
glTexImage2D(
GL_TEXTURE_RECTANGLE_ARB,0,
GL_RGBA16F_ARB,x,y,0,
GL_RGBA,GL_HALF_FLOAT_ARB,0);
set the vertex pointer via
glVertexPointer ( 4, GL_HALF_FLOAT_ARB,0, (char *) 0);
and copy by
glReadPixels(0,0,width,height , GL_RGBA, GL_HALF_FLOAT_ARB, 0);
Before I forgot to use half float for the readpixels,
since I use it its quite fast - however, its not working,
there is nothing on the screen...
is there any mistake ?
It worked fine with a 32 Bit FLOATs so far.
Which drivers are you using ? I got some trouble using FBO/PBO and
32 Bit FLOAT textures and the newest NVidia drivers, so I continued using
the old ones.
-sven
Ah,ok now its working :-) I made a mistake on another place. But now I found its not worth to change the FBO to 16 bit floats - alltogether its slower than using 32 bit float for me, since I need 2 rendertargets:
one for he vertices and one for the normals. Using 32 bit floats, I can encode the normal in the alpha channel and hence only need one render target.
one for he vertices and one for the normals. Using 32 bit floats, I can encode the normal in the alpha channel and hence only need one render target.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement