Module texture

Module texture 

Source
Expand description

Texture synthesis module (Layer 2: The Flesh)

This module implements deterministic texture synthesis using PPF-based noise generation. Instead of storing high-entropy texture pixels, we store compact region descriptors and synthesize the texture on-the-fly during decoding.

§The Cheat

Standard codecs spend huge amounts of bits encoding “noise” (pores on skin, grain in asphalt, leaves on trees). We don’t store the pixels - we store a synthesizer config and generate the texture deterministically.

§Data Structure

A Region stores compact texture synthesis parameters instead of raw pixels:

  • Position and size (x, y, w, h)
  • Deterministic noise seed
  • Chaos level (number of octaves 1-8)
  • Scale (base frequency log₂)
  • Persistence (amplitude decay 0-255 → 0.0-1.0)
  • Noise type (fBm, turbulence, ridged, etc.)
  • Base color (RGB)
  • Amplitude (noise amplitude 0-255)

Structs§

Region
Texture region descriptor
TextureAnalyzer
Texture analyzer for finding optimal synthesis parameters
TextureSynthesizer
Texture synthesizer

Enums§

NoiseType
Type of noise function to use