31 March 2026
I’ve been messing around with Burley’s “On Histogram-Preserving Blending for Randomized Texture Tiling” (link) for a couple days. The core idea is to pre-process images into a “Gaussianized” form where the histogram of the image’s colors follows a Gaussian distribution. Once in Gaussian form, there is a closed-form way to blend multiple samples with barycentric weights such that the Gaussian’s variance is preserved (Equation 2 in the paper). Finally, you can run the blended colors through a lookup table (LUT) to get a result in the original image’s color space. The results are outstanding. (These ideas build on those laid out by Heitz and Neyret in an earlier paper. I will reference Heitz a few times.)
It was love at first sight - you can use this to seamlessly tile large areas with textures that themselves don’t even need to be seamless. However, the method uses 4 taps per pixel (3 overlapping hexagons per pixel, plus 1 3D lookup table tap).
I’ve been thinking about terrains for a week or two, since I need to make a large-scale environment for a project. I really like the idea of using tri-planar projection for grass, stone etc., but I’ve never been satisfied with the quality I get from it. It always creates this awful loss of contrast between layers and creates weird ghosting artifacts.
Wait a minute, isn’t that kind of what Heitz’s technique addresses?
It turns out that yeah, you can use the exact same machinery described by Heitz and Burley to perform histogram-preserving tri-planar projection. You just use standard tri-planar projection to get barycentric coordinates instead of playing with a UV-space triangle grid. Results are shown below.
I also noticed that the gamma term described in Burley’s Equation 5 can significantly reduce contrast. At low values, where ghosting is more visible, contrast is better preserved; at high values, it’s more diminished.
Perhaps blending in YCbCr would ameliorate the loss in contrast, but I haven’t tried that yet.
The astute reader might find that just increasing contrast after the blend would produce a similar result, and I’m inclined to agree. The only possible advantage that this method has is that it doesn’t demand fine-tuning.