COMPUTER GRAPHICS II HW 3

Ali Kömürcü
2 min readJun 3, 2023

--

In this assignment, we will render volumetric clouds with procedural noises, and ray marching. Even though I have learned the topics well, the implementation is not easy to me for this time, as I said, this one was though.

I have rendered the static skybox as same as the HW2. And I started to design how to render a quad, and how to draw a volumetric cloud inside this quad.

Rendering quad is trivial, however wearing glasses to the camera is not easy for me. I thought much about this issue, and for two days, I could not solve it. However, finally I have managed to make the camera wearing glasses. Just ignoring the projection matrix in the vertex shader of the quad, and setting a fixed viewing matrix for the quad have solved this issue.

And now it is time for the god damn quaternions! I have terrible experiences with the quaternions. There are so many conflicting things, even the multiplication order changes a lot. Anyway, after hours long searches, readings, combinations and implementations, I have managed to calculate quaternions correctly.

So here it comes, the clouds. Although I believed that I learned the topics well, in fact I realise that I did not know them at all. Therefore, I revised the topics many times and examined the implementations on internet. Then I started to implement Perlin noise function which are included in the lecture slides. However, the implementation was not behaving as I want, so I made a similar implementation to this implementation. Here is my main method for fragment shader:

I have issues while implementing the ray marching too, for example discarding the fragments that are not changing at all. Here is the problematic clouds:

You can see the defects at light blue colored clouds. So, I realized that in ray-marching step I did not alter the alpha values, after adding alpha values in each ray march step, I managed to solve the issue. And here is the final results of the rendering process:

--

--