什么是ETC2压缩纹理的块大小?
问题描述:
GL_COMPRESSED_RGB8_ETC2
和GL_COMPRESSED_RGBA8_ETC2_EAC
纹理的块大小是多少?什么是ETC2压缩纹理的块大小?
我使用((w+3)/4)*((h+3)/4)* 8
作为GL_ETC1_RGB8_OES
,但找不到任何有关ETC2的信息(Khronos文档对此不太清楚)。
答
OpenGL ES 3.0规范包含C.1 ETC Compressed Texture Image Formats
中的声明A texture compressed using any of the ETC texture image formats is described as a number of 4 x 4 pixel blocks
。
答
FWIW ETC2通过使用Strom等人在“Texture Compression using Invalid Combinations”中描述的一些未使用的位模式来扩展ETC1。 (另见图形硬件Slides Presentation):
因此块大小是相同的。
答
块大小是记录在这里:http://www.khronos.org/opengles/sdk/docs/man3/html/glCompressedTexImage2D.xhtml
特别是:
- GL_COMPRESSED_RGB8_ETC2 =小区(宽度/ 4)*小区(高度/ 4)* 8
- GL_COMPRESSED_RGBA8_ETC2_EAC =小区(宽度/ 4)*小区(高度/ 4)* 16
答
// 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 },
首先两个值是块大小(例如, 4x4)第三个值是BytesPerBlock。第四个值是压缩模式。这来自我用来处理存在的所有压缩格式的表格。
我删除了对此答案无用的值(压缩和解压缩函数指针以及源/目标数据的首选像素格式,sRGB等)。
你看看http://humus.name/的框架吗?他可能会在他的源代码中(框架3,也许是2)。 –