Our life was hell this semester, but with the semester ending and summer starting we are hoping our lives will have some more color in them.
Image Source: Physically Based Rendering, Chapter 5
We wanted to add physical effects of wavelength to our renderer. The effect we were most interested in is the physics of rainbow formation. This process involves diffraction of light to split it into its component wavelengths. To simulate this, we add a wavelength component to our ray. Once the rendering equation is solved for the ray, we project the color sample to the XYZ basis using the wavelength, and then finally get the RGB color from it.
Image Source: Physically Based Rendering, Chapter 5
Before the rainbow theory formulated by Lorenz-Mie, the Greek philosopher Aristotle had a simplified theory for their formulation. This simplified theory which we follow was presented in [1]. It assumes that the sky is a hemispherical dome, and the rainbow is rendered where the angle between the vector to the sun (a pointlight) and the view direction is about about 42 degrees. Additionally a cubic hermite spline interpolation is used to get the wavelength corresponding to the angle. This wavelength is then converted to an RGB color using the process outlined above. The sky is simulated using Perlin noise with five octaves.
Image Source: [2]
Light is refracted multiple times in a water droplet also causing it to be reflected. The paper we refer to here is [2], which forms an approximate theory of diffraction. The refractive index is modelled as a function of the wavelength. The idea here was that we would be able to see the splitting of the spectrum into its wavelengths. While there are some spectral artefacts visible, the splitting of the spectrum itself is not visible. Our hope was that using volume rendering these artefacts would be more visible as we could further model the diffraction of light along the medium.
Image Source: [2]
We shoot multiple rays per pixel to reduce the aliasing artefacts. On the left is the image with aliasing artefacts visible.
We used a Bounded Volume Hierarchy for speeding up intersections of rays with objects. This resulted in a 40x+ speedup in rendering.
The rendering code is parallelized using OpenMP.
We implemented volume rendering using ray marching. This however does not feature in the final submission due to resource constraints.