CSE168 Final Project Proposal

Rendering Equation

$$
L_r(x, \omega_o) = L_e(x, \omega_o) +
\int_{\Omega}f(x, \omega_i, \omega_o)L_i(x, \omega_i)(n \cdot \omega_i)\ d\omega_i
$$

Introduction

For final project, I am going to implement algorithms related to transparent materials. In particular, I would like to create images with realistic refractions and caustic effects. Below, I will discuss what I have done so far, and what I plan to implement for this project.

Refactoring the Code

The first thing I did is refactoring the code. In submission of project 4, my PathTracer.cu almost reached 600 lines. So, before writing any new code, I first adjusted the structure of my path tracer, and extract codes related to BRDF, PDF and importance sampling into a new header file BSDF.h. In the end, I reduced PathTracer.cu to around 300 lines, and new BSDF.h has a clear structure of functions evaluating and sampling each material.

Loading Models

Previous projects support spheres and meshes made up of triangles. However, information of triangles need to be provided in the scene file in a unique way. To have a more flexible control of the scene, I implemented functions to load .obj files. This is achieved by a single command, and other components of the scene can be specified the old way. Now, I am able to compose new scenes with complex meshes easily.

1
2
#sphere 0 0 0 1
obj Scenes/final/bunny.obj

For example, with the minor change I show above, I can load the Stanford bunny into the scene:

Sphere Bunny
Sphere Bunny

With similar modifications, I also replaced spheres in GGX scene by Stanford bunny. This simple model loading command is compatible with all old material parameters, and position transformation commands. New models can also be sampled correctly by old importance sampling methods.

The library I used to load .obj files is libigl. This powerful mesh processing library also provides interesting functions like model decimation:

Bunny with 5,000 Faces Bunny with 500 Faces

Simple Glass Material

Next, I implemented a simple glass material which only considers refractions and total inner reflections. New material can be specified by brdf glass.

The problem brought by this new material is that we can no longer do NEE when our sampling ray is blocked by the glass object. Because, after the sampling ray get refracted, it would no longer point to the region of the light source we initially sampled. One solution is to completely turn off NEE. But it requires a lot more samples for decent results.

256 Samples without NEE 2048 Samples without NEE
256 Samples without NEE 2048 Samples without NEE

A trick I done is to only turn off NEE for a single ray if there is a glass object between the light source and the sampled region. This way, most regions are still rendered with NEE and noise free. Only the shadows and caustics under glass objects are noisy, but they are still correct. Although the result looks weird, it provides a quick way to debug, as it requires less samples.

256 Samples with Partial NEE 2048 Samples without NEE
256 Samples with Partial NEE 2048 Samples without NEE
256 Samples with Partial NEE 2048 Samples without NEE

Final Project Proposal

For the final project, the first thing I will implement is Fresnel effect for the glass material. This should be straightforward by generating a random number and check it against Schlick’s approximation. With Fresnel effect, the glass objects will have reflections as well. This will provide more realistic appearance.

Next, I will implement photon mapping technique. Currently, caustic effects require huge number of samples. The partial NEE method can present clean surfaces with less samples, but the shadows and caustics are noisy and unnatural. With photon mapping, I hope to render realistic caustics and clean images within a small amount of time.

Lastly, I will model a larger scene with multiple light sources and more interesting glass objects, as well as GGX and Phong objects. Together, they will fully illustrate the beautiful and realist reflections, refractions and caustics rendered by my photon mapping path tracer. If time permits, I will also implement microfacet model for refractions, so glass object can have rough surfaces.

CSE168 Final Project CSE168 Project 2
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×