- January 15, 2012 at 8:10 pm #30736
I want to know if someone can share performance comments on different render to texture formats.
For my case lets take these two
(1) glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, irw.width, irw.height, 0, GL_RGB, GL_UNSIGNED_BYTE, 0);
(2) glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE_ALPHA, irw.width, irw.height, 0, GL_LUMINANCE_ALPHA, GL_HALF_FLOAT_OES, 0);
Both write to a 32 bit texture, with the exception that (2) writes as a half float of two components but will save packing instructions in my shader code when compared to (1). Am I first of all right about this operations and if so which one is better ?
MadanMarch 13, 2012 at 9:30 am #35384
can someone please help me with this regard??
Also, is it possible to write to a 64 bit texture ? what is the performance implicaton for doing that ? How slow is it compared to using a 32 bit texture ? Is there some sample you can provide for such 64 bit texture/rendertarget usage ?mkandula2012-03-13 09:36:56March 13, 2012 at 11:13 am #35385
you’ll have to use GL_RGBA instead of GL_RGB if you want to have a 32bit renderable surface in (1).
In general you can’t render to GL_LUMINANCE_ALPHA, only colour components are renderable. Please see the OpenGL ES 2 specification, p.114:
[…] Color-renderable formats contain
red, green, blue, and possibly alpha components; depth-renderable formats contain
depth components; and stencil-renderable formats contain stencil components. […]
There is one extension that allows you to write to half-float buffers, which is called EXT_color_buffer_half_float. Please check if the extension is available on your platform by querying the OpenGL extension string.
From a performance point of view every extra component uses additional bandwith when the tile is written to the framebuffer.
Hope that this helps,