<p>It's likely due to shadow rays. When the light source is exactly on the plane of the wall, a shadow ray traced to it may or may not be found to intersect the wall before it reaches the light. The result will depend on arithmetic roundoff error, and may appear as random noise, or stripes or some other artifact.</p>

<p>To fix it, you can either keep the light offset slightly from the plane, or set up the wall object not to cast shadows (assuming it doesn't need to in the scene).</p>

CC BY-SA 4.0
2018-05-31T03:19:33.277Z
2018-05-31T03:19:33.277Z
Nathan Reed
<p><a href="https://i.sstatic.net/bY0Kq.png" rel="noreferrer"><img src="https://i.sstatic.net/bY0Kq.png" alt="enter image description here"></a></p>

<p><a href="https://i.sstatic.net/HusjL.png" rel="noreferrer"><img src="https://i.sstatic.net/HusjL.png" alt="enter image description here"></a></p>

<p>The wall on the left of the red ball is perfectly reflective wall. </p>

<p>In the first image there's a point light that lies on the plane of the reflective wall and in the second image, it's 0.01 units ahead of it. Due to the light being on the reflective wall, I think, I am getting black dots all over my image. </p>

<p>I would like to know why putting a light on the same plane as the wall causes black dots ?</p>

<raytracing>
Grainy image in my simple ray tracer
Newbie
# Grainy image in my simple ray tracer

(Asked by: username_0 on 2018-05-31)

[![enter image description here](https://i.sstatic.net/bY0Kq.png)](https://i.sstatic.net/bY0Kq.png)

[![enter image description here](https://i.sstatic.net/HusjL.png)](https://i.sstatic.net/HusjL.png)

The wall on the left of the red ball is perfectly reflective wall.

In the first image there's a point light that lies on the plane of the reflective wall and in the second image, it's 0.01 units ahead of it. Due to the light being on the reflective wall, I think, I am getting black dots all over my image.

I would like to know why putting a light on the same plane as the wall causes black dots ?

**Tags:** raytracing


---

## 1 answers

### Answer by username_1 on 2018-05-31. Score: 8

It's likely due to shadow rays. When the light source is exactly on the plane of the wall, a shadow ray traced to it may or may not be found to intersect the wall before it reaches the light. The result will depend on arithmetic roundoff error, and may appear as random noise, or stripes or some other artifact.

To fix it, you can either keep the light offset slightly from the plane, or set up the wall object not to cast shadows (assuming it doesn't need to in the scene).


---

