Skip to content

About

C++ path tracer extending a teaching renderer, with BVH acceleration, material sampling, OIDN denoising and Windows demos.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

C++ Path Tracer

English · 简体中文

A CPU rendering project that traces light paths through 3D scenes to produce images with reflective and glass materials. Built by extending the course RTBase renderer, it combines C++ sampling and material work with BVH acceleration, multithreading and Intel Open Image Denoise.

Cornell-box render from the project

Run the Windows demo · Source · Detailed run and build notes · Attribution

What it demonstrates

  • GGX reflection and ideal-glass material paths.
  • SAH BVH traversal and tile-based CPU threading.
  • Environment sampling with multiple importance sampling.
  • First-hit auxiliary image channels and CPU OIDN denoising.
  • Path tracing, light tracing and instant-radiosity routes, with HDR/PNG output.

My contribution and background

This is my WM9M3 computer-graphics coursework project. It extends the provided RTBase renderer rather than presenting the teaching foundation as an independently written engine. My coursework work focuses on material/light transport, rendering routes, sampling, acceleration, threading, image outputs and denoising integration within that foundation.

The public repository contains the program, required demo scenes, Windows runtime components and technical documentation. Course briefs, the assessment report, reference solutions and unrelated working material are excluded. It is a graphics project rather than a playable game.

How it works

Technology or system Role Start reading
C++ rendering integrators Trace light and accumulate image samples Renderer.h
Material models Define surface reflection and glass transport Materials.h
SAH BVH Organise triangles for ray intersection Geometry.h
Sampling and light handling Select directions and evaluate illumination Sampling.h, Lights.h
Imaging and OIDN Store image data and filter noisy output Imaging.h, Renderer.h
Windows launcher Choose a demonstration and preserve its working directory Run_Demo.cmd, Main.cpp

Run the existing demo

Download or clone the complete repository, then run Run_Demo.cmd. Choose Cornell path tracing, MaterialsScene with guided denoising, Light Tracing or Instant Radiosity. Outputs are saved under Outputs/; the launcher displays the exit code and output location when the requested sample count is complete.

Requirements: Windows x64, an AVX2-capable CPU and the Microsoft Visual C++ v14 x64 runtime. Keep the OIDN/TBB DLLs beside the executable and retain the scene assets. Moving only the executable will break those dependencies.

Controls: Escape exits; WASD moves the camera; Q/E moves vertically; P saves HDR and L saves PNG. Input is handled between complete rendering passes.

Build and inspect outputs

Open RTBase.sln in Visual Studio with Desktop development with C++, MSVC v143 and a Windows SDK. Build Release / x64. Dependencies use relative paths and are included; output is x64/Release/RTBase.exe. Win32 is not supported by the bundled OIDN build.

From the RTBase/ directory, a sample invocation is:

..\x64\Release\RTBase.exe -scene cornell-box -integrator path -SPP 64 -threads 0 -outputFilename ..\cornell.hdr

The detailed notes retain integrator options, sample-count meanings, denoising flags and output conventions. Demo presets are short previews, not equal-time benchmark results.

Status and limitations

This documentation refresh checks names, source references and existing demonstration assets; it does not claim a new rendering or performance test. Per-pass console timings are not end-to-end render time.

Light tracing and instant radiosity require area lights and do not support MaterialsScene environment emission. Light tracing omits ideal camera-side specular chains; fixed, unclamped VPLs in instant radiosity can produce bright spots and dark bands. OrenNayar and Plastic remain teaching placeholders, and first-hit auxiliary channels omit surfaces behind glass.

Credits

RTBase teaching material and the CPU subset of OIDN 2.5.1 retain original notices. The environment asset's redistribution terms are unresolved in the recorded attribution. See ATTRIBUTION.md before reuse or redistribution; no new combined-project licence is granted.

About

C++ path tracer extending a teaching renderer, with BVH acceleration, material sampling, OIDN denoising and Windows demos.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages