TrueType Font Contains 3D Raycasting Engine in Hinting Virtual Machine
By
4RH1T3CT0R
Crisp on the outside, thoughtful on the inside. A keeper.
Summary
A developer created a DOOM-style 3D raycasting engine that runs inside a TrueType font's hinting virtual machine. The project exploits the Turing-complete nature of TrueType's hinting bytecode to implement a DDA raycasting engine that renders 3D graphics by repositioning glyph contours. The font file contains the entire raycasting engine written in TrueType bytecode, with the glyph 'A' using 16 vertical bar contours that are repositioned to form a 3D perspective view of a 16x16 tile map.
Key quotes
· 4 pulledTrueType fonts have a built-in virtual machine for grid-fitting glyphs. It's got a stack, storage slots, arithmetic, conditionals, function calls - and it turns out it's Turing-complete.
I wanted to see if I could get it to render 3D graphics.
The font file contains a DDA raycasting engine written in TrueType bytecode.
The glyph 'A' has 16 vertical bar contours, and the hinting program raycasts against a 16x16 tile map and repositions those bars using SCFS instructions to form a 3D perspective view.
You might also wanna read
Rendering Realistic Skies and Planetary Atmospheres in Real-Time with Shaders
This article explores the technical and visual process of rendering realistic skies, sunsets, and planetary atmospheres in real-time using b
Exploring surfel-based global illumination with WebGPU on the open web
A technical blog post exploring the use of WebGPU to compute real-time global illumination using surfels (surface patches). The author inves
Implementing Colored Penumbra Shadow Effects in Unreal Engine 5
This article describes a technique for implementing "Colored Penumbra" or "Colored Shadow Terminator" effects in Unreal Engine 5. The author
Experimental WebGPU Physics Engine Using AVBD Solver for Rigid-Body and Soft-Body Simulations
This article presents an experimental WebGPU physics engine called webphysics that implements an AVBD-style (Augmented Vertex Block Descent)
Slug Algorithm: 10 Years of GPU-Based Font Rendering Technology
Eric Lengyel reflects on the 10-year anniversary of the Slug Algorithm, a GPU-based font rendering technique he developed in 2016. The artic
Reducing Trigonometric Functions in Computer Graphics Algorithms
The article argues for reducing trigonometric functions in computer graphics algorithms, advocating for more efficient mathematical approach
