5

Is it possible, and if yes how would it be possible, to create and read a RGBA Texture with different compression algorithms on separate channels in OpenGL4.x:

Example A without real meaning:

  1. RG channels stores a normal map encoded in 3Dc
  2. B channel stores height values for lets say tesselation with some encoding
  3. A channel stores raw MaterialID without compression

Example B:

  1. RGB stores material parameters compressed with DXT1
  2. A saves MaterialID without compression

Background:

In the Frostbite implementation of Physically Based Rendering PBR (PDF) on page 15 and 18, the authors are describing how they structured material parameters into different texture channels. They also mention that they avoided texture compression on some channels not going into detail which channels they mean by that.

Page 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.

Page 18

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

Nicol Bolas
  • 449,505
  • 63
  • 781
  • 982
James Takarashy
  • 299
  • 2
  • 14
  • You are misinterpreting what they're saying. Those quotes are not talking about how they compress some channels and not others. They're saying they pretty much don't compress anything that goes to a deferred buffer, unless the compression doesn't allow blending. – Nicol Bolas Sep 20 '16 at 12:25
  • @Nicol Bolas This is what I was thinking since I avoided compression myself because of the same reason, and then got uncertain reading the Frostbite document. Thanks! – James Takarashy Sep 20 '16 at 15:09

1 Answers1

1

There is no OpenGL or Hardware support for reading in a texture with different compression on different channels. Of course, one could create a prepass which would split such a handcrafted texture into separate textures and then decompress these separately.

As Nicol Bolas suggested, the Frostbite PBR implementation avoids compression due to blending.

James Takarashy
  • 299
  • 2
  • 14