GLSL 3D Fractals - 3D IFS Fractals
Iterated Function Systems (IFS) are a powerful method for generating fractals using affine transformations. In 3D, IFS fractals can create stunning organic and geometric forms, from ferns and trees to complex geometric structures. The technique applies a set of transformations iteratively, with each transformation having a probability of being applied.
Interactive Demo
Move your mouse to rotate the camera and explore the IFS fractal. Scroll to adjust parameters and see how the structure evolves:
Mathematical Foundation
Affine Transformations
An affine transformation in 3D combines:
- Rotation:
- Scaling:
- Translation:
The transformation is:
IFS Definition
An IFS consists of transformations , each with:
- A transformation matrix
- A translation vector
- A probability (for random IFS)
Deterministic IFS
In deterministic IFS, all transformations are applied:
The fractal is the union of all transformed copies.
Random IFS
In random IFS, transformations are chosen probabilistically:
Distance Estimation
For IFS fractals, we can estimate distance by finding the minimum distance to any transformed copy:
Where is the scale factor of transformation .
Classic IFS Examples
Sierpinski Triangle (2D → 3D)
The 3D Sierpinski triangle uses three transformations:
Barnsley Fern (3D Extension)
The famous Barnsley fern can be extended to 3D:
3D Spiral IFS
A 3D spiral IFS creates organic, twisting forms:
Where and are rotation matrices, and is a scaling matrix.
Implementation Details
The GLSL implementation uses:
- Ray marching with distance estimation
- Iterative transformation application
- Minimum distance calculation across all transformations
- Normal calculation using finite differences
Key Parameters
Transformation Count
The number of transformations affects:
- Complexity: More transformations = more detail
- Performance: More transformations = slower rendering
- Shape: Different transformations create different forms
Scale Factors
Scale factors control:
- Self-similarity: Smaller scales = more detail
- Convergence: Scales < 1.0 ensure convergence
- Structure: Different scales create different patterns
Probabilities (Random IFS)
In random IFS, probabilities control:
- Density: Higher probability = more points
- Shape: Different probabilities emphasize different regions
- Organic appearance: Non-uniform probabilities create natural forms
Visual Characteristics
3D IFS fractals exhibit:
- Organic beauty: Natural, plant-like structures
- Geometric precision: Mathematical perfection
- Infinite detail: Self-similar at all scales
- Variety: Can create vastly different forms
References
- "Fractals Everywhere" by Michael Barnsley
- "The Algorithmic Beauty of Plants" by Prusinkiewicz and Lindenmayer
- IFS Fractals
Related Articles
- Sierpinski Tetrahedron - Geometric IFS fractal
- Distance Estimation Methods - Techniques for efficient rendering
- GLSL 3D Fractals Series