简体   繁体   English

OpenGL ARGB与RGB和纹理压缩

[英]OpenGL ARGB vs RGB and Texture Compression

I have a rendering context with a color depth of 32-bits. 我有一个颜色深度为32位的渲染上下文。 I will be using some alpha blending, but not much; 我将使用一些Alpha混合,但不多。 so using 24-bit images for most of the textures I need will greatly reduce the memory requirements. 因此对于我需要的大多数纹理使用24位图像将大大减少内存需求。 My question is, can I use 24-bit RGB textures with a 32-bit rendering context and expect the same performance as a 32-bit ARGB texture? 我的问题是,我可以将32位RGB纹理与32位渲染上下文一起使用,并期望与32位ARGB纹理具有相同的性能吗? I understand that the internal format is probably neither to begin with, but the target format of the RC is 32-bit ARGB. 我知道内部格式可能不是一开始的,但是RC的目标格式是32位ARGB。

Also, I am planning on using some form of texture compression. 另外,我计划使用某种形式的纹理压缩。 The platform will be Windows, exclusively. 该平台将仅是Windows。 Which would provide the best compression and widest-compatibility? 哪个将提供最佳的压缩和最广泛的兼容性? I am also hoping to use 24-bit compressed textures since I won't be using the alpha bits; 我也希望使用24位压缩纹理,因为我不会使用alpha位。 but the rendering context will remain 32-bits. 但呈现上下文将保持32位。

It looks like DXT5 should work for you. 看起来DXT5应该适合您。

Here are the details for GL_EXT_texture_compression_s3tc 以下是GL_EXT_texture_compression_s3tc的详细信息

There is no problem at all using any texture format as input textures when rendering to a 32bit render context. 渲染到32位渲染上下文时,使用任何纹理格式作为输入纹理完全没有问题。 The texture formats are either supported by the platform or not, that's about it, if it's supported you can use it without consideration of the format of the render context. 平台是否支持纹理格式,仅此而已,如果受支持,则可以使用它而无需考虑渲染上下文的格式。

To compress your 24 bits textures, you could take a look at DXT1 texture compression that is supported on all OpenGL implementations on Windows PC. 要压缩24位纹理,您可以看一下Windows PC上所有OpenGL实现所支持的DXT1纹理压缩 Note that depending on your content, and the compression quality you want to obtain, there are 'tricks' allowing to improve image quality using DXT compressions, alternative color spaces, and shader code for decoding, here is an example . 请注意,根据您的内容和想要获得的压缩质量,有些“技巧”可以使用DXT压缩,替代颜色空间和用于着色的着色器代码来提高图像质量, 这是一个示例

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM