PBR Renderer

An experimental real-time Signed Distance Field (SDF) raymarching renderer written in C++ and OpenGL.
Overview
This project is a personal rendering experiment focused on real-time SDF rendering and raymarching.
The scene is rendered by raymarching SDF primitives in the fragment shader over a fullscreen quad, with shape composition and shading evaluated procedurally at runtime.
The goal of the project is to explore the foundations of implicit surface rendering and build a deeper understanding of rendering techniques outside of a traditional rasterization pipeline.
Features
- Raymarching-based rendering of Signed Distance Fields
- Primitive support: spheres, rounded boxes, planes
- Scene composition using SDF operations
- Skybox background
- Basic ambient + diffuse lighting with soft shadows.
- Basic scene editor with ImGui:
- inspect and edit shapes
- create / delete shapes
- scene tweaking
- Free camera controls
Technical Details
The renderer uses a fullscreen quad and performs raymarching in the fragment shader to evaluate the scene. Each object is represented as a signed distance function, and the final scene is built through SDF composition operations such as unions and smooth unions.
Surface normals are reconstructed from the SDF gradient using finite differences, used for real-time lighting and shadowing.
The current lighting model is based on simple ambient and diffuse shading, with soft shadows computed through secondary raymarching toward the light source and checking for light obstruction.
Image quality is improved through optional supersampling anti-aliasing, where multiple subpixel samples are evaluated and averaged per pixel.
The project also includes a lightweight ImGui-based editor to modify scene parameters interactively during runtime.
Future Improvements
- Configurable per-shape composition operations
- Reflections
- PBR shading
- Additional texturing
- Improved anti-aliasing (exploring multiple approaches)
- Performance optimizations
Gallery
Coming soon.