The Offender Engine Book

The Offender Engine Book

414 chapters across 11 volumes, plus a companion track — a cross-platform engine built from nothing, one chapter at a time.

Sign in if you already own it, or see what it costs. Every chapter below is readable as a sample right now.

Book 1 — Foundations, the RHI, Five Backends & a 2D RPG 31 chapters
  1. Preface
  2. Chapter 1 · The Landscape & the Plan
  3. Chapter 2 · CMake, Ninja & Git — A Working Tutorial
  4. Chapter 3 · Testing, CI/CD & Automation
  5. Chapter 4 · Engine Core
  6. Chapter 5 · The Platform Layer I — Window & Events
  7. Chapter 6 · The Platform Layer II — Input, Timing & the App Loop
  8. Chapter 7 · The Threaded Loop & Job System
  9. Chapter 8 · Resources & Audio
  10. Chapter 9 · The RHI — One Graphics Boundary
  11. Chapter 10 · The First Backend — Device, Swapchain, Clear
  12. Chapter 11 · The First Frame — The Triangle
  13. Chapter 12 · Text — the Render Buffer & Baked Fonts
  14. Chapter 13 · Notifications & a Basic UI
  15. Chapter 14 · Three More Widgets
  16. Chapter 15 · Scrolling — ScrollView & ListView
  17. Chapter 16 · Containers & Dialogs
  18. Chapter 17 · Backends You Load, Not Compile
  19. Chapter 18 · The Second Backend (Direct3D 12)
  20. Chapter 19 · Vulkan
  21. Chapter 20 · Metal (macOS & iOS)
  22. Chapter 21 · OpenGL ES — the Fifth Backend, on Android
  23. Chapter 22 · 2D Sprites — the `.ebsprite` Compiler
  24. Chapter 23 · A 2D Tile Canvas — the World the Sprites Move In
  25. Chapter 24 · A 2D Entity System — Things That Live in the World
  26. Chapter 25 · Scenes and Levels — Building a World from Data
  27. Chapter 26 · The Capstone — a Small RPG on Five Backends
  28. Chapter 27 — Twenty-One Environment Variables
  29. Chapter 28 — The Settings Store
  30. Chapter 29 · Gamepads and Virtual Sticks
  31. Chapter 30 · What We Built, and What Comes Next
Book 2 — Shaders & the Common Shader Language 22 chapters
  1. Chapter 1 · The Programmable Pipeline
  2. Chapter 2 · Coordinate Spaces & the Clip-Space Journey
  3. Chapter 3 · GLSL, Concretely
  4. Chapter 4 · Attributes, Varyings, Uniforms & Textures
  5. Chapter 5 · The Shader Wall
  6. Chapter 6 · CSL — the Language
  7. Chapter 7 · The Lexer
  8. Chapter 8 · The Parser & the AST
  9. Chapter 9 · Semantic Analysis
  10. Chapter 10 · The Typed IR
  11. Chapter 11 · Reflection
  12. Chapter 12 · The GLSL Back End
  13. Chapter 13 · The ESSL Back End
  14. Chapter 14 · The HLSL Back End
  15. Chapter 15 · The MSL Back End
  16. Chapter 16 · The SPIR-V Back End
  17. Chapter 17 · The Command-Line Driver
  18. Chapter 18 · The Compiled Shader Format
  19. Chapter 19 · Shaders as Assets
  20. Chapter 20 · Modules & `#include`
  21. Chapter 21 · One Source, Five Backends
  22. Chapter 22 — Techniques, Variants, and a Name to Ask For
Book 3 — Into 3D 26 chapters
  1. Chapter 1 — Meshes & the Importer
  2. Chapter 2 — The Depth Buffer & Cross-Backend Conventions
  3. Chapter 3 — 3D on Mobile
  4. Chapter 4 — Procedural Primitives
  5. Chapter 5 — The GPU Transform
  6. Chapter 6 — Cameras
  7. Chapter 7 — Scenes & Frustum Culling
  8. Chapter 8 — Spatial Partitioning
  9. Chapter 9 — Desktop Polish: Anti-Aliasing, Fullscreen, and Portable Assets
  10. Chapter 10 — The Scene Graph
  11. Chapter 11 — Entities, Movement & Collision
  12. Chapter 12 — Particles & Projectiles
  13. Chapter 13 — Enemy AI & Pathfinding
  14. Chapter 14 — Textures, Lighting & Shadows
  15. Materials: Normal Mapping, Parallax & PBR
  16. Chapter 16 — Terrain: Chunked LOD, Streaming & Shadows
  17. Chapter 17 — Atmosphere: Sky, Fog, Water & Foliage
  18. Chapter 18 — The Water Problem
  19. Chapter 19 — Water Refraction & Underwater
  20. Chapter 20 — Billboards: Alpha-Test, Vegetation & Particles
  21. Chapter 21 — Water Refraction Refinements
  22. Chapter 22 — Level of Detail
  23. Chapter 23 — Day/Night Cycle
  24. Chapter 24 — Weather: Volumetric Clouds
  25. Chapter 25 — The Sun in the Lens
  26. Chapter 26 — Into 3D, in Review
Book 4 — The Editor 26 chapters
  1. Chapter 1 — Dear ImGui on our RHI
  2. Chapter 2 — The Dockspace & the Viewport
  3. Chapter 3 — The Other UI: Binding & MVVM Foundations
  4. Chapter 4 — Reflection & the Inspector
  5. Chapter 5 — Picking
  6. Chapter 6 — The Fly Camera
  7. Chapter 7 — The Translate Gizmo
  8. Chapter 8 — Rotate & Scale Gizmos
  9. Chapter 9 — Undo/Redo
  10. Chapter 10 — The Asset Palette & Placement
  11. Chapter 11 — Terrain Sculpting
  12. Chapter 12 — Lights & Environment
  13. Chapter 13 — Saving the Scene: the `.ebscene` Format
  14. Chapter 14 — Play-in-Editor
  15. Chapter 15 — The Runtime UI, Done Right: MVVM in Full
  16. Chapter 16 — Author a Level, Ship It
  17. Chapter 17 — A World of Tiles
  18. Chapter 18 — Streaming the World
  19. Chapter 19 — Placing Meshes: Self-Contained, Textured, and Collidable
  20. Chapter 20 — Holes, and Enterable Interiors
  21. Chapter 21 — Material Maps
  22. Chapter 22 — Richer Lights
  23. Chapter 23 — Editor Tools
  24. Chapter 24 — Brush Geometry
  25. Chapter 25 — Surfaces & the Texture Library
  26. Chapter 26 — Editor Design Notes & Wrap
Book 5 — Characters & Animation 17 chapters
  1. Chapter 1 — The Landscape & the Plan
  2. Chapter 2 — Skeletons & the Rig
  3. Chapter 3 — Animation Clips
  4. Chapter 4 — Skinning, Slowly, on the CPU
  5. Chapter 5 — Characters in the Scene
  6. Chapter 6 — The Compiler Grows Arrays
  7. Chapter 7 — GPU Skinning on Five Backends
  8. Chapter 8 — The Animation Player
  9. Chapter 9 — Blending
  10. Chapter 10 — The State Machine is Data
  11. Chapter 11 — Locomotion
  12. Chapter 12 — Sockets & Attachments
  13. Chapter 13 — Import, in the Editor
  14. Chapter 14 — Animating in the Editor
  15. Chapter 15 — The Player, Embodied
  16. Chapter 16 — Rigging in the Editor, and the Format Writes Back
  17. Chapter 17 — Design Notes & Wrap
Book 6 — Physics 23 chapters
  1. Chapter 1 — The Landscape & the Plan
  2. Chapter 2 — The Simulation Clock
  3. Chapter 3 — A Library is Born
  4. Chapter 4 — Bodies & Integration
  5. Chapter 5 — Debug Draw First
  6. Chapter 6 — Broadphase
  7. Chapter 7 — Analytic Contacts
  8. Chapter 8 — Boxes: SAT with a Manifold
  9. Chapter 9 — Vs the World
  10. Chapter 10 — Impulses
  11. Chapter 11 — The Sequential Impulse Solver
  12. Chapter 12 — Friction & Materials
  13. Chapter 13 — Islands & Sleep
  14. Chapter 14 — Joints
  15. Chapter 15 — The Ragdoll
  16. Chapter 16 — IK: Constraints Run Backward
  17. Chapter 17 — Cloth: the Cape Unwelds
  18. Chapter 18 — Movement, Migrated
  19. Chapter 19 — Physics is a Data Problem
  20. Chapter 20 — The Editor & Five Platforms
  21. Chapter 21 — Destruction
  22. Chapter 22 — Wheels: the Raycast Vehicle
  23. Chapter 23 — Capstone: the Arena, and Design Notes
Book 7 — Scripting & Embedded Languages 34 chapters
  1. Chapter 1 — The Landscape & the Plan
  2. Chapter 2 — The Game Module ABI
  3. Chapter 3 — The Host API & a Real Player Controller
  4. Chapter 4 — Hot Reload
  5. Chapter 5 — State Across Reload
  6. Chapter 6 — Crashes at the Boundary
  7. Chapter 7 — Behaviors & the Registry
  8. Chapter 8 — The Editor Connects
  9. Chapter 9 — Play-in-Editor, Live
  10. Chapter 10 — Events & Triggers
  11. Chapter 11 — Game Data as Assets
  12. Chapter 12 — The Bridge
  13. Chapter 13 — Mobile: Static Link
  14. Chapter 14 — The Capstone: a Game, Iterated Live
  15. Chapter 15 — Design Notes & Wrap
  16. Chapter 16 — Animation Across the Seam
  17. Chapter 17 — The Seam Grows Physics (ABI v10)
  18. Chapter 18 — The Case, and the Shape
  19. Chapter 19 — sol2 and the Host DLL
  20. Chapter 20 — Binding the Engine
  21. Chapter 21 — Scripts Are Content
  22. Chapter 22 — Behaviors, and a Game in Lua
  23. Chapter 23 — Reload, Sandbox, Blast Radius
  24. Chapter 24 — C#: the Same Seam
  25. Chapter 25 — Binding the Engine to C#
  26. Chapter 26 — A Game, in C#
  27. Chapter 27 — The Course
  28. Chapter 28 — The Game Is Data
  29. Chapter 29 — The Game in C++
  30. Chapter 30 — The Game in C#
  31. Chapter 31 — The Game in Lua
  32. Chapter 32 — The Editor Speaks Three Languages
  33. Chapter 33 — The Quick Reference
  34. Chapter 34 — The Assessment
Book 8 — Advanced 3D & Shaders: Locking the RHI 31 chapters
  1. Chapter 1 — The Case, the Caps, and the Contract
  2. Chapter 2 — The Agility SDK
  3. Chapter 3 — Compute
  4. Chapter 4 — Barriers
  5. Chapter 5 — Moved to Compute: Skinning, and Cloth
  6. Chapter 6 — Bindless
  7. Chapter 7 — Bindless, Applied
  8. Chapter 8 — Queues
  9. Chapter 9 — ExecuteIndirect, and Culling Without the CPU
  10. Chapter 10 — Mesh Shaders: The Geometry Pipeline, Replaced
  11. Chapter 11 — DDS, Block Compression, and the Mip Chain
  12. Chapter 12 — Mesh Shaders II: Meshlet Culling
  13. Chapter 13 — Hierarchical Cluster Culling
  14. Chapter 14 — Work Graphs
  15. Chapter 15 — Variable Rate Shading
  16. Chapter 16 — Virtual Textures I: Storage Images and Tiled Resources
  17. Chapter 17 — Virtual Textures II: Streaming
  18. Chapter 18 — Clustered Lighting
  19. Chapter 19 — Stencil Shadow Volumes
  20. Chapter 20 — Volumetric Fog
  21. Chapter 21 — Parallax, Properly
  22. Chapter 22 — Particles I: The Data-Driven System
  23. Chapter 23 — Particles II: The Simulation Moves to the GPU
  24. Chapter 24 — The Particle Editor
  25. Chapter 25 — Acceleration Structures
  26. Chapter 26 — Ray Queries: The Instrument
  27. Chapter 27 — A Ray Where the Shadow Map Was
  28. Chapter 28 — The Rays Whose Answer Is Not a Boolean
  29. Chapter 29 — A Network Where the Rays Were
  30. Chapter 30 — Mirrors, Water, and What a Bounce Costs
  31. Chapter 31 — RHI 1.0: Freezing a Contract You Can Still Read
Book 9 — The Trailing Backends 27 chapters
  1. Chapter 1 — The Windowless Probe
  2. Chapter 2 — Three Ceilings
  3. Chapter 3 — A Device That Has Never Seen a Window
  4. Chapter 4 — The Emitter That Never Asked
  5. Chapter 5 — Bindless, the OpenGL Way
  6. Chapter 6 — Sparse Textures, and a Borrowed Ladder
  7. Chapter 7 — Mesh Shaders on One Vendor
  8. Chapter 8 — What OpenGL Cannot Do
  9. Chapter 9 — The Near-Twin That Stopped Compiling
  10. Chapter 10 — Forty Samples That Cannot Be Launched
  11. Chapter 11 — The First Frame
  12. Chapter 12 — Compute, on a Phone
  13. Chapter 13 — Sixty-Five Samples on a Phone
  14. Chapter 14 — Assets, Declared Once
  15. Chapter 15 — One Version Per Program
  16. Chapter 16 — Only What a Stage Can Reach
  17. Chapter 17 — Lua on a Phone
  18. Chapter 18 — Two Clients, One Window
  19. Chapter 19 — The Build Said No and the Engine Said Yes
  20. Chapter 20 — Four Dead Buttons
  21. Chapter 21 — The Noise Floor
  22. Chapter 22 — The Clock Metal Does Not Have
  23. Chapter 23 — Nine Chapters Nobody Checked
  24. Chapter 24 — `gpuOnly` Means Sometimes
  25. Chapter 25 — One Hardcoded False
  26. Chapter 26 — The Star Is Not a Wildcard
  27. Chapter 27 — The Matrix, Per Platform
Book 10 — Shadows 36 chapters
  1. Chapter 1 — Fourteen Shadows
  2. Chapter 2 — Two Combo Boxes
  3. Chapter 3 — The Unit a Bias Is In
  4. Chapter 4 — A Number for a Picture
  5. Chapter 5 — The Instrument That Lied About Itself
  6. Chapter 6 — Not an Approximation
  7. Chapter 7 — The Subject, and Five Believable Frames
  8. Chapter 8 — Ground Truth
  9. Chapter 9 — The Resolution Question
  10. Chapter 10 — Shadow Maps, Properly
  11. Chapter 11 — The Bias Problem
  12. Chapter 12 — PCF, and a Metric That Cannot Score It
  13. Chapter 13 — Variance Shadow Maps
  14. Chapter 14 — Exponential Shadow Maps
  15. Chapter 15 — Moment Shadow Maps
  16. Chapter 16 — PCSS and Contact Hardening
  17. Chapter 17 — The Backend That Rendered Nothing
  18. Chapter 18 — Cascades
  19. Chapter 19 — Stabilisation
  20. Chapter 20 — Point Lights: Cube Shadow Maps
  21. Chapter 21 — Dual-Paraboloid
  22. Chapter 22 — Spot Lights: One Frustum, and Three Things It Broke
  23. Chapter 23 — The Light System: Applying It
  24. Chapter 24 — Atlasing and Budgets
  25. Chapter 25 — Caching: The Shadow That Did Not Move
  26. Chapter 26 — Virtual Shadow Maps
  27. Chapter 27 — Culling: The Casters That Cannot Matter
  28. Chapter 28 — Baked Shadows and Lightmaps
  29. Chapter 29 — Ray-Traced Shadows
  30. Chapter 30 — Screen-Space Contact Shadows
  31. Chapter 31 — Translucent and Coloured Shadows
  32. Chapter 32 — Deep Shadow Maps
  33. Chapter 33 — Volumetric Shadows
  34. Chapter 34 — The Debts
  35. Chapter 35 — Stencil Shadow Volumes
  36. Chapter 36 — The System and the Comparison
Book 11 — MeshEdit 114 chapters
  1. Chapter 1 — Twenty-Four Thousand Corners That Have Never Met
  2. Chapter 2 — One Kit, Two Editors
  3. Chapter 3 — Verts, Edges, Loops, Faces
  4. Chapter 4 — The Structure That Could Not Hold a Mirror
  5. Chapter 5 — Soup to Structure, and Back Again
  6. Chapter 6 — A Renderer With No Wireframe
  7. Chapter 7 — Three Kinds of Click
  8. Chapter 8 — The Document `.ebmesh` Cannot Be
  9. Chapter 9 — Undo for a Hundred Thousand Fields
  10. Chapter 10 — Seven Hundred Lines Leave the Scene Editor
  11. Chapter 100 — The Quadratic That Does Not Matter
  12. Chapter 101 — When Repair Beats Dropping
  13. Chapter 102 — Three Million Chances
  14. Chapter 103 — A Float That Is No Number
  15. Chapter 104 — The Debt Named Three Times
  16. Chapter 105 — The Zero That Is Not A NaN
  17. Chapter 106 — The List Becomes The Data
  18. Chapter 107 — A Comment Is A Rule Nothing Can Check
  19. Chapter 108 — A File Named After What It Does
  20. Chapter 109 — A Caption That Points At Nothing
  21. Chapter 11 — Extrude, and the Edges That Should Not Be There
  22. Chapter 110 — The Measurement That Examined Nothing
  23. Chapter 111 — The Reader That Is Switched Off
  24. Chapter 112 — The Slots Nobody Was Watching
  25. Chapter 113 — The Cause
  26. Chapter 114 — What A Hundred And Thirteen Chapters Found
  27. Chapter 12 — Inset, and the Corner That Turns Inside Out
  28. Chapter 13 — Modelling Over a Photograph
  29. Chapter 14 — Bevel Is a Book
  30. Chapter 15 — Walking the Ring
  31. Chapter 16 — Slide, Along a Topology
  32. Chapter 17 — Five Ways to Delete
  33. Chapter 18 — Cut, Split, Weld
  34. Chapter 19 — Where the Shading Breaks
  35. Chapter 20 — A Stack Between the Cage and the Screen
  36. Chapter 21 — Catmull and Clark
  37. Chapter 22 — Creases, and the Surface in the Limit
  38. Chapter 23 — Booleans That Do Not Lie
  39. Chapter 24 — One Stroke, Three Tools
  40. Chapter 25 — Brushes That Move a Surface
  41. Chapter 26 — Topology That Changes Under the Brush
  42. Chapter 27 — Voxels, and the Honest Word for Retopology
  43. Chapter 28 — Seams: the Cuts You Choose
  44. Chapter 29 — Least Squares, Conformal
  45. Chapter 30 — Angles, Not Positions
  46. Chapter 31 — Packing an Atlas
  47. Chapter 32 — The Second Viewport
  48. Chapter 33 — A Texture You Are Allowed to Change
  49. Chapter 34 — The Brush That Is a Draw Call
  50. Chapter 35 — Layers, Masks, and the Bleed at the Seam
  51. Chapter 36 — Getting a Model In and Out
  52. Chapter 37 — Typing a Number, and Cutting a Quad
  53. Chapter 38 — What a Week of Being Used Found
  54. Chapter 39 — Slots, and the Faces That Belong to Them
  55. Chapter 40 — The PBR Panel
  56. Chapter 41 — A Graph That Compiles
  57. Chapter 42 — The Technique Builder
  58. Chapter 43 — Baking a Graph to Texels
  59. Chapter 44 — What Phase VII Owed
  60. Chapter 45 — Baking One Mesh Onto Another
  61. Chapter 46 — A Second Week of Being Used
  62. Chapter 47 — Bones, With a Rest Pose That Means Something
  63. Chapter 48 — Weights: Bound, Then Painted
  64. Chapter 49 — A Real Dope Sheet
  65. Chapter 50 — The Curve Between Two Keys
  66. Chapter 51 — Everything Is an Operator
  67. Chapter 52 — The Editor Learns Lua
  68. Chapter 53 — A Surface a Program Can Drive
  69. Chapter 54 — A Plugin That Ships
  70. Chapter 55 — The Bake
  71. Chapter 56 — Headless
  72. Chapter 57 — The Round Trip
  73. Chapter 58 — The Other Writer
  74. Chapter 59 — What the Document Forgot
  75. Chapter 60 — The Stack Nobody Could Reach
  76. Chapter 61 — Which Object Is This Face In
  77. Chapter 62 — One Thing, Or Several
  78. Chapter 63 — An Object With No Faces
  79. Chapter 64 — The Array Beside The Table
  80. Chapter 65 — The Copies Were Not Lines
  81. Chapter 66 — A Negative Width
  82. Chapter 67 — The Plugin Surface Is Lua
  83. Chapter 68 — A Group Was Always An Object
  84. Chapter 69 — Where The Transform Is Applied
  85. Chapter 70 — Object Mode Moves The Object
  86. Chapter 71 — The Gizmo, And The Stale Binary
  87. Chapter 72 — The Sweep And The Selection
  88. Chapter 73 — The Operand, And The Renumbered Table
  89. Chapter 74 — The Reference That Outlived The Vector
  90. Chapter 75 — Where An Object Turns
  91. Chapter 76 — A Chain With A Name
  92. Chapter 77 — The Three Things Chapter 76 Left
  93. Chapter 78 — A Stroke Through Space, And A Run That Leaves Evidence
  94. Chapter 79 — A Face This Editor Just Built
  95. Chapter 80 — The Sixth Modifier
  96. Chapter 81 — An Item That Refuses Should Not Look Available
  97. Chapter 82 — Bevel, Finished
  98. Chapter 83 — Two Lists With The Same Words In Them
  99. Chapter 84 — Which Parameter Belongs To Which Button
  100. Chapter 85 — The Extension That Was Already In The Shader
  101. Chapter 86 — A Number A File Could Say And A Person Could Not
  102. Chapter 87 — The Animation A Program Could Not Read
  103. Chapter 88 — The Clip That Could Not Be Unmade
  104. Chapter 89 — The Third Time The Bake Dropped A Number
  105. Chapter 90 — A Guard For The Thing Three Chapters Found By Hand
  106. Chapter 91 — There Were Never Two Conversions
  107. Chapter 92 — A Rename Defeats A Name Check
  108. Chapter 93 — The Check That Should Not Be A Gate
  109. Chapter 94 — Two Clips Called Walk
  110. Chapter 95 — Two Bones Called Spine
  111. Chapter 96 — The Back Door
  112. Chapter 97 — A Chain That Points At Nothing
  113. Chapter 98 — Four Promises A Skin Makes
  114. Chapter 99 — What Three Passes Cost
Concepts — a companion track 27 chapters
  1. Concept 01 · Layering & Dependency Direction
  2. Concept 02 · Declarative Builds & the Configure/Build Split
  3. Concept 03 · Tests as Design & CI as the Definition of Correct
  4. Concept 04 · Ownership, RAII, and Handles
  5. Concept 05 · Platform Abstraction — the Seam Between OS and Engine
  6. Concept 06 · The Game Loop — Edges, Levels & Time
  7. Concept 07 · Producer/Consumer, Thread Affinity & Sharing Without Racing
  8. Concept 08 · Asset Pipelines — Bake Once, Load Forever
  9. Concept 09 · Abstraction Layers — the Interface as a Contract
  10. Concept 10 · One Implementation of an Interface — and the Do-Nothing Device
  11. Concept 11 · The GPU as a Data Path — State vs. Data
  12. Concept 12 · Batching — Why One Draw Beats a Thousand
  13. Concept 13 · Decoupling with Events — the Sender Who Doesn't Know
  14. Concept 14 · Immediate vs. Retained UI — and Where State Lives
  15. Concept 15 · Coordinate Spaces, Transforms, and the Clip
  16. Concept 16 · Layout as a Tree, and Modality
  17. Concept 17 · Runtime Polymorphism Across a Binary Boundary
  18. Concept 18 · Explicit APIs and Who Owns the GPU's Lifetime
  19. Concept 19 · Synchronization, and Making the Implicit Explicit
  20. Concept 20 · Convergent Design, and the Bug Only Your Eyes Can Find
  21. Concept 21 · Reuse vs. Rewrite — the Near-Twin
  22. Concept 22 · The Compiler as a Tool — Custom Binary Asset Formats
  23. Concept 23 · Culling — Spending Compute Only on What's Visible
  24. Concept 24 · Composition over Inheritance, and Data-Oriented Design
  25. Concept 25 · Data-Driven Design — Separating Description from Construction
  26. Concept 26 · Systems as Free Functions Over Data — and How Much the Engine Bought
  27. Concept 27 · Deliberate Seams and Recognizing Debt Before It's Urgent