CST 325 - Graphics Programming (Week 6)
Light Transport
Concepts
- Surface Interaction: transmission – pass through; specular – reflect through mirrored direction; diffuse – reflect uniformly; absorption – absorbed into the material; emission – a source of light
- BRDF: Bidirectional Reflectance Distribution Function, which is the percentage of light reflects toward the eye. The function returns the probability of much light comes in and goes out. It is called Bidirectional because it is Symmetric. Switching the in and out gives the same result.
- Rendering Equation: account for light that reaches x from any valid direction. It is recursive and has no analytic solution. We need to calculate how light moves from other surfaces throughout the entire scene.
- Global vs Local Illumination: direct and indirect are both lights bouncing from surface to eye. Direct only bounce at most one and indirect bounce multiple times. Local Illumination only has Direct light, which is easy for rasterization (Indirect is fake with constant minimum value). Global Illumination has both. It’s costly and Path Tracing is the best approximation.
- Lightmapping: a way to render light by precomputing and store in textures as second set of UV coordinates (grayscale values). However, the light and geometry cannot move, change direction and intensity. However, it laid a foundation for half – measure for dynamic global illumination.
- Ambient & Phong Lighting: ambient light is constant to all surfaces of geometry. It approximates the effect of indirect lighting with minimum brightness of 10%. Phong lighting is a combination of ambient light + diffuse lighting + specular lighting, which gives a higher detail of depth and color for the same geometry.
- Basic Light Source: Point light emanates light in all direction (light calculation - light source’s position and distance). Directional light comes from the same direction (light calculation - light source’s position). Spotlight comes from one point to a concentrated area, with inside (umbra) and outside (penumbra) angle. Inside area doesn’t reduce light brightness like outside, and light calculation based on position and distance.
- Light direction & Normals: two most critical elements in light calculation. Illustration evolves based on light direction and normal per face, vertex or pixel. The evolution: flat shading, Gouraud shading, Phong shading, better Phong shading.
Application
This
week’s programming assignment is the most challenge so far (beside the
reflection that I didn’t try). However, the achievement after completing it is
very satisfying, turning the frustration and challenges into fun and enjoyable
experiences. So many times, I laughed at my own failed results or feeling
amazed with the success ones (I love color transitioning effect).
Starting
with the weekly material as usual, I was overwhelmed due to lots of combining
information from last week. In addition, the appearance of the final project on
the last video made me feel nervous. I have to account for many things, and I
understood that I need to complete this week’s programming assignment
thoroughly in order to work on the final project. So, want it or not, I had to
start working on the programming assignment with unclear and overwhelming
knowledge in my mind.
But
the first few Todos were not as bad as I expected. There were a few obstacles,
but I managed to get through while asking ChatGPT to clarify some materials
along the way (especially with Phong Shading). The major problems began when I
started working with a light position. Time after time, I had to find a way to
work from Matrix to Vector, and Vector to Matrix (hard to keep track many
times). Meanwhile, passing to the shaders wasn’t easy either. However, I tried
different approaches, debugged the coordinates onto console, and developed my
theory and plan before asking the ChatGPT to clarify. However, there were many
times ChatGPT tried to guide me in different ways with its code, so I had to
develop my own way, such as Matrix.multiplying(Vector). ChatGPT didn’t know
that and gave me: Vector.multiplying(Matrix).
And
lastly, the most important part of this assignment that is necessary for the
final: rotating the light sphere. I remembered previously in Programming
Assignment Week 3 where I had to rotate the moon similarly. However, at that
time I was making the rotation matrix only. Then, I remember the earth – moon
rotation where I had to combine many matrices. That gave me a hint in order to
make the light, and the light sphere rotate as I need.
Now,
feeling more confident, I believe I can handle the final project (or at least
the rotation of all planets). Besides feeling nervous, excitement is also
feeling up inside my mind. Of course, there are other elements such as shading,
lighting, geometry that I need to worry about, but this programming assignment
made me ‘believe’.
Visual Documentation
![]() |
.gif)
.gif)
.gif)
.png)
Comments
Post a Comment