3
\$\begingroup\$

In the talk "Between Tech and Art: the Vegetation of Horizon Zero Dawn", Gilbert Sanders says "we average out the color of our albedo textures to mid gray value".

But the final albedo is an RGB-tuple, not just a single gray:

Slide from talk linked above, showing grayish leaves with blue veins

In my opinion, the simplest way to colorize a base color is to make a grayscale (luminance) texture, then multiply by the desired color. But the side effect of that is all the pixels have a similar tone. For leaves, we want the veins to have a different tone.

The Horizon method seems to solve the problem.

Can anyone explain how to generate these albedo maps and recover the base color with the formula from this presentation?

\$\endgroup\$

1 Answer 1

4
\$\begingroup\$

You can reverse the formula, assuming you want the "result" after colourization to look like your original texture:

OriginalTexture = GreyishTexture * (2 * Colorize * Mask + 1 - Mask)

GreyishTexture = OriginalTexture / (2 * Colorize * Mask + 1 - Mask)

You can choose Colorize as the average green colour of your leaf. Then, as promised, any pixels of exactly that average colour get remapped by the formula above to (0.5, 0.5, 0.5), a medium grey.

All the other pixels in your texture get remapped to their relative value in proportion to this average: so bluer areas turn to a more bluish grey, darker areas become a darker grey, etc.

When you re-colourize this by running the "forwards" version of the formula with the same average colour as the Colorize parameter, you recover the original texture (with some loss from quantization/compression). But you can also use different colours for Colorize to get a new output with a different average colour, that still varies in colour in the same proportions.

Here's a quick mock-up, using a leaf texture by phaelax, shared on OpenGameArt:

Decoloured, original, and re-coloured leaves

  • The left image is the "grey" version, obtained by dividing the original texture colour by double the average colour, which I eyeballed to be around #8DC45B.

    I added a grey stripe in the background so you can visually verify that this puts most of the texture close to a medium grey.

  • The middle image is the original green leaf, reconstructed by multiplying the "grey" version by twice #8DC45B.

  • The right image is the "grey" version multiplied by twice a different base colour, #BCA94F. You can see we've shifted the average colour to look more autumn, but the proportional variation in the veins and folds is preserved.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .