Implementation of a Monte-Carlo raytracer in C++. This project was done for the course TNCG15 at LiU, ITN during the fall of 2020.
- [Should be resolved] RGB values might not be normalized to [0, 255] in some cases
- Möller-Trumbore check might fail sometimes due to doubleing point errors
- Area light source appears gray-ish when it should be white
- Cosine term from rendering equation as
lightAmount
cause shadow-acne for some reason
- Ignore rays that end on light sources, use penultimate ray as final ray.
- Figure out why rays seem to get trapped inside of boxes and tetrahedra.
- Refactor code base
- Separate code into more files
- Collect forward-declarations in one header file, which is included first
- Replace
Color
withglm::dvec3
- Use either
snake_case
orcamelCase
for variables/methods (PascalCase
for classes) -
Color
convenience methods and constants
- Oren Nayar surfaces
- Transparent surfaces
- Set const rendering parameters
- Lightning sample amount
- Importance reduction
- Russian roulette cutoff
- Walls
- Möller-Trumbore algorithm for triangle intersections
- Set up CMake for building the project
- Handle dependencies with CMake
- Set up GLM library as dependency
- Set up PNG++ library as dependency
- Implement (simple) rendering loop
- Iterate over all pixels
- Send rays through each pixel and set the color of the pixel to the color of the first intersected triangle
- Move class/struct definitions into header files
- Create implementation file for class memeber functions
- Make triangle verticies public/add getter functions
- Get XYZ components from a
glm::DVec4
- Changed dvec to vec
- Camera should have separate render and create_image functions
- Render: Cast all the rays and calculate the doubleing point color values of each pixel
- Create image: Convert the doubleing point RGB values to
png::byte
- Save render results to an image
- Convert from
double
-valued colors to 8 bit unsigned integer values - Find a way to push pixel values into some kind of an image format in C++
- Convert from
- Simple local lighting model
- Implement lights in the scene
- Check that the triangle normals make sense
- Implement scene objects
- Tetrahedron
- Sphere (implicitly with radius) MOA
- Handle mutliple ray intersections, using the nearest intersection
- Shadow rays on "local light check"
- Is there an intersection for the ray going from the object to the light source?
- Handle "ray trees"
- Spawn more rays when intersecting something reflective/refractive
- Calculate intensity values for the ray by working from the ends to the original ray
- Go up one directory:
cd ..
- List the items in a directory:
ls
- List all the items:
la
- Make a new directory:
mkdir [name]
(e.g.mkdir build
)
From the root directory of the project (e.g. craytrace
)
cd build
cmake ..
(sometimes you need torm -rf build/*
fromcraytrace
first to restore build)cmake --build .
./CRaytracer
(or whatever the binary is called. tip: tab is your friend)
Developed by:
- Frans Johansson
- Moa Gutenwik