Hey guys, check out this problem I found!
Ahh, but that’s not all. I’ve also found this!
AND THIS!
AND THIS.
Every model in the map, if hit enough times, develops a purple square around it.
And this is becoming more noticeable, as maps become increasingly full of models
since more and more surfaces will display this issue if hit enough!
So what’s going on here? Every time you hit the surface, a decal image is added to it. As more and
more of these are added to the same place, they’re all still shown at the same time, which MULTIPLIES
THEIR COLOURS. And this only gets more intense every time another decal is added to that area.
So the black bits of the decal get blacker, the greener bits get greener and so on.
As for the square that forms, this is the full size of the decal image,
because these decal textures are square in shape. Most of this is meant to be transparent,
but it turns out it isn’t entirely transparent- and its imperfections are only exacerbated as
more and more decals are added together. Why do some grey bits turn green? Why do
other grey bits turn red? And why is there a purple square around it?
The answer to all this is COLOUR COMPRESSION. Compression is used all the time with computers.
It’s done a lot online to save on your data. Almost every image we see is compressed to
some extent. Blocky JPEG images are an infamous example of it going a bit too far. Youtube at
144p setting is another. This is all done to reduce filesizes and bandwidth requirements,
which is important on the internet. The colour compression used in Counter-Strike
makes filesizes smaller, which makes the game smaller to download. And then it saves
on VRAM usage, because not all of us are lucky enough to have a graphics card 16 GB of VRAM.
One example of colour compression in CS:GO is DXT. DXT1, for instance, drops the colour accuracy from
8,8,8 bits per colour channel to just 5,6,5. This is done because it neatly
adds up to 16, which is 2 bytes of data. The downside is that, with just 2^5,
it can store just 32 different shades of red and blue, instead of the original 256 variants.
Which will make the colour definition worse. But do you see the OTHER problem here? 5,6,5…
not all colours are created equally! So while it stores red and blue with 5 bits of information,
it saves green with 6, meaning the green in-game is preserved better.
Why is this? I suspect it’s because, before we had videogames, we used to hunt for things
in forests, so our eyes have evolved to get better at detecting shades of green
and that’s why it’s the colour they’ve chosen to preserve better than the others.
But it means that half the possible shades of grey using this colour compression are
NOT grey- they’re slightly too green, or not green enough. Which might be why the
colours get a bit funky when the decals are layered together too many times.
I say MIGHT be, because when you need transparency you need to cram an alpha value into the pixels as
well somehow, so DXT5 might function differently to DXT1. But it still seems to be the case that
green is preserved to a higher quality than the other two colours are. So, here’s my theory on
the purple squares: MAYBE the green is preserved well enough to not show in the transparent parts,
leaving just the red and blue bits behind. Red plus blue equals PURPLE. And hence,
purple squares everywhere. VALVE PLEASE FIX.
One work-around would be to prevent decals from layering on top of each
other, which already happens on stuff like walls and floor. But that makes me sad,
because it means you can’t paint the maps red with the blood of your enemies
without older stains disappearing. So that’s not a viable solution.
The other way to get around this would be to compress the textures less. CS:GO doesn’t have
this console command, but in Half Life 2 if you use mat_compresstextures 0, not only do
you risk crashing your PC, but it removes some of the colour artifacts from the decals. Sure,
there are still problems- you can see it’s still too green and doesn’t fade out smoothly,
since the textures were compressed in the first place. But now they’ve only been compressed ONCE,
instead of twice. Which makes me believe that with correct use of this command,
along with uncompressed decal textures, we could eradicate purple squares once and for all!
In short: decals turn purple because colour compression goes brr.