Skip to content

zhiyi1801/Project3-CUDA-Path-Tracer-2024fall

 
 

Repository files navigation

CUDA Path Tracer

University of Pennsylvania, CIS 565: GPU Programming and Architecture, Project 3

  • Zhiyi Zhou
  • Tested on: Windows 11, i9-13900H @ 2.6GHz 64GB, RTX4060 Laptop

Features

  • OBJ & glTF Loading
  • BVH(MTBVH) Acceleration
  • Stochastic Sampled Anti-Aliasing
  • Physically-Based Materials
  • Texture Mapping & Normal Mapping
  • Environment Mapping
  • Multiple Importance Sampling of different kind of light(sphere, cube, mesh and environment light)

OBJ & glTF Loading

The glTF (GL Transmission Format) file is a streamlined, efficient format for transmitting 3D models and scenes, designed specifically for real-time rendering applications such as 3D games, web platforms, and virtual reality. Developed by the Khronos Group, the same organization behind OpenGL and Vulkan, it is lightweight and optimized for performance. A glTF file can encompass an entire scene, including meshes, materials, animations, cameras, and lights. However, I focus on utilizing only its meshes and materials in my projects.

Avocado

Avocado

glTF file: Avocado

BVH(MTBVH) Acceleration

BVH MTBVH

Computing intersections is the most time consuming part in our path tracer. A BVH organizes a set of geometric objects, like triangles or meshes, into a hierarchy of nested bounding volumes, which allows for efficient spatial queries and reduces the computational cost of determining which objects are relevant in a given operation.

with BVH without BVH

My computer struggles to traverse millions of triangles, but thanks to BVH, the speedup is significant.

Stochastic Sampled Anti-Aliasing

with Anti-Aliasing without Anti-Aliasing

Physically-Based Materials

I implemented Microfacet material and metallic workflow in my path tracer. Here, the ball with high metallic and high roughness looks weird, this is because in microfacet model high roughness will cause energy loss.

Texture Mapping & Normal Mapping

To improve the visual quality of the scene, texture mapping is crucial. Normal mapping can further enhance surface detail, adding greater realism.

Multiple Importance Sampling

Direct Light sample(20spp) BSDF Sample (20spp) MIS(20spp)
Direct Light sample(2000spp) BSDF Sample (2000spp) MIS(2000spp)

Third-party code

  1. tinygltf
  2. Tinyobjloader

Reference

  1. glTF™ 2.0 Specification.
  2. Poly Haven
  3. Gundam Mk-II

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 88.5%
  • C 10.0%
  • Other 1.5%