Does your game need blue flowers?
Blue is the rarest color in nature. In fact many animals like butterflies have to fake the color blue with pretty neat tricks!
What if I told you that this fact can save you half the memory on your vegetation imposters?
Look at this tree below. It's a nice tree. Nothing wrong with it.
But see the blue channel? It barely covers half the dynamic range!
This means that one whole bit of the blue channel is pretty much taking a nap.
This means that one whole bit of the blue channel is pretty much taking a nap.
There's nothing wrong with taking a nap, it's a great activity.
But what if that bit is getting bored doing nothing?
Well, we can give it some info to hold onto for us: the alpha mask.
How? It's almost like a little receipe, here it is:
First, you halve the blue channel, because the top bit might still be used a little, and all data is precious and deserves love and safe keeping.
This clears the top bit for sure.
adendum: in this particular case we could almost keep the values as they are and use the top bit which is already empty, but that's not always the case, the blue channel is often of a lower dynamic range, but not always of a low value. There might be a better way to keep maximum information here with only 7 bits.
Then, you add back the alpha mask as a 128 value, which stores it safely in the top bit.
Stir and export, let it cool off before importing.
After importing, reassemble carefully your channels.
If you're a pro like me, you really don't feel like doing the math to account for gamma correction, and so you fix it with a little fantasy in the numbers.
Et voila, your tree is ready!
Sure, it's not perfect, but it's half the size! Can you tell which tree uses our technique and which one is mega boring?
Note: no tree is boring, all trees are awesome.
So, I ask again:
Does your game need blue flowers?