Wednesday, January 7, 2009

Checkpoint 3 - Basic Shading using Phong Shading Model

One light Source- the color of the floor changed from green to red because
I'm in the middle of working on the procedural shading for the plane.
It was not complete at the time I render these images. This image used Phong Illumination Model.
3 light sources -- you can see 3 different specs clearly on the blue orbs. Still use the Phong Model.

Phong-Blinn Model -It turn out that the halfway vector is much easy to calculate that the reflectant vector. You does see the different in the spec clearly. This image is render with only one light source.
Problem solves! Morals: 1- Don't normalized camera position before calculation. 2 - Check to make sure the angle between light and the surface normal are between 0 -1. 3- Never calculated the intersect of the shadow ray on the primitive of the POI itself.


One light source using basic Phong Shading Algorithm. -

- When there is only one object in the scence, the shading work correctly, but when there is more than one object in the scene, take into account the hidden surfaces and calculated the color of those. I check my vector calculation, it calculated correct, Sphere and Plane Intersect function does return the correct t (least positive root). But I don't know why/what cause the effects.



This is 3 different light sources .. you can see 3 shades with light and dark and color in the shadow because of the color of the light.


This is one light source using PhongBlinn model. You can see the specular on the sphere much clear and nicer.. (even though the position is wrong)..
Here is the partial result that illustrate the problem:
Individual sphere: Each sphere shaded correctly individually.



When I put the two sphere together, the light some how lit the hidden surface instead. I check the logics and vector calculation, everything return correctly.
-MT

No comments: