University of Pennsylvania, CIS 565: GPU Programming and Architecture, Project 2
- Ruijun(Daniel) Zhong
- Tested on: Windows 11 pro, 12th Gen Intel(R) Core(TM) i7-12700K 3.61 GHz 32.0 GB, NVIDIA GeForce RTX 3070 Ti (personal computer)
Path tracing is a method used in computer graphics to create realistic images by simulating how light interacts with objects. However, this process can be very demanding on a computer's resources, especially when aiming for high-quality images. Enter NVIDIA's CUDA, a technology that allows for faster computations using graphics processing units (GPUs). In this project, I explore how CUDA can make path tracing faster and more efficient.
- Material: PBR Diffuse, PBR Glass, PBR Metal, Texture Map, Perlin Noise Texture, Ring Texture
- Shape: Torus with Displacement, Cylinder, Capsule, Displacement+ SmoothUnion of Bended Cube and Sphere
- Without Antialising
- With Antialising(50 x more random ray per pixel)
-
Caching FirstBounces: As we frequently intersect the same primary rays originating from the camera with the scene, we can cache the first bounce. This allows subsequent rays to read from the cache.
-
Compaction: Remove terminated path(ray that hits nothing), and then move the active path to the front of the "array"
-
Material Sorting: When rays bounce and hit materials, the resulting data can be mixed up and out of order. During shading, threads can work on different materials at once, causing inefficiency. To fix this, we sort the data by material type first, so threads work on the same materials together.
-
Denoise: Please check Denoiser Branch!
Based on the provided chart, compaction significantly impacts the open box scene because there are more terminated rays in this setting. Refer to the chart below for a comparison of ray numbers between the closed box and the open scene. Furthermore, as the number of material types increases, the sorting of materials becomes more pronounced.
Solution to this bug: make sure z axis is positive for both left and right hand coordinate
AntiAlising isn't correct(Solution: make sure random ray apply to all stages including generate ray, intersection, shading etc.)
Material Sorting will mess up if turn on antialising
Other intersting bugs that can't show directly through picture:
- Glass material keep showing error(Solution: rewrite sphere intersection)
- GLTF obj not loading(Solution: reExport from modeling application and make sure the format is match the triangle intersection in accesor, bufferview, mesh etc.)
- Metal and Glass not reflecting skybox
- Failed to implement BVH, incorrect normal value
- etc.
Ray Tracing in One Weekend including:
- Diffuse, Metal, Glass Material
- Sphere Intersection Test
- (MSAA) Camera Multisampleing Antialiasing with random ray
Ray Tracing: The Next Week including:
- Skybox Sphere Texture
- Procedure Texture(Perlin Noise)
Ray-Tracing: Rendering a Triangle including:
- Triangle Intersection Test(Moller-Trumbore algorithm)
Inigo Quilez including:
- SDF Normalize Formula
iquilezles.org including:
- Procedure Shape Formula
syoyo/tinygltf & Reddit including:
- Extract GLTF object mesh to triangle index buffer
cgtrader & SolarsSystemScope including:
- gltf 3d model and textures
Schlick's approximation including:
- PBR Diffuse, Metal, Glass with Frensel effects using Schlick's approximation
pbrt including:
- Physically-based depth-of-field (by jittering rays within an aperture)