Frostbite PBR:同一纹理的不同纹理通道上的不同压缩

Frostbite PBR: different compression on separate texture channels of the same texture

在 OpenGL4.x:

中的不同通道上,是否有可能,如果可以,如何使用不同的压缩算法创建和读取 RGBA 纹理?

没有实际意义的例子A:

  1. RG 通道存储以 3Dc
  2. 编码的法线贴图
  3. B 通道存储高度值,让我们说一些编码的曲面细分
  4. A 通道存储未压缩的原始 MaterialID

示例 B:

  1. RGB 存储 material 用 DXT1
  2. 压缩的参数
  3. A不压缩保存MaterialID

背景:

在第 15 页和第 18 页 Physically Based Rendering PBR (PDF) 的 Frostbite 实现中,作者描述了他们如何将 material 参数构造到不同的纹理通道中。他们还提到他们在 某些通道 上避免了纹理压缩,但没有详细说明他们指的是哪些通道。

第 15 页

All basic attributes (Normal, BaseColor, Smoothness, MetalMask, Reflectance) need to be blendable to support deferred decals. Unblendable attributes, like MaterialId are stored into the alpha channel. We have also avoided compression and encoding mechanisms which could affect blending quality.

第 18 页

We chose to avoid compression on few of our attributes and rely on simple, linearly-interpolating alpha blending in this case.

没有 OpenGL 或硬件支持在不同通道上读取具有不同压缩的纹理。当然,可以创建一个预通道,将这种手工制作的纹理拆分为单独的纹理,然后分别解压缩。

正如 Nicol Bolas 所建议的,Frostbite PBR 实施避免了由于混合而导致的压缩。