CPU Ray Tracing application exhibiting basic Global Illumination effects. The application displays a Qt UI with two windows: the left window shows the scene rendered using OpenGL (immediate mode), while the right window displays the equivalent ray-traced scene.
- Blinn-Phong shading - Affected by standard
.mtl
properties {Ka
,Kd
,Ks
,Ke
} - Fresnel - Controlled by custom
.mtl
propertyN_ior
(see Typical values) - Reflections - Controlled by custom
.mtl
property0 <= N_mirr <= 1
- Refractions - Controlled by custom
.mtl
property0 <= N_transp <= 1
- Shadows - Single shadow ray test
- Area Lights - 20 shadow samples
- Interpolation - Render normal as
[r, g, b] = abs([n.x, n.y, n.z])
- Orthographic - Renders scene using Orthographic or Perspective camera
soft-trace/
├── src/ # Source code
├── assets/ # Static assets (.obj and .mtl files)
├── soft-trace.pro # QMake project
└── README.md # Project README
qmake
make
bin/soft-trace <.obj> <.mtl>
Example:
bin/soft-trace assets/cornell_box.obj assets/cornell_box.mtl
The asset files must be well-formed for the application to work. See Material.h
for custom .mtl properties used.
Example files are provided.
- C++:
>= C++17
- Qt:
5.12.x
- OpenGL:
>= 4.0
- OpenMP:
>= 4.5
- GLM:
1.0.1
Newer versions of Qt might work correctly, if no breaking changes that affect the application were introduced.