CG-Projects

Project Report - Rendering Algorithm

Taiki Yoshino, David Choi
University of California San Diego, Computer Scinece and Engineering
CSE168 Rendering (2024 Spring)
Used Tools: C++, CUDA, NVIDIA Optix 6.5

Ray Tracing with NVIDIA Optix

We implemented ray tracing using c++ and NVIDIA’s OptiX. The GPU-based ray tracer achieved lightning-fast rendering, and the dragon was rendered in less than 2 seconds with a BVH acceleration structure.

(Milliseconds) Without BVH With BVH
C++ (CPU) 50,942,720 8,775,658
CUDA (GPU) 3,552 1,998

Direct Lighting

We implemented direct light sampling for area light sources using both analytic and Monte Carlo solutions. The analytic solution computes the incident radiance from a polygonal light source by projecting it onto the unit hemisphere and then onto the unit disk. Although the solution is efficient to compute and noise-free, it only works for scenes without shadows. On the other hand, the Monte Carlo solution is computationally expensive and includes noise, but it can handle arbitrary BRDFs and use shadow rays to determine if the light source is occluded.

Analytic

direct3x3

direct9

Sphere

Indirect Path Tracing

To account for indirect lighting, where a surface is illuminated by light bounced off other surfaces, we implemented Monte Carlo path tracing. Since path tracing requires higher computational cost, we improved efficiency using Next Event Estimation (NEE) and Russian Roulette (RR). NEE improves convergence by directly sampling light sources at each bounce, reducing variance and speeding up rendering by capturing important lighting interactions more efficiently. RR optimizes performance by probabilistically terminating low-contribution paths, reducing computations while maintaining an unbiased estimate of the rendering equation.

cornellDirect

cornellSimple

cornellNEE

cornellRR

dragonDirect

dragonGI

Importance Sampling

We introduced importance sampling methods into our renderer to compute indirect lighting more efficiently. The previous method, Uniform Hemisphere Sampling, distributed samples uniformly, often allocating them to less important directions, leading to slower convergence and increased noise. To improve this, we implemented PDF-based sampling techniques, specifically Cosine-Weighted Sampling and BRDF Importance Sampling. These methods prioritize sampling directions that contribute more significantly to the final radiance, improving rendering quality and efficiency.

cornellCosin

cornellBRDF