I recently set up a (very basic) ray-marched path-tracer, and I'm getting strange surface patterns on my area light [link]. 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, 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?


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.

  • 1
    $\begingroup$ 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. $\endgroup$ – Nathan Reed Jan 13 '18 at 6:00
  • $\begingroup$ 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? $\endgroup$ – Paul Ferris Jan 13 '18 at 7:23

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.