Recently I found talk about destiny and how they are optimizing their game. Most interesting part is about packing multiple textures (AO and emisive) in to single texture channel. Unfortunatly there is no explanation how they read this value in shader. Have anyone clue how they do it?
There’s lots of ways to pack data into a single channel, but I believe in this case it’s a lot more straightforward. You never want a value to have both emission and AO, so they just map that channel such that if the value is < 0.5, it’s AO. If it’s > 0.5 it’s emission. It’s only ever one or the other.
Ok, thanks. I tried to google solutions how to pack multiple textures to one channel but I did not found any Can you please give me link to some resources to learn from?
The term you want to search for is bit packing. This is most straightforwardly done using bitwise operations, but can also be done with some creative math.