top of page

For the final project, I added a couple features:

  • Multi-threading

  • Dielectric Material

  • Caustic

  • Lambert-beer Law / Absorption Material

  • Dispersion

Caustic

Caustics are caused by light being focused to certain area due to the fracrtion of transmissive material. I implemented area light, and by sampling the indirect light pass, can create a subtle caustic effect, though a more decent way is to use Photon Mapping.

Simple geometry such as sphere can create obviouse caustic effect (top image); while complex mesh like the dragon make the caustic more subtle (the bottom image's light's setting also did not help to create a strong caustic effect)

Dielectric Material

Dielectric Material is based on Fresnel's Equation. When a ray hits a Dielectric surface, it first checks if the ray is inside the mesh.  If so, it needs to swap the index of refraction. I used the face normal to do such check: if the dot product of the face normal and the ray direction is negative, then the ray is escaping from the material, otherwise it is entering the material.

Beer-Lambert Law / Absorption Material

My first failed implementation of dispersion led me to the implementation of Beer-Lambert Law. The absorption coefficients are not physical based.

Green Glass without absorption

 material with absorption

Comparing the two image, the right dragon has high absorption coefficient for red and blue light, and low absorption coefficient for the green light. It creates a more jade-like texture comparing to the left draon.

Dispersion

To render dispersion effect, I add an ior - index of refection field to my ray class. When a ray first entering a dispersion surface, an ior is assigned to the ray and will not be changed. a secondary ray inheritance its parent ray's ior until it enters another dispersion surface. 

To generate the ior for the ray, I first pick a random number from 0 to 1. Using this random number, I assign a HSV color to the ray, simulating the dispersion effect. The HSV color need to be converted back to RGB color when rendering. The corresponding ior is plus/minus 0.1f from the material's original ior.

My first attempt to render dispersion is using wavelength and cauchy's equation. However the wavelength converting process is very complex and introduced bias to my image, resulting in a yellowish prism. Failed to solve this I turned to the implementation I am currently using.

​

As the sample number gets bigger, the color noises decrease, and made the dispersion harder to notice for simple geometries. The top image is rendered with 900 samples/pixel; the bottom image is rendered with 2500 samples/pixel. I slightly turn the angle when rendering the bottom image. For a close look, we can still see the slight dispersion color around the corner.

As the mesh gets more complicated, it became easier to observe the dispersion color. This image is rendered 4900 samples/pixel. The increase of samples also makes the caustic effects more obviouse.

Summary

The top diamond is rendered with dispersion, the bottom diamond is without dispersion. Notice the color band at both the surface and the caustic

CSE168-final-project created by Yunlu Huang

bottom of page