Lab

Small experiments in rendering, simulation and emulation. Most of them took an evening.

More on LinkedIn
  • Ray Tracing in One Weekend on a PSP 3000

    Rendering, April 2026

    ✨ Ported "Raytracing in One Weekend" straight to the PSP 3000

  • GLASM: OpenGL in x64 NASM

    Rendering, August 2025

    🎨 OpenGL-ASM x64 NASM Project (GLASM)

    Simple OpenGL 1.1 demo rendering a triangle using GLFW and NASM assembly on x64 platforms.

    Features:

    • Minimal NASM x64 setup
    • GLFW window creation and management
    • Basic triangle rendering with OpenGL
    • Cross-platform ready (Windows/macOS/Linux)
  • Game of Life with sparse encoding

    Simulation, August 2025

    🧩 Conway’s Game of Life: Sparse Encoding

    Inspiration:

    Huge 264 Conway’s Game Of Life Sim, using Sparse Encoding

  • CameBoy: a minimalist Game Boy emulator in C99

    Emulation, July 2025

    🧩 CameBoy: A Minimalist Game Boy Emulator in C99

    A clean, from-scratch Game Boy emulator written in pure C99, with a focus on simplicity, clarity, and low-level accuracy.

    📚 Resources that shaped this project

  • Ray Tracing in One Weekend

    Rendering, July 2025

    ✨ Ray Tracing in One Weekend

    A hands‑on journey building a CPU-based ray tracer from scratch, fully in C99, following Ray Tracing in One Weekend by Peter Shirley.

  • Dura2D and LeveGL on the PSP

    Simulation, July 2025

    🕹️ Dura2D + LeveGL on PSP

    Running my own 2D physics engine (Dura2D) and minimalist OpenGL-style wrapper (LeveGL) on real Sony PSP hardware.

    What I’ve pulled off so far:

    • Libraries ported to pspsdk, with all system dependencies replaced.
    • Rendering pipeline and physics adapted for PSP’s fixed-function GPU and tight memory budget.
    • Demos successfully run at full resolution on a PSP 3000.

    📸 Captured the result in a short recording real-time simulation and rendering, powered entirely by homebrew code.

  • Explaining ray marching with ray marching

    Rendering, June 2025

    🌫️ Explaining Ray Marching… with Ray Marching

    A meta-visual experiment: using real-time ray marching to explain how ray marching works, directly in the browser.

    Features:

    • A minimal SDF-based ray marcher using signed distance fields
    • Interactive visualizations: orbit camera, distance debug view, and step tracing overlay
    • Embedded directly into the blog post. The explanation is the render

    🎯 Goal: make an intuitive, visual-first introduction to ray marching that teaches by showing, not telling.

  • Ray tracing and the aesthetics of normals

    Rendering, June 2025

    ✨ Ray Tracing & the Aesthetics of Normals

    Exploring how surface normals shape the visual soul of ray-traced scenes.

  • MOS 6502 emulator in C99

    Emulation, June 2025

    🧩 MOS 6502 Emulator Written in C99

    A clean and minimal MOS 6502 emulator built entirely in C99, focused on correctness, readability, and low-level understanding.

    What’s working so far:

    • Full instruction set implemented and verified
    • Accurate cycle timing and flag behavior
    • Memory-mapped bus with support for RAM, ROM, and I/O regions
    • Designed to be embedded into other systems or used for standalone programs

    A foundational project to better understand how 8-bit CPUs work and how to build emulators from the ground up.

  • Game Boy audio visualizer

    Emulation, March 2025

    🔊 GameBoy Audio Visualizer

    A simple, real-time visualizer for the Game Boy’s four audio channels, designed to help me understand and debug the APU while I add sound to my emulator.

  • Dura2D running on a Nintendo Switch

    Simulation, March 2025

    🕹️ Dura2D Running on a Nintendo Switch

    Got Dura2D, my custom 2D physics engine, running natively on a modded Nintendo Switch using the devkitPro homebrew toolchain.

    What’s been achieved:

    • Ported core physics loop.
    • Ran physics demos in real time on handheld mode.
    • Kept it fast, small, and fully self-contained.

    The project is an exercise in pushing homebrew boundaries while keeping the architecture minimal and portable.

  • Pathfinding testbed optimizations

    Performance, November 2024

    ⚡ Pathfinding Performance: A Testbed Optimizations

    I built a custom pathfinding testbed and explored 16,310 nodes in about 0.33 ms. Each colored pixel shows low‑level tweaks at work:

    Key experiments that unlocked speed:

    Memory layout

    • Pack structs to remove padding
    • Align hot functions to cut cache misses
    • Pack frequent data tightly
    • Add manual prefetching in A* loops

    Compute optimizations

    • Inline distance math and use SSE2
    • Ensure proper loop order for better cache locality

    Task control

    • Simple fiber‑based job system
    • Time slicing to balance work
    • Delay result gathering

    Big thanks to Perf Ninja for the low‑level inspiration. Still room to push this further.

  • Shader.Vista: multi-pass shader web editor

    Rendering, November 2024

    🎨 Shader.Vista: Multi‑Pass Shader Web Editor

    A browser‑based tool for creating and experimenting with multi‑pass fragment shaders.

    What’s in place:

    • Monaco Editor integration for code editing
    • WebGL 1 and WebGL 2 contexts with shader compilation
    • Multi‑pass rendering pipeline with framebuffer swapping
    • UI layout styled with Tailwind CSS
    • Drag‑and‑drop ordering of render passes via DnD Kit
  • Basic Sony PSP rendering

    Rendering, October 2024

    ✨ Basic Sony PSP rendering

    Revisiting my childhood passion by programming graphics on the original PlayStation Portable. Using pspdev/pspsdk and pspgl (an OpenGL ES–like layer) to get native rendering up and running.

  • Dynamic AABB tree

    Simulation, September 2024

    🌳 Dynamic AABB Tree

    I’ve integrated a full dynamic AABB tree system into Dura2D, inspired by Box2D, and the performance boost was immediate.

    What’s implemented:

    • Surface Area Heuristic (SAH) Balances the tree by minimizing the total surface cost. Instead of using height or node count, SAH makes smarter split and rotation decisions, reducing overlap and traversal steps.

    • Fat AABB Each object has a slightly larger bounding box to allow small movements without triggering tree updates. This reduces the number of insertions and keeps the tree stable.

    • Memory Management Nodes are managed through a fixed-size pool with a free list. No dynamic memory allocation during runtime, which improves stability and frame consistency.

    Result: The broad-phase is now fast, efficient, and scales well under load. Dura2D handles large scenes more easily, and the tree stays compact and responsive even with constant movement.

  • 2D SDF interactive demo

    Rendering, June 2024

    🛠️ 2D SDF Interactive Demo

    Real‑time 2D Signed Distance Field demo generating smooth shapes and animations purely from simple equations.

  • UE5: multithreading, time slicing and delayed result gathering

    Performance, April 2024

    🛠️ Unreal Engine 5: Multithreaded + Time Slicing + Delayed Result Gathering

    Experimenting with FRunnable to speed up line casts on a grid and update an exposure map in UE5. By combining FRunnable, delayed result gathering, and time slicing, I hit some impressive numbers:

    What’s implemented:

    • FRunnable tasks for parallel line casts
    • Delayed result gathering to avoid main‑thread stalls
    • Time slicing to split work across frames

    Inspiration: Adapted the Unity Job System approach from Ming‑Lun “Allen” Chou’s blog to Unreal Engine.

  • Chip0u: a CHIP-8 emulator in C++20

    Emulation, February 2024

    🧩 Chip0u: A CHIP-8 Emulator in C++20 with raylib + ImGui

    A playful and modern take on the classic CHIP-8 virtual machine, written in C++20 with a focus on clarity and UX.

    What’s implemented:

    • Full CHIP-8 instruction set with accurate timing and quirk handling
    • Built-in debugger with step, breakpoint, and memory inspection
    • UI built with ImGui, rendered using raylib
    • Key remapping and save state support
    • Loads and runs most public domain ROMs with zero config

    Designed to feel light and responsive while offering deep control for learning and experimentation.

  • Dura2D: a 2D physics engine for learning

    Simulation, January 2024

    🚀 Dura2D: Building a 2D Physics Engine for Learning

    I set out to discover how games simulate rigid bodies and collisions by coding my own 2D physics engine from scratch. Dura2D grew from a question: how do games deliver realistic motion and interactions?

    Inspired by Pikuma’s course, Ming-Lun "Allen" Chou Game Physics blog posts and Erin Catto’s Box2D code, Dura2D offers:

    • Constraint System for joints and contacts
    • Warm Starting to reuse previous frame impulses and boost stability
    • Stable, real‑time simulation across different scenarios
  • Frustum culling with AABBs

    Rendering, September 2023

    📦 Frustum Culling + AABB

    Implemented frustum culling using axis-aligned bounding boxes. Each object’s AABB is tested against the view frustum planes before rendering. Simple, fast, and cut draw calls by over 70% in large scenes.

  • Quadtree spatial partitioning

    Performance, September 2023

    🛠️ Quadtree Spatial Partitioning

    Optimized 2D collision detection and spatial queries using a quadtree in SDL2. Visual debug and performance logging reveal major gains over brute force.

    Key features:

    • Quadtree nodes with dynamic subdivision
    • Efficient range queries for nearby objects
    • SDL2 overlay of quadtree bounds and entities

    Based on The Coding Train’s Quadtree challenge

  • OpenGL: skybox

    Rendering, July 2023

    🌌 OpenGL: Skybox Implementation

    Added a skybox system using cube maps in OpenGL. View-locked, depth-tested, and rendered last for proper blending. Clean backdrop, zero artifacts, and ready for HDR probes.

  • Unity: multithreading, time slicing and delayed result gathering

    Performance, April 2023

    🛠️ Unity: Multithreaded + Time Slicing + Delayed Result Gathering

    Experimenting with Unity’s Job System and Burst compiler to speed up line casts on a grid and update an exposure map in Unity. By leveraging IJobParallelFor, delayed result gathering, and frame slicing, I’ve hit some impressive numbers:

    What’s implemented:

    • IJobParallelFor jobs for parallel line casts
    • Delayed result gathering on the main thread to avoid stalls
    • Time slicing to spread work over multiple frames

    Inspiration: Based on Ming‑Lun “Allen” Chou’s approach in Unity’s Job System.

  • Virtual production: UE5 pipeline fix

    Rendering, August 2022

    🎬 Virtual Production: UE5 Pipeline Fix

    Recorded a virtual production scene in Unreal Engine 5 to debug pipeline issues. Found and fixed a desync between the matte layer and foreground render.

  • Unity: Donut County prototype

    Gameplay, January 2022

    🕹 Unity: Donut County Prototype

    A physics‑driven hole‑digging game prototype inspired by Donut County, built entirely in Unity to test core mechanics and feel.

  • Unity: raymarched sphere on a billboard quad

    Rendering, April 2021

    🪐 Unity: Raymarched Sphere on a Billboard Quad

    Used simple raymarching on a billboard quad to simulate a 3D sphere. Replaced high-poly planet meshes with a single shader pass. Perfect for educational solar system sims on low-end devices. Clean, fast, and visually solid.

  • Remap function test

    Gameplay, December 2020

    🧪 Remap Function Test: Value to Range Mapping

    Ran a simple visual test to validate a remap function, converting a value from one range to another in real time.

  • Unity: dynamic camera FoV adapter

    Gameplay, December 2020

    🛠️ Unity: Dynamic Camera FoV Adapter

    A code that adjusts the Camera’s field of view at runtime to encompass a set of tracked Transforms within defined margins.

  • Unity: inverse kinematics study

    Gameplay, August 2020

    🛠️ Unity: Inverse Kinematics Study

    Exploring runtime IK solutions in Unity using the Prototype Asset Pack for character rigs. Implemented goal-driven limb positioning with real‑time adjustments.

    Assets: POLYGON | Prototype Asset Pack by Unity Technologies