Posts

Showing posts from May, 2023

Homework 3: Volumetric Clouds with Ray Marching

Image
Setup: The magic happens on the shaders. The CPU only handles camera movement, static skybox rendering, and screen-size quad rendering. I have also passed the uv coordinates for the quad, as it will be helpful in casting rays. Ray Casting: Getting rays cast correctly is tricky because the camera's orientation must be considered. Initially, they are cast towards the plane at z=-1 (with respect to camera basis) by utilizing uv coordinates passed. To rotate the rays, a rotation matrix should be used with the camera basis as the rotated coordinate axes. Each basis vector should correspond to a column in the matrix. Rendering Clouds: After setting up the rays, rendering clouds is not hard. I use ray marching to obtain the volumetric clouds with a certain number of steps with a predefined step size. At each step, the point at the tip of the ray is marched by the step size, and a density is sampled at that point from the density field defined by Perlin Noise on the fly. Then, this density...

Homework 2 Blog

Image
                                                                                                                                  GTA VI           Greetings, and welcome to my blog! I will start the blog with my design choices and show some results. After that, I will show you a possible experiment with instancing. Design Choices: Setup:   I have created a mesh class that loads the mesh given its obj file and stores the properties needed to render (like VAO, number of triangles, etc.). At the very beginning of the program, I load the scene into the mesh objects. Regardi...