Fallout 4 – The Mushroom Case


So I searched the textures and expecting to find an atlas texture full of explosion frames but I just found this:

It is an atlas texture and it looks wonderful when played – and in addition it’s loop-able!

But there’s no fire at all! I thought something must be missing until I remembered the concept of gradient mapping. More details can be read in this great article and watched in this small example:

So you can colorize the grey smoke texture into something with color by re-mapping colors. Here I defined the black values as orange and what was white before is now black:

Looks great but there are two problems left:

  1. The fire/smoke proportion stay the same but we want to have a lot fire at the beginning and only black smoke at the end
  2. We don’t see any cloud silhouette and if we apply the transparency information of the atlas texture (alpha channel) it looks like this:

I was confused because the alpha channel makes the whole texture mostly 50% transparent but in the game the clouds are almost opaque.

Again the solution seams to be gradient mapping: For cutting out the cloud shape, they do use the alpha channel of atlas texture but re-define its values via gradient mapping and achieve an opaque look:

Fallout stores its gradients in *tadaa* textures. What a surprise. Let’s have a look on it:

What’s that? For a standard gradient mapping you would only need a texture of 1 pixel height so why do they use a quadratic texture?? The reason is, that they sample different pixel-“lines” (from bottom to top) depending on the particles lifetime!
This is genius! It makes it possible to colorize the smoke with a lot fire at the beginning and the longer the particle raises into the air it gets more and more black.

They even changed the cloud shape a bit by modifying the alpha channel over time.

This is so awesome! I love that they have a loop-able animation so that can set the particle lifetime really high without having to bake more pictures into the atlas since the color variation is handled separately.

I think it’s fair to say:

Case closed!

For those who are interested, I’ve prepared some more experiments for a better understanding and to note some observations.

Here I colored the lower and the upper part of the gradient texture in different colors and like expected at some point of the particles lifetime the color jumps:

Here I did the same but with different colors right and left which means that one color overwrites the grey-scale values from 0 to 127 and the other the values from 128 to 255:

This one is a bit weird. I changed the alpha channel of the gradient texture (everything is black except one pixel line at the bottom). I would have expected that the particles disappear very early. But see the result with your own eyes:

The color changes like before (which means the shader reads from the center-position of the diffuse channel where the color change happens) but the particle is still visible! I guess the shader handles the alpha channel in a different and non-linear way and sticks a longer time to the first pixel-line.

In my last example I made the alpha channel hide more and more of the visible texture the longer the cloud “lives”:


Thank you for following me through all these clues and reading this dossier. If you have any feedback feel free to contact me!



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *