Daniel Gray

Thoughts, Notes, Ideas, Projects

Contact

Graphics Gems GLSL Series

The Graphics Gems series (1990-1995) contains timeless algorithms and techniques that remain fundamental to computer graphics today. This series adapts these classic algorithms for modern GLSL shaders, demonstrating how decades-old techniques power contemporary real-time graphics with stunning 3D visualizations.

Series Overview

Each article in this series:

  • Explains the mathematical foundation of a Graphics Gems technique
  • Provides interactive 3D shader examples you can modify in real-time
  • Shows practical applications in modern graphics programming
  • References original sources for deeper study

Articles in This Series

Procedural Generation & Texturing

  1. Perlin Noise (Graphics Gems II) - Gradient-based interpolation over a pseudo-random grid for seamless 2D/3D noise. The ultimate procedural texture generator—spawn clouds, marble, or terrain in a fragment shader; tweak octaves for fractal magic that runs at 60 FPS.

  2. Fast Jitter (Graphics Gems I) - Low-discrepancy sampling patterns for anti-aliasing via pixel offsets. Breathe life into supersampling in a single-pass fragment shader; visualize convergence by layering samples—teaches Monte Carlo basics with silky-smooth edges.

Ray Tracing & Intersection

  1. Ray-Box Intersection (Graphics Gems I) - Slab algorithm for efficient ray-AABB traversal. Raymarching starter pack; trace rays per fragment for simple SDF scenes (spheres in boxes)—evolves into full raytraced globes with minimal code.

Atmospheric Effects & Lighting

  1. Simulating Fog and Haze (Graphics Gems I) - Exponential density decay for depth-based atmospheric scattering. Effortless vertex/fragment combo for misty landscapes; lerp colors by distance—add noise for volumetric god rays, stunning in a single shader pass.

  2. Shadow Attenuation for Transparent Objects (Graphics Gems I) - Beer-Lambert exponential absorption through media. Volumetric lighting hack; attenuate shadows in a fragment shader for jelly or smoke—pairs with raymarching for caustics-lite demos that feel physically grounded.

Post-Processing & Filtering

  1. Filter Kernels (Graphics Gems III) - Separable convolution matrices for blur, sharpen, and edge detection. Post-processing playground; convolve a texture in real-time to demo Gaussian blurs or Sobel filters—stack them for a chain of effects like bloom or toon shading.

  2. Motion Blur on Graphics Workstations (Graphics Gems III) - Accumulation buffering for velocity-based streak rendering. Post-process velocity buffer trick; smear pixels in a fragment shader for whipping trails—hook to a spinning cube for that cinematic whoosh, compute-free.

Precision & Sampling

  1. RealPixels (Graphics Gems II) - Subpixel-accurate looping over image extents for precise sampling. Anti-aliasing without hardware; iterate samples in a fragment shader to render crisp lines or fonts—great for teaching coverage masks in 2D UI effects.

  2. Interval Arithmetic (Graphics Gems III) - Bounding intervals for robust floating-point ops in geometry. Bulletproof math for shaders; wrap trig or intersections to avoid precision artifacts—demo stable spheres or waves that don't jitter on zoom.

Advanced Geometry

  1. Physically Based Superquadrics (Graphics Gems III) - Parametric surfaces with derived inertia for blobby shapes. Vertex shader deformation fun; morph quads into eggs or stars via exponents—animate with time uniforms for squishy, inertia-true rotations.

Why Graphics Gems?

The Graphics Gems books were compiled in the early 1990s when computer graphics was rapidly evolving. The algorithms they contain are:

  • Time-tested: Used in production for decades
  • Efficient: Optimized for the hardware of their era, still fast today
  • Educational: Clear explanations of fundamental concepts
  • Practical: Real algorithms used in actual graphics software

Many techniques from Graphics Gems are now standard in modern graphics programming, appearing in game engines, rendering pipelines, and shader libraries.

Learning Path

For Beginners

Start with Ray-Box Intersection to understand basic ray-object intersection, then move to Perlin Noise for procedural generation.

For Intermediate Learners

Explore Fog and Haze to understand atmospheric effects, then dive into Shadow Attenuation for volumetric lighting.

For Advanced Practitioners

Study Superquadrics for advanced geometry, and combine techniques like Filter Kernels and Motion Blur to create complex visual effects.

Interactive Examples

All articles include interactive 3D shader examples using the <GLSLIDE> component. You can:

  • Modify code in real-time and see results instantly
  • Adjust parameters with interactive controls
  • Experiment with different values and techniques
  • Learn by doing rather than just reading

Preview: Perlin Noise

Volumetric 3D clouds using Perlin noise with multiple octaves:

Preview: Ray-Box Intersection

3D raymarching scene with boxes and spheres demonstrating efficient ray-AABB intersection:

Preview: Fog and Haze

Atmospheric scattering with exponential density decay creating depth-based fog:

References

Graphics Gems Books

Online Resources

Related Series

Related Content

Graphics Gems GLSL - Perlin Noise

Graphics Gems GLSL - Perlin Noise Perlin Noise, introduced by Ken Perlin in 1985 and featured in Graphics Gems II, revolutionized procedural texture generation. This gradient-based interpolation techn...

Graphics Gems GLSL - Ray-Box Intersection

Graphics Gems GLSL - Ray-Box Intersection The Ray-Box Intersection algorithm from Graphics Gems I provides an efficient method for determining if and where a ray intersects an Axis-Aligned Bounding Bo...

Graphics Gems GLSL - Simulating Fog and Haze

Graphics Gems GLSL - Simulating Fog and Haze Atmospheric effects like fog and haze are essential for creating depth, mood, and realism in 3D scenes. The technique from Graphics Gems I uses exponential...

Fractals and Mathematical GLSL

Fractals and Mathematical GLSL

Fractals and Mathematical GLSL GLSL shaders provide a unique intersection of mathematics and visual art. By executing mathematical functions in parallel across thousands of GPU cores, we can visualize...

GLSL Toybox

GLSL Toybox A ShaderToy-like playground for experimenting with GLSL shaders. Write your shader code and see it render in real-time! Perfect for exploring fractals, mathematical visualizations, and 3D ...