████████ ███████ ██ ██ ████████ ██ ██ ██████ ███████

██ ██ ██ ██ ██ ██ ██ ██ ██ ██

██ █████ ███ ██ ██ ██ ██████ █████

██ ██ ██ ██ ██ ██ ██ ██ ██ ██

██ ███████ ██ ██ ██ ██████ ██ ██ ███████

██████ ███████ ███ ██

██ ██ ████ ██

██ ███ █████ ██ ██ ██

██ ██ ██ ██ ██ ██

██████ ███████ ██ ████

Original Texture
Original texture 1
Generated Image
Generated image 1

This project implements a stochastic texture generator that can tile a given texture sample across arbitrarily large 3D surfaces without any visible repetition patterns. The implementation is based on the research paper "Procedural Stochastic Textures by Tiling and Blending" by Thomas Deliot and Eric Heitz, which introduces techniques for generating seamless, non-repetitive textures through histogram-preserving blending and stochastic tiling.

 

The core challenge addressed by this project is the problem of texture repetition artifacts that occur when tiling a small texture sample across large surfaces. Traditional tiling methods create visible seams and repeating patterns that break immersion in 3D environments. The stochastic texturing approach solves this by using histogram-preserving blending operations that maintain the statistical properties of the original texture while creating seamless transitions between tiles.

 

The implementation involves analyzing the input texture sample, generating multiple tile variations, and applying blending techniques that preserve the histogram distribution of pixel values. This ensures that the synthesized texture maintains the visual characteristics of the original sample while eliminating repetition artifacts. The algorithm can generate textures of arbitrary size, making it particularly useful for texturing large 3D models and environments in computer graphics applications.

 

This implementation is written in Python, providing a clear and accessible codebase for understanding the algorithm. However, the original reference implementation by the authors is in C++, which offers approximately 70 times better performance. This performance advantage makes C++ implementations significantly more suitable for real-time texture generation in production graphics applications, where computational efficiency is critical.

 

There are several areas where this implementation could be improved. Currently, each color channel (RGB) is processed independently during the histogram-preserving blending operations. While this approach simplifies the implementation, it breaks the correlations between color channels that exist in the original texture sample. This can result in subtle color artifacts in the final generated texture. A more sophisticated approach would process the color channels jointly, preserving these inter-channel correlations.

 

Additionally, working with compressed texture formats (such as DXT/BC formats commonly used in game engines) introduces additional challenges. These formats use block-based compression schemes that can interfere with the histogram-preserving blending operations, potentially introducing visual artifacts or requiring specialized handling to maintain quality. The original paper discusses modifications to the algorithm to accommodate these compressed formats, which would be a valuable extension to this implementation.

 

This project demonstrates my interest in advanced computer graphics techniques and my ability to implement research papers into practical applications. The work required understanding complex mathematical concepts related to texture synthesis, histogram preservation, and stochastic sampling methods.

 

→ Check the repo here.

 

Reference: Deliot, T., & Heitz, E. Procedural Stochastic Textures by Tiling and Blending. GPU Zen 2. Link to paper.