Posts

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...

HW1-Bezier Surfaces

Image
Greetings and welcome to my blog! I will start the blog with the design choices I made and show some results. After that I will discuss some topics about the implementation. Design Choices: Setup Flow: The program I have written in this homework is pretty simplistic. While writing such programs, I generally do not prefer Object Oriented Design, which I am still not sure I am a big fan of. So, I have used global variables and structs extensively. A bezier curve is represented by a struct that contains all the necessary geometric and OpenGL data. Geometric data consists of UV values required to compute Bernstein Polynomials in the shader, control points, triangulation information, etc. While processing the input file, those data in the struct have been filled. After all the necessary data have been gathered, triangulation, OpenGL buffer creation, and CPU-GPU transfer have been done.   Data in The Shader Side: Inside the layout locations, I only pass the UV coordinates of the vertices...