Skip to content

JA8. Learning Journals 8

1. Discuss the week’s activities and your observations

I started this week by reading the material and watching the videos. The slides from MIT were particularly complex and deep into details to the point that I could not understand fully; hence, I needed to look for external resources like YouTube. I then did the quiz and the learning journal. This is the last week of the course, so I needed to fill the feedback form and prepare for the final exam.

The topics of this week included ray casting, ray tracing, and recap of rasterization. In the process we learned about reflection, refraction, lighting, primary rays, secondary rays, and how these concepts are used in computer graphics to achieve more realistic images. The material also included some math and programming examples covering the topics of the week.

Did anything surprise you this week?

I was surprised how clever and complex the ray tracing algorithm is. It works in un-natural way by emitting light from the camera and tracing rays to the light source. This is the opposite of how light works in the real world. I was also surprised by the complexity of the math involved in the ray tracing algorithm. Splitting the algorithm into clear and separate steps made it easier (Gambetta, n.d.):

O = (0, 0, 0)
for x = -Cw/2 to Cw/2 {
    for y = -Ch/2 to Ch/2 {
        D = CanvasToViewport(x, y)
        color = TraceRay(O, D, 1, inf)
        canvas.PutPixel(x, y, color)
    }
}

Did you face any challenges this week? How did you overcome them?

The difference between ray casting and ray tracing was challenging to me. Both techniques seemed the same to me at first, but after reading and looking different sources, I learned that ray casting is a special implementation of ray tracing and is usually faster (Permadi, n.d.). I also learned that ray casting sends rays in groups (e.g. send rays for each row of pixels at once), while ray tracing sends rays individually (e.g. send rays for each pixel).

I learned that ray casting is faster, suitable for real-time rendering, has lower quality, and is less flexible. I also found it challenging to understand the math behind reflection and refraction, but because it is not not really my field of expertise, I did not go deep into the details and relied on the high-level understanding of the concepts.

2. Discuss how Reflection and Refraction are used in computer graphics to achieve more realistic images

Reflection and refraction are two natural phenomena that affects light hitting objects in real world. Although computer graphics treats light differently, there are ways to simulate these phenomena to achieve more realistic images. In computer graphics, light is emitted from the camera and bounces off objects to reach the light source. We usually trace secondary rays to light sources to determine the color of the pixel (Rueckert, 2002).

Reflection is the process of rays bouncing off a non-transparent surface generating a new secondary ray(s). The secondary rays properties depend on the surface properties and the laws of reflection (ScratchPixel, n.d.). When hitting a mirror-like surface, the secondary ray can be computed easily by reflecting the incident ray about the normal of the surface. However, when hitting a rough surface, computing the specular reflection is more complex and requires more rays to be traced (ScratchPixel, n.d.). The process is recursive, meaning that each of the secondary rays can generate more secondary rays, and so on.

Refraction is the process of rays passing through a transparent surface and changing direction a bit. There is only one refracted ray for each incident ray; however this ray is considered a primary ray because it is a continuation of the incident ray and has the same normal (Comsol, n.d.). Computing the bended ray is done using Snell’s Law which indicates a relationship between the angles of incidence and refraction (ScratchPixel, n.d.).

The effects of reelection can be seen in mirrors, water, and other reflective surfaces where a glimpse of the surrounding objects (may not be visible in the original view) can be seen. The effects of refraction can be seen in lenses, glasses, and other transparent surfaces with objects appearing to be bent or distorted when viewed through them. The end goal of all of this is simulating as much as possible from the real world.

References