Author Topic: Encoding Texture Information to single channel  (Read 21737 times)

Hi all,

I recently saw a very interesting paper about some of the texture optimization done on Destiny 2.
They used textures to store data at specific values in an single channel which could be later extracted with some material maths.

My desired outcome would be, for example to store both metallic and AO to a single channel, where the metallic value uses values 0-40, and AO using values 41-255.

I am curious if there is any procedure for achieving this?

Could you link the paper? I'm also quite curios about this :)

The way I've seen this done before is by segmenting 16-bit grayscale values into 256 'groups' of 256 values where the given group denotes roughness and the exact value in that group denotes ao.
You can also look at this as segmenting bits, where the first 8 bits are used for roughness and the other 8 for ao.

But either way you need precision down to a single bit (at least for the top and bottom values of the segmented groups). Substance designer has many optimizations in place which can mess with this precision, and on top of that you would ideally need a way to compress and decode these textures with this kind of segmentation in mind. So it's really more of a cs problem than a texturing problem.

interesting stuff, would like to read that paper as well

what engine are you targeting?
Last Edit: October 26, 2019, 07:15:11 pm

Here's the paper:
Its a really great read all round, but the texturing stuff happens from page 110.

I am fairly new to using the pixel processor, if you could explain the process of segmenting the 256 groups that would be awesome.

I use UE4, trying to reduce the amount of textures I need as much as possible. What is clever about the article is simply having two mask on a channel that don't overlap, such as metallic, Alpha mask and emissive. Im probably just being greedy wanting to put more masks in fewer channels. But over all I have already stopped using a separate pack mask texture by using the 2 spare channels of the normal

Last Edit: October 27, 2019, 01:46:13 am

Well, because of the inaccuracies this segmentation method probably wouldn't work inside designer (Though I will give it a go when I find the time). A single value off could change something from black to white for instance. It would likely have to be implemented engine-side or in the form of some image compression algorithm.

Thinking about it, these algortihms already exist to some extent. S3 txture compression for instance compresses RGB into a single 16-bit channel.

The method in the paper is a bit different though. It's not sensitive to small errors, but it only allows you to combine mutually-exclusive maps. So, any 1 pixel is only used for 1 map. You need roughness and ao information in the same places, so it would not work for this, or most other maps.

It definitely seemed like the sort of wizardry that could only be done through external means, though always worth a shot to know for sure.

Thanks for clarifying that for me, and keep me posted if you have any success testing it in designer.