Tuesday, December 10, 2019

cst 325 w7

This week, we learned about the challenges of rasterization based shadows, learned how to implement orthographic projection, projective texturing, and the shadow mapping algorithm.

There are 2 main approaches to rasterization based shadows: volume and image. In the volume based way, stencil shadows volumes are used to extrude polygons away from the light source and make those the shadow. In the image based approach, shadow mapping is used using pixels to utilize pixel depth from the light source. The image based approach is used currently. In the basic algorithm, the scene depth is rendered from the pov of the light  into a texture. The scene is rendered again from the eye and the pixel is calculated to be in or out of shadow using the depth texture. Then we see if the pixels world position is further from the light than the closest recorded distance for the pixel aka wesee if something is occluding the surface from the pov of the light. A problem created by this is aliasing and acne, where the shadows have blocky or patterned effects. This is solved using a bias offset so it calculates the depth to be slightly shorter.

Orthographic projection is used instead of perspective to match the direction of the light which is the same at all surface points.  The projection lines are parallel and perpendicular to the image plane, resulting in a view that is orthographic.

Tuesday, December 3, 2019

cst325 w6

This week, we learned about the basics of representing color. We also learned how scenes are illuminated as well as point, directional, and spot lighting. Finally, we studied Phong shading.

Color is a function of its wavelength represented by 3 colors and mixtures of those through addition or subtraction. Scenes are illuminated through direct and indirect lighting. When light interacts with a surface, it can scatter depending on the surface used.  Diffuse reflectors have rough surfaces so light scatters in many directions (not view dependent). In specular reflection, it is glossy so it mostly reflects in one direction (view dependent). In addition, there is ambient lighting where an object receives or reflects ambient light and gives no look of depth. The color of the pixel depends on emissive, ambient, diffuse, and specular light which depends on the light and material color in various combinations sometimes using the Lambert Law where the intensity of the reflected light is related to the orientation or where you are looking from.

Directional light doesn't depend on light source position or attenuate with distance. Point light depends on light source position and attenuates with distance. Spot light depends on light source position and attenuates with distance and buy angle from the center direction.

The basic shading models are Flat, Gouraud , and Phong. In flat shading, a single light is calculated per face which results in mach bands or a gradient effect. Dithering can be used to introduce noise to create more calculated faces and a better picture. Gouraud shading is shading per vertex in the vertex shader then sent to the fragment shader. It sometimes  creates triangles and boundaries when it should be smooth. Phong shading is shading per vertex or per pixel. Interpolate the normal across the surface and  calculating final lighting per pixel. Which removes the artifacts from Gouraud shading.

cst 499 week 8

This week, we finished writing the paper in order to do the best job possible even if it was a little bit late. Now that everything is done,...