RepositoryC++SESweden
kbladin

kbladin/Monte_Carlo_Ray_Tracer

A program with an implemented Monte Carlo Ray Tracer algorithm for global illumination of a virtual 3D scene.

147stars
32forks
1issues
5views

Monte Carlo Ray Tracer

This project is a program for rendering virtual 3D scenes with the global illumination algorithm Monte Carlo ray tracing.

The algorithm recursively trace light rays from the camera out in the scene and bounces them around on / through the surface of objects.

The project was made for the course Advanded Global Illumination and Rendering, TNCG15, at Linköpings University.

Features

  • Some predefined object classes (spheres, planes).
  • Possibility to load triangle meshes in to the scene.
    • Octree data structure used to partition triangles for faster rendering.
  • Material properties for 3D objects
    • Diffuse color
    • Specular color
    • Reflectance [0, 1]
    • Specular reflectance [0 (diffuse), 1 (mirror)]
    • Transmissivity [0, 1]
    • Refraction_index [1 (air), 2.4 (diamond)]
    • Roughness [0, inf) Used for evaluation of the Oren-Nayar BRDF
  • Monte Carlo ray tracing algorithm, simulates many light phenomena:
    • Color bleeding
    • Soft shadows
    • Reflection
      • Currently not considering the Fresnel effect.
    • Refraction
      • Uses Schlick's approximation to Fresnels equations for reflected part.
  • Photon mapping for caustic effects.
    • Using a kd tree from the c++ library "kdtree++" by Martin F. Krafft.
  • Simple paralellization using openMP.
  • Using the XML parser pugixml to be able to load XML files describing the scenes.

Future Work

  • Implement a depth of field technique.
  • Other optimizations (reduce cash misses, simplify code, precomputing, better paralellization technique).
  • Make different wavelengths refract a different amount and increase number of wavelengths.
    • This way it is possible to achieve rainbow effects from refraction.

Similar Projects

Discover other similar projects and AI models.

RepositoryC++
LuxCoreRender/LuxCore

LuxCore source repository

1.4k
Nov 26, 2026
RepositoryC++
aromanro/RayTracer

A ray tracing program

138
Dec 31, 2025
RepositoryC++
Vertexwahn/FlatlandRT

FlatlandRT is a 2D ray tracer visualization tool

76
Jul 21, 2026
RepositoryC
biroeniko/raytracer

My very first ray tracer implementation.

128
Sep 11, 2019
RepositoryC++
diharaw/helios

Real-time unidirectional GPU path tracer using the cross-vendor Vulkan ray-tracing extensions.

300
Sep 21, 2021
RepositoryC++
wkjarosz/SamplinSafari

Samplin' Safari is a research tool to visualize and interactively inspect high-dimensional (quasi) Monte Carlo samplers.

163
Aug 30, 2025
RepositoryC++
TzuChieh/Photon-v2

A program that takes photographs of a virtual world.

96
Oct 27, 2026
RepositoryC++
GOMC-WSU/GOMC

GOMC - GPU Optimized Monte Carlo is a parallel molecular simulation code designed for high-performance simulation of large systems

92
Nov 24, 2026
RepositoryHTML
RayTracing/raytracing.github.io

Main Web Site (Online Books)

10.8k
Aug 10, 2026