Skip to content

DanielQ-51/cpp-path-tracer-workshop

Repository files navigation

ESAP Path Tracing Workshop

By Daniel

This is a workshop for implementing a very basic naive path tracer. Feel free to look around the different files, but your task is just to fill in the function renderPixel() in render.cpp. You will do so by managing the core path tracing logic and math, while using provided functions to help you.

You should use traceClosestHit() in intersections.h, fetchGeometry() in intersections.h, sampleBSDF() in bsdf.h, and generateCameraRay() in camera.h. You can look them up in their respective files for their documentation.

The way that this renderer works is by reading in .obj files that you tag with colors (albedo), and emission. You can use any obj file your heart desires, including the characters you've been working on! I would suggest importing the existing cornell box meshes to get the scale right. Then, its as simple as exporting as an obj and dragging into the codespace editor, into the meshes folder. Make sure that the file has normals!

Good luck and have fun!

Use the following command to compile:

g++ -O3 -std=c++17 -fopenmp main.cpp render.cpp -o render.exe

And use the following command to run:

./render.exe

Credit to the stb image header library for the image file IO used here. https://github.com/nothings/stb

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages