This is a homework assignment of CMPT361/SFU
make
./raycast [-u|-d] step_max <options>
specification:
- u: user scene, d: default scenee
- step_max: max depth of ray tracing recursion
- options:
- +s: inclusion of shadows
- +l: inclusion of reflection
- +r: inclusion of refraction
- +c: inclusion of chess board pattern
- +f: enabling diffuse rendering using stochastic ray generations
- +p: enabling super-sampling
- phong illumination
- shadow
- reflection
- refraction
- diffuse rendering using stochastic ray generation
- super-samling
- ./raycast -d 1 +s +l
- ./raycast -d 1 +c +s +r
- ./raycast -d 4 +c +s +r +l
- ./raycast -d 4 +c +s +r +l +f
- ./raycast -d 4 +c +s +r +l +f +p
In figure below, we can see there is green shadow on the board, which doesn't make sence as it should be the shadow of the red ball. The reason is, in phong illumination, when apply $${diffuse = light * diffuse_factor nl}$$ if the sign of n*l not checked, then the rgb color can be negative. In this case, the R&B light is subtracted, which leads G greater than the other two, then the color goes green.