The calculations and rendering are done in real time using OpenGL.
 I upload the whole Scene (only consisting out of Cuboids and Spheres for now) to

JulianStambuk / OpenTK-PathTracer Public

submited by
Style Pass
2021-09-26 16:30:09

The calculations and rendering are done in real time using OpenGL. I upload the whole Scene (only consisting out of Cuboids and Spheres for now) to a UBO which is then accessed in a Compute Shader where all the Path Tracing happens. Due to the realistic nature of Path Tracers various effects like Soft Shadows, Reflections or Ambient Occlusion emerge automatically without explicitly adding code for any of these effects like you would have to do in a traditional rasterizer.

The renderer also features Depth of Field, which can be controlled with two variables at runtime through ImGui. FocalLength is the distance an object appears in focus. ApertureDiameter controlls how strongly objects out of focus are blured.

If a ray does not hit any object the color is retrieved from a cubemap which can either be 6 images inside the Res folder or a precomputed skybox. The atmospheric scattering in this skybox gets calculated in yet an other Compute Shader at startup.

Leave a Comment
Related Posts