4

What is the block size of a GL_COMPRESSED_RGB8_ETC2 and GL_COMPRESSED_RGBA8_ETC2_EAC texture ?

I was using ((w+3)/4)*((h+3)/4)* 8 for GL_ETC1_RGB8_OES, but can't find anything about ETC2 (the Khronos documentation is not very clear about it).

Bartek Banachewicz
  • 38,596
  • 7
  • 91
  • 135
execomrt
  • 171
  • 2
  • 6
  • Did you take a look at the framework from http://humus.name/ ? He might have it in his source code ( Framework 3, maybe 2 ). – Felix K. Jul 28 '13 at 10:56

4 Answers4

3
    // ETC1
    { 4, 4, 8, COMPRESSED_ETC1_RGB8_OES },

    // ETC2 / EAC
    { 4, 4,  8, COMPRESSED_R11_EAC },
    { 4, 4,  8, COMPRESSED_SIGNED_R11_EAC },
    { 4, 4, 16, COMPRESSED_RG11_EAC },
    { 4, 4, 16, COMPRESSED_SIGNED_RG11_EAC },
    { 4, 4,  8, COMPRESSED_RGB_ETC2 },
    { 4, 4,  8, COMPRESSED_SRGB8_ETC2 },
    { 4, 4,  8, COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 },
    { 4, 4,  8, COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 },
    { 4, 4, 16, COMPRESSED_RGBA8_ETC2_EAC },
    { 4, 4, 16, COMPRESSED_SRGB8_ALPHA8_ETC2_EAC },

First two values are block size (eg. 4x4) the third value is BytesPerBlock. The fourth value is compression mode. This is from a table I use for handling all compressed formats that exist.

I removed values which are not useful for this answer (compression and decompression function pointers and preferred pixel formats for source/destination data, sRGB, etc).

t0rakka
  • 904
  • 9
  • 10
1

The OpenGL ES 3.0 specification includes the statement: A texture compressed using any of the ETC texture image formats is described as a number of 4 x 4 pixel blocks in Section C.1 ETC Compressed Texture Image Formats.

Frogblast
  • 1,671
  • 10
  • 9
1

FWIW ETC2 extends ETC1 by making use of some, otherwise unused, bit patterns as described by Strom et al in "Texture Compression using Invalid Combinations". (See also the Graphics Hardware Slides Presentation):

The block sizes are therefore the same.

Simon F
  • 1,036
  • 8
  • 23
1

The block sizes are documented here: http://www.khronos.org/opengles/sdk/docs/man3/html/glCompressedTexImage2D.xhtml

In particular:

  • GL_COMPRESSED_RGB8_ETC2 = ceil(width/4) * ceil(height/4) * 8
  • GL_COMPRESSED_RGBA8_ETC2_EAC = ceil(width/4) * ceil(height/4) * 16
eodabash
  • 959
  • 2
  • 8
  • 24