RT²P - Real Time Ray Tracing Project
by Prashaanth in Circuits > Computers
17 Views, 0 Favorites, 0 Comments
RT²P - Real Time Ray Tracing Project
A custom-built real-time ray tracing project in the making written in C++, inspired by the foundational ideas presented in the Ray Tracing in One Weekend book series by Peter Shirley.
This project originally started as an implementation of the concepts covered in the book, but eventually diverged into a much larger experimental rendering system focused on:
- real-time ray traced rendering
- quaternion-based orientation systems
- fully unrestricted 6DOF camera movement
- interactive viewport rendering using SDL2
- low-level rendering architecture experimentation
The long-term goal of this project is the gradual development of a custom real-time ray tracing engine built from first principles.
Where Are We Now
This project is actively in the making. This repository currently represents an early-stage foundation build of the renderer. The current implementation focuses heavily on:
- renderer architecture experimentation
- camera mathematics
- quaternion rotation systems
- interactive real-time rendering infrastructure
rather than advanced rendering features.
The codebase is intentionally being developed incrementally while documenting the process through slower-paced technical writeups and explanations here.
The repository should therefore be viewed as:
an evolving rendering-engine development project
rather than a finished renderer.
Starting Point
This project was originally based on the implementation style and rendering pipeline from:
More specifically, at the given moment the project follows the architecture and concepts roughly up to the: "Moving Camera Code Into Its Own Class" portion of the book before diverging into custom systems.
From that point onward, several major systems were redesigned and extended independently.
Major Custom Systems
Quaternion Mathematics System (quat.h)
One of the most important custom-built components in this project is the quaternion implementation contained in quat.h
This class was developed specifically to support unrestricted 3D rotational control for the renderer's camera system.
Features Implemented
- Quaternion multiplication
- Quaternion normalization
- Quaternion conjugation
- Axis-angle quaternion construction
- Vector rotation using quaternion transforms
- Rotation composition through post-multiplication
Why Quaternions?
The renderer originally relied on conventional rotational approaches, but the project eventually required:
- unrestricted camera movement
- local-axis rotation
- stable compound orientation updates
Using quaternions helped avoid common Euler-angle issues such as:
- gimbal lock
- axis-order instability
- accumulated rotational inconsistencies
The quaternion system now forms the mathematical foundation of the renderer's camera orientation logic.
Fully Custom 6DOF Camera System
A major focus of this project is the development of a true 6 Degrees of Freedom (6DOF) camera system.
Unlike conventional FPS-style cameras constrained by yaw/pitch movement, this implementation allows:
- free rotational movement
- intrinsic/local-axis rotations
- unrestricted translation in 3D space
Real-Time Interactive Rendering
Unlike the offline rendering approach used in the original educational implementation, this project introduces a real-time interactive rendering loop.
The renderer:
- continuously redraws frames
- processes keyboard input
- updates orientation in real time
- reconstructs viewport geometry every frame
- streams rendered pixels directly into an SDL texture
Next Steps
Topics planned for deeper breakdowns and technical write-ups here include:
- quaternion mathematics and implementation
- 6DOF camera mathematics
- ray generation
- viewport reconstruction
- real-time rendering architecture
- SDL framebuffer integration
- rendering optimization experiments
And the GitHub repository will be updated from time to time.