diff --git a/finalproject/index.html b/finalproject/index.html index 93b3b41..547672a 100644 --- a/finalproject/index.html +++ b/finalproject/index.html @@ -25,9 +25,9 @@

Abstract

Through this project, our goal was to render the Tyndall Effect by shooting a ray through a volumetrically rendered medium. We approached the problem by first rendering both homogenous and heterogenous fog. We implemented - ray marching where we had to account for the probabilities of absorption, scattering, and transmittance for each - step. As for heterogenous fog, we implemented a Perlin Noise to vary the densities when traveling through the - medium. + ray marching where we had to account for absorption, scattering, and transmittance interactions between the + particles and the medium. As for heterogenous fog, we implemented a Perlin Noise function to vary the densities + when traveling through the medium.

@@ -41,17 +41,17 @@

Technical Approach

Starting Point & Problem Context

Our starting point for this project is the CS 184 Project 3 ray tracer. The skeleton code includes the ray-scene - intersection, acceleration structure, and physically based lighting and materials. While our starting point able - to generate realistic images, it lacks of the implementation of spotlight and advanced volumetric rendering + intersection, acceleration structure, and physically based lighting and materials. While our starting point is + able to generate realistic images, it lacks the implementation of a spotlight and advanced volumetric rendering techniques that are required to depict phenomena like the Tyndall Effect. To address the issues, we expanded the - render's capabilities by including a complex volumetric rendering, - implementing both homogenous and heterogeneous fog. + render's capabilities by including a complex volumetric rendering, implementing both homogenous and heterogeneous + fog.

The Tyndall Effect is a optical phenomenon where light is scattered by particles that are dispersed in a medium. - This effect causes the particles, like dust or droplets, become visible when light shines through them. + This effect causes the particles, like dust or droplets, to become visible when light shines through them. - In this project, by focusing on rendering fog and cloud effects, we essentially demonstrate the Tyndall Effect. + In this project, by focusing on rendering fog and cloud effects, we essentially render the Tyndall Effect. Fog, consists of tiny water droplets that suspends in airs, will scatter the light passing through them.

Homogenous Fog

Initial idea

@@ -100,12 +100,13 @@

Ray Marching

Distance Attenuation Variation

-

by adjusting coefficients and power of the exponential attenuation function, we obtain different levels of radiance - fall of in - the area near the light. Here is a Desmos graph of different exponential fall of function:

+

By adjusting the coefficients and power of the exponential attenuation function, we obtain different levels of + radiance fall of in the area near the light. Here is a Desmos graph of different exponential fall off function: +

-

which in turn produce the follow different size of radiance fall of (haze area) in the fog near the area light.

+

Which in turn produce the following different size of radiance fall off (haze area) in the fog near the area light. +

@@ -160,20 +161,18 @@

Updated Ray Marching

Perlin Noise Octave

While Perlin noise are commonly used in generating natural texture, the addition of octaves give clouds the extra - furry effect and additional layer of detail and complexity. This method invovles with combining several Perlin - Noise - function at different frequencies and amplitudes. When generating texture like clouds, using multiple octaves - allows - for creating more varied patterns. The low frequency Perlin noise provides a broad and main shapes of the cloud. - The second and higher octave, on the other hand, provides variation in the cloud's edges and them more - natural-looking. + furry effect and additional layer of detail and complexity. This method involves with combining several Perlin + Noise function at different frequencies and amplitudes. When generating texture like clouds, using multiple + octaves allows for creating more varied patterns. The low frequency Perlin noise provides a broad and main shapes + of the cloud. The second and higher octave, on the other hand, provides variation in the cloud's edges and them + more natural-looking. Here is a nice chart from .

- octave function + Octave function
@@ -181,22 +180,22 @@

Perlin Noise Octave

- cloud with 3 octave and 0.7 persistence + Cloud with 3 octave and 0.7 persistence
- cloud with 4 octave and 0.5 persistence + Cloud with 4 octave and 0.5 persistence
- cloud with 5 octave and 0.7 persistence + Cloud with 5 octave and 0.7 persistence
- cloud with 3 octave and 0.7 persistence + Cloud with 3 octave and 0.7 persistence
@@ -213,7 +212,7 @@

Spot Light Sampling

the vector pointing toward the object. We denote the angle as spot_angle

- If the spot_angleis less than the predefined angle of the spotlight, it indicates the object + If the spot_angle is less than the predefined angle of the spotlight, it indicates the object is within the light's cone and the illumination should be calculated. The falloff is calculated to @@ -227,11 +226,9 @@

Spot Light Sampling

\[ p = \frac{1}{\Omega} = \frac{1}{2\pi (1 - \cos(\text{angle}))} \] By adjusting the PDF according to the solid angle, the function ensures the density reflects the physical - behavior - of a spotlight, where more light is concentrated in a narrow angle. The function will return the light - radiance - scaled by the falloff. If the object is outside the spotlight's angle, the function returns a zero vector, - indicating there's no light contribution, which effective handles objects lying outside the light beam. + behavior of a spotlight, where more light is concentrated in a narrow angle. The function will return the light + radiance scaled by the falloff. If the object is outside the spotlight's angle, the function returns a zero + vector, indicating there's no light contribution, which effective handles objects lying outside the light beam.

@@ -281,12 +278,14 @@

Dae file generation

Lessons Learned

-

Understand the underlying math principles first: Debugging the rendering code is hard as it is challenging to - trace errors back to their source. For instance, in the creating a spotlight, it's essential to understand the - Monte Carlo Integration on the 3D cone shape object. Without a deep understanding of the math involved, - identifying the root cause of such problems becomes significantly more complex. +

+ To try to understand the underlying math principles first: Debugging the rendering code is hard as it is and + challenging to trace errors back to their source. For instance, in the creating a spotlight, it's essential to + understand the Monte Carlo Integration on the 3D cone shape object. Without a deep understanding of the math + involved, identifying the root cause of such problems becomes significantly more complex.

-

To breakdown a big goal into smaller milestones: it was hard for us to get started on rendering the Tyndall Effect +

+ To breakdown a big goal into smaller milestones: it was hard for us to get started on rendering the Tyndall Effect as it involved complicated algorithms. If instead we had just set a series of incremental targets, we could have made this project easier. Initially, we could have focused on understanding the physical principles and math models behind light scattering. Then we could have changed the BSDF to achieve a more realistic effect. Following @@ -301,13 +300,12 @@

Next Steps

Color Scattering

- We attempted rayleigh scattering by having blue color exponentially decaying throughout distance, and red color - exponentially increasing throughout distance. This is supposed to give a blue cloud and yellow rays through the - cloud (similar to the sunset), but we are not able to completely incorporate ray marching of the cloud with - recursive - bounces of the original ray tracing mechanism. We have tried dynamically shifting the color of L_out, the emission - of light or material based on the average density from the hit point to the light source and the rayleigh - scattering formula, but more work needs to be done. + We attempted rayleigh scattering by having blue color exponentially decaying over distance, and red + color exponentially increasing over distance. This is supposed to give a blue cloud and yellow rays through + the cloud (similar to the sunset), but we are not able to completely incorporate ray marching of the cloud with + recursive bounces of the original ray tracing mechanism. We have tried dynamically shifting the color of L_out, + the emission of light or material based on the average density from the hit point to the light source and the + rayleigh scattering formula, but more work needs to be done.

Better Light Shafts