I render a scene to my viewport and create a rectangular texture. I want to render the viewport to that rectangular texture which works just fine if i define the texture's format to be rgba, however, if the format is rgba32f_ so a 32bit floating point texture the rendering speed drops amazingly.

can someone tell me please what i did wrong or how to do it better (with respect to glCopyTexImage)

Just use RGB and not RGBA. There's absolutely no need for the alpha channel that consumes memory but is not used at all.

Hope that helps.

powerpad

07-07-2005, 04:53 AM

it still runs slow (if one could call that running)

carl_lewis

07-07-2005, 05:29 AM

try using glCopyTexSubImage(...);
it's much much quicker!

the RGBA32 format uses 32 bits per channel, so that's 4x the memory access of a standard RGBA format. it should take longer.

Jan

07-07-2005, 07:07 AM

Is your framebuffer RGBA8 or RGBA32 ?

powerpad

07-07-2005, 11:42 AM

I setup the framebuffer with the normal pixel format like PFD_TYPE_RGBA (I hope that this is what you mean) or so ... should I use something different?

Omaha

07-07-2005, 12:22 PM

I think they are referring to the format and internal_format parameters of all of the glTex*Image* calls.

powerpad

07-07-2005, 12:59 PM

well the glcopyteximage() call is visible in my first post

Overmind

07-07-2005, 02:03 PM

No. The question was what pixel format does your framebuffer have?

Because if the framebuffer has RGB(A)8 fixed point format, the glCopyTex(Sub)Image call with internal format RGBA32F has to do a format conversion (in the worst case this has to be done on the CPU), while with internal format RGBA8 it can simply copy the data...

powerpad

07-08-2005, 01:56 AM

How I can I set this up or query for the framebuffer format?

Jan

07-08-2005, 02:22 AM

The question is: Why do you want to copy RGBA8 data from your framebuffer into a RGBA32 texture? You don't gain anything from that.

However, if you want to render 32 Bit data to your texture, you should check out the "Framebuffer Object" (FBO) extension.

Jan.

powerpad

07-08-2005, 07:37 AM

I want to implement some algorithm that is described in a paper. Therein geometry is processed by a pair of shaders (that forwards the x,y,z coordinate of a vertex to the fragment shader - the fragment shader writes x,y,z to r,g,b color values - this I figured I need a floating point texture).