Fiona Soetrisno

CSC 473 Final Project - Volumetric Clouds

Italian Trulli Italian Trulli

OVERVIEW

The goal was to be able to render some form of participating media, and I decided to try to recreate the look of clouds. I wanted to learn about how light gets scattered within volumes, and in the end, wanted to procedurally generate 3D volumetric clouds.

INSPIRATION

I had previously watched this Sebastian Lague video where he created clouds using Unity. He used raytracing and raymarching techniques in the video, so I thought that it would be a fun final project for this class. Initially I wanted to do real-time raytracing using Optix, but it took a long time to implement things so I just switched over to using our renderer from class.

PROCESS

I created a cloud material and put it on a box which would act as the cloud container. The first step was finding the density of stuff along a given ray. I used Perlin noise to get the density at a given point. Perlin noise takes in a vec3 and returns a value between 0 and 1, and they are smoothly interpolated, so it doesn’t look totally chaotic. For a given ray, we would march within the bounds of the box and sample the density at each of the points. I used this e^-density curve, which means that the higher the density is, the less light makes it through, and the lower the density is, the more light makes it through. I would combine all those samples from the ray marching to get the density for a given ray and ended up with this gray cloud where black are areas with higher density. Italian Trulli Italian Trulli The next step was to figure out how light gets scattered within the cloud. There are a lot of complicated equations that I read in papers, but the Sebastian Lague video I mentioned earlier did a good job simplifying it down and explaining it. While marching along the ray, we have to figure out how much light reaches that point in the cloud. We do this by marching along the ray from the point to the light source and figuring out the total density of that. After doing that, I ended up with some gray shading in the cloud (ignore the sparkles). Perlin noise wasn’t giving me the shape that I want, so I experimented using different image blends. In Photoshop, there are blend modes that are used to blend 2 images together. These are actually just equations. For example, multiply is just multiplying the two images together. I was able to mess around with it and got this cool looking smoke effect by applying a linear light blend.

RESULTS

Eventually I found a blend mix that I liked, and by messing around with the densityMultiplier, lightAbsorption, and darknessThreshold, I was able to create sound fluffy-ish looking clouds. You can also change these parameters to get softer clouds if you want, and I can also change the color of the light, or change the seed for perlin noise to get more variation. One of the reasons I wanted to do optix was that, in the advanced optix samples, there are these sliders that you can manipulate variables on the fly and see their changes in real-time, but it just took a long time to set up. Here are some clouds messing around with the different settings:
I had a lot of fun working on this raytracer throughout the quarter. For future improvements on the clouds, I would like to experiment with different kinds of random noise to get more empty spots, work on performance, and try to create more stylized clouds.

Resources

Sebastian Lague - Coding Adventure: Clouds Real-Time Cloudscapes of Horizon Zero Dawn Real-Time Rendering of Volumetric Clouds Practical Rendering of Multiple Scattering Effects in Participating Media