<p>Fixed this today.
The artifacts were produced by shadow acne and worsened by dodgy averages (assuming every ray would complete the maximum number of bounces before returning or exiting the scene) + an undersized PRNG state buffer; maybe I was just really tired, but I still don't know why bouncing rays off my light sources by default seemed like a good idea. The <em>point</em> of backward path tracing is to trace paths from the camera back to the light source(s) in a scene, and there's no reason to continue following a path (=> evaluate bounces) if rays immediately intersect with a source after leaving the camera.</p>

CC BY-SA 3.0
2018-01-13T06:00:00.003Z
It's possible to have a surface that's both reflective and emissive, eg the glass surface of a dim light bulb. (Dim, so you can actually _see_ some reflection on top of the emission.) So this maybe isn't as much of a mistake as you thought. Although if the material on the light source is _purely_ emissive then certainly stop tracing there.
Nathan Reed
CC BY-SA 3.0
2018-01-13T07:23:00.843Z
Ahh...no, sorry. :)
My light sources are stars (slowly building a space exploration game), and I haven't made any hybrid surfaces yet :P.
Wouldn't it be more correct to construct a lightbulb as an emissive filament inside a reflective/refractive volume?
Paul Ferris
CC BY-SA 3.0
2018-01-13T05:23:55.747Z
2018-01-13T05:23:55.747Z
Paul Ferris
<p>I recently set up a (very basic) ray-marched path-tracer, and I'm getting strange surface patterns on my area light [<a href="https://i.sstatic.net/niQA6.jpg" rel="nofollow noreferrer">link</a>]. I'm using known-valid analytical normals for the light's surface, and the same patterns appear when I use a well-tested gradient estimator anyway.</p>

<p>Ray bounce directions are calculated with <a href="http://www.amietia.com/lambertnotangent.html" rel="nofollow noreferrer">amietia's diffuse BRDF</a>, and regenerated after each bounce. The random numbers in each bounce are uncorrelated (hashed integer versions of the intersecting ray positions) and I'm offsetting ray distances at the start of each bounce by [0.01f] to avoid shadow acne.</p>

<p>The last time I saw this bug was several months ago, and that time it <em>was</em> (probably) caused by shadow acne. What could it be now?</p>

<lighting><pathtracing><diffuse><artifacts>
Ringlike artifacts produced by rays bouncing off a light source
Paul Ferris
# Ringlike artifacts produced by rays bouncing off a light source

(Asked by: username_0 on 2018-01-12)

I recently set up a (very basic) ray-marched path-tracer, and I'm getting strange surface patterns on my area light [[link](https://i.sstatic.net/niQA6.jpg)]. I'm using known-valid analytical normals for the light's surface, and the same patterns appear when I use a well-tested gradient estimator anyway.

Ray bounce directions are calculated with [amietia's diffuse BRDF](http://www.amietia.com/lambertnotangent.html), and regenerated after each bounce. The random numbers in each bounce are uncorrelated (hashed integer versions of the intersecting ray positions) and I'm offsetting ray distances at the start of each bounce by [0.01f] to avoid shadow acne.

The last time I saw this bug was several months ago, and that time it *was* (probably) caused by shadow acne. What could it be now?

**Tags:** lighting, pathtracing, diffuse, artifacts


---

## 1 answers

### Answer by username_0 on 2018-01-13. Score: 0 | Accepted answer

Fixed this today.
The artifacts were produced by shadow acne and worsened by dodgy averages (assuming every ray would complete the maximum number of bounces before returning or exiting the scene) + an undersized PRNG state buffer; maybe I was just really tired, but I still don't know why bouncing rays off my light sources by default seemed like a good idea. The *point* of backward path tracing is to trace paths from the camera back to the light source(s) in a scene, and there's no reason to continue following a path (=> evaluate bounces) if rays immediately intersect with a source after leaving the camera.

> **Comments:**
> **username_1**: It's possible to have a surface that's both reflective and emissive, eg the glass surface of a dim light bulb. (Dim, so you can actually _see_ some reflection on top of the emission.) So this maybe isn't as much of a mistake as you thought. Although if the material on the light source is _purely_ emissive then certainly stop tracing there.  
> **username_0**: Ahh...no, sorry. :) My light sources are stars (slowly building a space exploration game), and I haven't made any hybrid surfaces yet :P. Wouldn't it be more correct to construct a lightbulb as an emissive filament inside a reflective/refractive volume?  

---

