私はウェブ上でレイトレーサーアルゴリズムをたくさん読んだことがあります。しかし、私は陰影と影について明確に理解していません。以下の擬似コードは私の理解に従って正しく書かれていますか?
for each primitive
check for intersection
if there is one
do color be half of the background color
Ishadow = true
break
for each ambient light in environment
calculate light contribution to the color
if ( Ishadow == false )
for each point light
calculate diffuse shading
calculate reflection direction
calculate specular light
trace for reflection ray // (i)
add color returned from i after multiplied by some coefficient
trace for refraction ray // (ii)
add color returned from ii after multiplied by some coefficient
return color value calculated until this point