Skip to content

maxbrundev/ObsidianGL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ObsidianGL

Real-time SIMD-optimized CPU software renderer with a modern API, alongside OnyxEngine (a small engine layer on top) and a demo game (Minecraft clone).

A complete rewrite of AmberGL from scratch, originally designed to provide an immediate-mode API capable of rendering Minecraft Classic 0.30 (OpenGL 1.1), for science. It has since grown into a full engine with multiple rendering backends.

  • ObsidianGL: CPU software rasterizer with multithreaded tiling and SIMD acceleration
  • OnyxEngine: engine layer with an RHI backed by ObsidianGL (default) or OpenGL 4.5 via GLAD, plus pass-based rendering, scene system, and SDL3 windowing
  • Game: Minecraft clone with infinite world generation

Features

  • Programmable pipeline (vertex/fragment programs with varyings, uniforms, texture sampling)
  • Command buffer recording (Begin/End, Submit, Present, Dispatch)
  • Multithreaded tile-based rasterizer with thread pool, primitive binning, per-tile program contexts
  • Tile debug overlay (grid, triangle-count heatmap, per-tile visibility toggle)
  • Render targets with color/depth attachments and blit between targets
  • Triangle rasterization (barycentric, subpixel-accurate with top-left fill rule, no coplanar triangle issues)
  • Line and point rasterization (configurable width and size)
  • AVX2 / SSE / scalar SIMD paths across rasterization, buffer clears, and texture sampling
  • Texture mapping (nearest + bilinear filtering, repeat + clamp-to-edge wrapping)
  • Perspective-correct interpolation (colors, texture coordinates)
  • Sutherland-Hodgman frustum clipping (6 planes, Cohen-Sutherland trivial reject)
  • 32-bit float depth buffer (depth test / depth write)
  • Face culling (front/back, CW/CCW)
  • Fill, wireframe, and point polygon modes

Getting Started

Requirements: CMake 3.20+, a C++20 compiler, x86_64 CPU (AVX2 recommended).

Windows (Visual Studio):

Scripts\GenerateVisualStudioProject.bat

Defaults to VS 2026. Pass 2022, 2024, or 2026 as an argument. Open .build/Obsidian.sln and build the Game project.

Linux / macOS:

./Scripts/GenerateMakefile.sh
cd .build && make -j

CMake options:

  • OBSIDIAN_USE_AVX2 (default ON): enable AVX2 codepaths in the rasterizer
  • OBSIDIAN_USE_OPENGL (default OFF): use the OpenGL 4.5 backend instead of the software rasterizer

Dependencies

Minimum Requirements

Component Requirement
CPU x86_64 (AVX2 recommended)
RAM 1 GB
GPU OpenGL 4.5 (only when using the OpenGL backend)
OS Windows 10+, Linux, macOS

Video and Screenshots

Minecraft 0.30 running on CPU using ObsidianGL and a Java bridge. I removed all GL11 function calls and now just blit the ObsidianGL framebuffer to OpenGL when Display is called. A lot of rendering issues remain, but at least it runs!

Recording.2026-02-25.231525.mp4

perf showcase

Screenshot 2026-03-30 012418 image Screenshot 2026-02-16 205801 Screenshot 2026-02-16 205822

Amber preserves, Onyx structures, Obsidian cuts.

About

Real-time SIMD-optimized CPU software renderer with a modern API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages