Problems encountered

Specular Surfaces problems encountered:

Rectangular shapes:


This was caused by the ray having a negative value when calculating the reflection on surfaces. This was fixed by taking the negative of the ray vector.


Patterns on the surfaces:


These were the first functioning reflections. The striped pattern was fixed by only allowing rays going towards a surface to be reflected.

Patterns on the reflections:




After a couple of reflections a dotted pattern appear. This was fixed by normalizing the direction vector given to InderectLight function.

Bent shadows:




This was caused by overzealous normalization of vectors.

Light between mirrors:



When there are a lot of reflections the borders between mirrors gets a lot of extra light by trapped rays. This was reduced by adding one to all rays starting distance, making the white lines less noticeable.

Circular shapes:


 The circular shapes were caused by a negative lightning value.