The Curious Engineer

All blogs / Graphics

The blog at the bottom of the sea

blog.demofox.org

Most Recent Posts:2026-10-15 Binary Serialization in df_game_data2026-10-07 Why The AI Determinism Argument Annoys Me2026-10-03 The Double Headed Stack Allocator2026-07-01 What To Learn To Be A Real Time Graphics Programmer2026-05-19 My Professional Motivations, Qualifications, and Role Preferences2

GraphicsMathC++Game development

Posts
275 from 4 May 2012 to 24 Oct 2026
Posting
monthly (6 in the last year)
Kind
personal blog
Feed
https://blog.demofox.org/feed/

2026 6

  1. Why The Concept of Data Poisoning Annoys Me
  2. Binary Serialization in df_game_data
  3. Why The AI Determinism Argument Annoys Me
  4. The Double Headed Stack Allocator
  5. What To Learn To Be A Real Time Graphics Programmer
  6. My Professional Motivations, Qualifications, and Role Preferences

2025 7

  1. Using Information Entropy To Make Choices / Choose Experiments
  2. Derivatives, Gradients, Jacobians and Hessians – Oh My!
  3. Toroidally Progressive Stratified Sampling in 1D
  4. Thresholding Modern Blue Noise Textures
  5. Considering Democrats Blameless is a Medically Useless Diagnosis for the USA
  6. Simulating Dice Rolls With Coin Flips
  7. Dice, (De)Convolution and Generating Functions

2024 6

  1. Scaling Points In a Specific Direction
  2. A Two Dimensional Low Discrepancy Shuffle Iterator (+Random Access & Inversion)
  3. Summing Blue Noise Octaves Like Perlin Noise
  4. A Low Discrepancy Shuffle Iterator (+Random Access & Inversion)
  5. What I wish I knew about ESPP and RSUs sooner (company stock benefits. 2024, USA, California)
  6. Gradient Descent With Adam in Plain C++

2023 18

  1. Making Blue Noise Point Sets With Sliced Optimal Transport
  2. Deriving the Inverse CDF of a Rotated Square Projected onto a Line
  3. Interpolating Color Image Histograms Using Sliced Optimal Transport
  4. How To Make Your Own Spooky Magic Eye Pictures (Autostereograms)
  5. When There Are Too Many Experiments (Tests) To Do! Part 2: Orthogonal Arrays
  6. Fractional Factorial Experiment Design: When There Are Too Many Experiments To Do
  7. Alan Wolfe (Atrix256/Demofox) Banned (?) From X (Twitter)
  8. Generating Hamiltonian Cycles on Graphs with Prime Numbers of Nodes, Without Repeating Edges
  9. Sparse Pairwise Voting or Tournaments (Implementing SoME3 Voting)
  10. Permutation Iteration and Random Access
  11. Inverting Gauss’ Formula
  12. Random Sampling Experiments: Avoid The Sides!
  13. Euler’s Best Candidate – For Generating Blue Noise Sample Points, and More
  14. Euler’s Number & Probability
  15. Uniform 1D Red Noise & Blue Noise Part 2
  16. Uniform 1D Red Noise & Blue Noise
  17. Fibonacci Word Sampling: A Sorted Golden Ratio Low Discrepancy Sequence
  18. Generalizing Binary Search To Higher Dimensions

2022 16

  1. Rapidly Solving Sudoku, N-Queens, Pentomino Placement, and More, With Knuth’s Algorithm X and Dancing Links.
  2. Calculating Discrete Sums With Umbral Calculus
  3. Calculating the Similarity of Histograms or PDFs & Interpolating Them Using the p-Wasserstein Distance
  4. Rounding Modes For Integer Division
  5. Calculating SVD and PCA in C++
  6. Programming PCA From Scratch In C++
  7. Piecewise Least Squares Curve Fitting
  8. Fitting Data Points With Weighted Least Squares
  9. Sampling Importance Resampling
  10. Picking Fairly From a List of Unknown Size With Reservoir Sampling
  11. Image Sharpening Convolution Kernels
  12. The Discrete Cosine Transform, and Derivatives
  13. Adjusting Point Sets in Frequency Space Using a Differentiable Fourier Transform
  14. Two Low Discrepancy Grids: Plus Shaped Sampling LDG, and R2 LDG
  15. Distance Between Points on a “Toroidal Disk”
  16. Interleaved Gradient Noise: A Different Kind of Low Discrepancy Sequence

2021 7

  1. Why Can’t You Design Noise in Frequency Space?
  2. Not All Blue Noise is Created Equal Part 2
  3. Inverting a Button Press (Featuring Current Dividers)
  4. Resistance and Voltage Dividers
  5. Voltage, Amps, Resistance and LEDs (Ohm’s Law)
  6. Perlin Noise Experiments
  7. Mean Squared Error is Variance

2020 21

  1. Multiple Importance Sampling in 1D
  2. Frequency Domain Image Compression and Filtering
  3. When Life Gives You Lemons, Make Random Numbers
  4. Irrational Numbers
  5. Using Low Discrepancy Sequences With Rejection Sampling
  6. Interpolating Data Over Arbitrary Shapes With Laplace’s Equation and Walk on Spheres
  7. Weighted Round Robin (Weighted Random Integers) Using The Golden Ratio Low Discrepancy Sequence
  8. Casual Shadertoy Path Tracing 3: Fresnel, Rough Refraction & Absorption, Orbit Camera
  9. Casual Shadertoy Path Tracing 2: Image Improvement and Glossy Reflections
  10. A Link Between Russian Roulette and Rejection Sampling / Importance Sampling
  11. Casual Shadertoy Path Tracing 1: Basic Camera, Diffuse, Emissive
  12. Using Blue Noise For Raytraced Soft Shadows
  13. Ray Marching Fog With Blue Noise
  14. Guess a Number Between 1 and 10
  15. Basic Methods For Finding Zeroes and Mins / Maxes of Functions
  16. Using White Noise to Choose Between Red Noise and Blue Noise
  17. How Do I Calculate Variance in 1 Pass?
  18. Using Low Discrepancy Sequences & Blue Noise in Loot Drop Tables for Games
  19. A Fun 2d Rotation Matrix Derivation
  20. IIR Audio & Data Filters – Featuring Biquads
  21. FIR Audio & Data Filters

2019 10

  1. Bezier Triangles
  2. Calculating Information Entropy
  3. Bayes’ Theorem Intuition
  4. Measuring Debug STL Container Perf Cost in MSVC
  5. Dice, Distributions & Noise Colors
  6. Generating Blue Noise Textures With Void And Cluster
  7. Taking the Max of Uniform Random Numbers
  8. Generating Random Numbers From a Specific Distribution With The Metropolis Algorithm (MCMC)
  9. Markov Chain Text Generation
  10. Linear Fit Search

2018 16

  1. Posts TODO
  2. How To: Data Lookups Via Raytracing
  3. Not All Blue Noise is Created Equal
  4. Tiled Blue Noise
  5. Blending an HDR color into a U8 Buffer
  6. Pathtraced Depth of Field & Bokeh
  7. Monte Carlo Integration Explanation in 1D
  8. Test
  9. A Neat Trick For Compressing Networked State Data
  10. Taking a Stroll Between The Pixels
  11. Prefix Sums and Summed Area Tables
  12. An Idea: Raytracing Lookup Tables
  13. A Very Quick DirectX Raytracing API Primer
  14. Don’t Convert sRGB U8 to Linear U8!
  15. Granular Audio Synthesis
  16. What the Heck is Blue Noise?

2017 30

  1. C++ Differentiable Programming: Searching For An Optimal Dither Pattern
  2. Dissecting “Tiny Clouds”
  3. Demystifying Floating Point Precision
  4. My Old Master: On Optimism
  5. Animating Noise For Integration Over Time 2: Uniform Over Time
  6. Animating Noise For Integration Over Time
  7. Transmuting White Noise To Blue, Red, Green, Purple
  8. Generating Blue Noise Sample Points With Mitchell’s Best Candidate Algorithm
  9. Calculating the Distance Between Points in “Wrap Around” (Toroidal) Space
  10. Half Tile Offset Streaming World Grids
  11. Generating Random Numbers From a Specific Distribution With Rejection Sampling
  12. Generating Random Numbers From a Specific Distribution By Inverting the CDF
  13. Counting Bits & The Normal Distribution
  14. WebGL PBR Implementation
  15. A Tool To Debug Teams (Knoster)
  16. Why Are Some Shadows Soft And Other Shadows Hard?
  17. SIMD / GPU Friendly Branchless Binary Search
  18. When Random Numbers Are Too Random: Low Discrepancy Sequences
  19. Improved Storage Space Efficiency of GPU Texture Sampler Bezier Curve Evaluation
  20. Solving N equations and N unknowns: The Fine Print (Gauss Jordan Elimination)
  21. Orthogonal Projection Matrix Plainly Explained
  22. Plastic Bag Ban – Semi Reusable Bag Kiosks a Better Solution?
  23. Neural Network Recipe: Recognize Handwritten Digits With 95% Accuracy
  24. Neural Network Gradients: Backpropagation, Dual Numbers, Finite Differences
  25. How to Train Neural Networks With Backpropagation
  26. Multivariable Dual Numbers & Automatic Differentiation
  27. A Geometric Interpretation of Neural Networks
  28. My Old Master: How to Correct as a Mentor or a Teacher
  29. Raytracing Reflection, Refraction, Fresnel, Total Internal Reflection, and Beer’s Law
  30. Incremental Least Squares Surface and Hyper-Volume Fitting

2016 33

  1. Incremental Least Squares Curve Fitting
  2. Evaluating Points on Analytical Surfaces and in Analytical Volumes Using the GPU Texture Sampler
  3. Failed Experiment: The GPU Texture Sampler is Turing Complete But That Fact is Pretty Useless
  4. Evaluating Polynomials with the GPU Texture Sampler
  5. The Secret to Writing Fast Code / How Fast Code Gets Slow
  6. Minimizing Code Complexity by Programming Declaratively
  7. Low Tech Homomorphic Encryption
  8. A Data Point for MSVC vs Clang Code Generation
  9. Is Code Faster Than Data? Examining Hash Tables
  10. Is Code Faster Than Data? Switch Statements vs. Arrays
  11. Exploring Compile Time Hashing
  12. Path Tracing – Getting Started With Diffuse and Emissive
  13. Incremental Averaging
  14. Understanding The Discrete Fourier Transform
  15. Fourier Transform (And Inverse) Of Images
  16. Intro To Audio Synthesis For Music Presentation
  17. The Beating Effect
  18. Synthesizing a Plucked String Sound With the Karplus-Strong Algorithm
  19. Who Cares About Dynamic Array Growth Strategies?
  20. Shamir’s Quest: Collect Any 3 Keys To Unlock The Secret!
  21. Turning a Truth Table Into A digital Circuit (ANF)
  22. Game Development Needs Data Pipeline Middleware
  23. Using Wang Tiles to Simulate Turing Machines
  24. A Sixth Way To Calculate Sine Without Trig
  25. Matrix Form of Bezier Curves
  26. Actually Making Signed Distance Field Textures With JFA
  27. Fast Voronoi Diagrams and Distance Field Textures on the GPU With the Jump Flooding Algorithm
  28. GPU Texture Sampler Bezier Curve Evaluation
  29. G-Buffer Upsizing
  30. Normalized Vector Interpolation TL;DR
  31. How and Why Cleaning Up Code or Processes Gives Multiplicative Benefits
  32. Failed Shadertoy “Dust” Game – Browsers Need To Compile Shaders Off the Main Thread!
  33. Making a Ray Traced Snake Game in Shadertoy

2015 49

  1. Simplifying Boolean Expressions With Karnaugh Maps
  2. What Happens When you Mix Hash Tables and Binary Searching?
  3. O(1) Data Lookups With Minimal Perfect Hashing
  4. Hiding a Lookup Table in a Modulus Operation
  5. Quantum Computing For Programmers Part 2: Multiple Qubits
  6. Quantum Computing For Programmers Part Ib: Bloch Sphere
  7. Quantum Computing For Programmers Part I: One Qubit
  8. Quantum Computing References
  9. Solving Nested Modulus Equations
  10. Solving Simultaneous Congruences (Chinese Remainder Theorem)
  11. Modular Multiplicative Inverse
  12. Improving the Security of the Super Simple Symmetric Leveled Homomorphic Encryption Implementation
  13. Super Simple Symmetric Leveled Homomorphic Encryption Implementation
  14. Gaussian Blur
  15. Box Blur
  16. Resizing Images With Bicubic Interpolation
  17. Cubic Hermite Rectangles
  18. Cubic Hermite Interpolation
  19. Lagrange Rectangles
  20. Finite Differences
  21. Rectangular Bezier Patches
  22. Lagrange Interpolation
  23. The De Casteljau Algorithm for Evaluating Bezier Curves
  24. What is Pre-multiplied Alpha and Why Does it Matter?
  25. Adventures in Learning How to Publish a Research Paper Part 1
  26. A Fifth Way to Calculate Sine Without Trig
  27. Easy Binomial Expansion & Bezier Curve Formulas
  28. No Bad Code, Creeping Normality and Social Structure Code Organization
  29. Bilinear Filtering & Bilinear Interpolation
  30. FlipQuad & FlipTri Antialiasing
  31. 4-Rook Antialiasing (RGSS)
  32. Quincunx Antialiasing
  33. Frequency Domain Audio Synthesis – With IFFT and Oscillators
  34. Decibels (dB) and Amplitude
  35. DIY Synth: Convolution Reverb & 1D Discrete Convolution of Audio Samples
  36. DIY Synth: Multitap Reverb
  37. DIY Synth: Delay Effect (Echo)
  38. DIY Synth: Flange Effect
  39. DIY Synth: Basic Drum
  40. HyperLogLog: Estimate Unique Value Counts Like The Pros
  41. Avoiding The Performance Hazzards of std::function
  42. Count Min Sketch: A Probabilistic Histogram
  43. Writing a Basic Search Engine AKA Calculating Similarity of Histograms with Dot Product
  44. Estimating Set Membership With a Bloom Filter
  45. Getting Strongly Typed Typedefs Using Phantom Types
  46. Estimating Counts of Distinct Values with KMV
  47. Programmatically Calculating GCD and LCM
  48. DAPSE Preview
  49. Bresenham’s Drawing Algorithms

2014 21

  1. Dual Numbers & Automatic Differentiation
  2. Using Imaginary Numbers To Rotate 2D Vectors
  3. Four Ways to Calculate Sine Without Trig
  4. One Dimensional Bezier Curves
  5. Counting in Binary is a Fractal
  6. Wang Tiling
  7. Temporal supersampling, flipquads and real time raytracing
  8. What if My Equation DOESN’T Equal Zero??
  9. Situational Leadership
  10. Distance Field Textures
  11. Analytic Fog Density
  12. Feistel Networks – Do They Have to use XOR?
  13. Bezier Curves Part 2 (and Bezier Surfaces)
  14. Implicit vs Parametric vs Explicit Surfaces
  15. Bezier Curves
  16. Soft Maximum vs Hard Maximum
  17. Lots of Skyboxes!
  18. Converting RGB to Grayscale
  19. A trip through the Graphics Pipeline
  20. Shadertoy – WebGLSL pixel shaders
  21. Getting Ideal Disk Reads on the Cheap

2013 18

  1. Transformation Matrix Basics
  2. Converting To and From Polar / Spherical Coordinates Made Easy
  3. How to Test Randomness of Numbers
  4. External C++ Header Guards
  5. Alloca and Realloc – Useful Tools, Not Ancient Relics
  6. Is pre-increment really faster than post increment? Part 2
  7. A Super Tiny Random Number Generator
  8. Fast & Lightweight Random “Shuffle” Functionality – FIXED!
  9. The Incredible Time Traveling Random Number Generator
  10. Why do you hate me rand()?!
  11. Fast & Lightweight Random “Shuffle” Functionality
  12. Efficiently Generate Random Numbers Without Repeats
  13. Is pre-increment really faster than post increment? Part 1
  14. The Black Art of sizeof() aka Compile Time Type Deduction
  15. Lists of Macro Lists
  16. Macro Lists For The Win – Side B
  17. Macro Lists For The Win
  18. Permutation Programming Without Maintenance Nightmares

2012 17

  1. Mechanical Computer Quest Part I
  2. B.A.M. Neural Networks
  3. How to Render the Mandelbrot Set
  4. Bias And Gain Are Your Friend
  5. Anatomy of a Skeletal Animation System Part 3
  6. Anatomy of a Skeletal Animation System Part 2
  7. Anatomy of a Skeletal Animation System Part 1
  8. Encryption 101: Realistic Security
  9. Cryptography 101: Encryption – Asymmetric Keys
  10. Cryptography 101: Encryption – Symmetric Keys
  11. Cryptography 101: Encryption – One Time Pad
  12. Cryptography 101: Hashing
  13. Recording lagless demo videos of a laggy game
  14. DIY Synth 3: Sampling, Mixing, and Band Limited Wave Forms
  15. DIY Synth 2: Common Wave Forms
  16. DIY Synth 1: Sound Output
  17. MoriRT: Pixel and Geometry Caching to Aid Real Time Raytracing