News for hackers. Stuff that matters.
Re:Show HN: Monte Carlo ray tracer in Rust by boulos on Monday April 20, 2020 @01:43AM (#22921437)
The author is actually preferentially sending samples towards "attractors" [0] for lights and dielectrics. Doing so massively reduces variance. My favorite example is Figure 5 in this old paper [1] (I've never actually read Pete's ray tracing in a weekend, so I don't know if this is in there).

The most common variance reduction technique though would be to do direct lighting (aka "next event estimation" if you want to be overly pedantic). Your lighting in that image looks like it's just a "Hi, I happen to be emitting tons of energy" sphere in space, which will cause a lot of noise. Alternatively, if you are sampling it, you are likely not sampling the sphere as well as you could. You'll want to sample the sphere following the setup in Figure 2 in Pete's "Direct Lighting" paper [2] (which as a reminder, is currently accessible at the ACM during Covid-19).

[0] https://github.com/Dalamar42/rayt/blob/fc57fa4afc080a578e21e...

[1] http://graphics.stanford.edu/~boulos/papers/gi06.pdf

[2] https://dl.acm.org/doi/10.1145/226150.226151

Re:Show HN: Monte Carlo ray tracer in Rust by Dalamar42 on Monday April 20, 2020 @05:57AM (#22922526)
The 3rd book [0] is primarily about implementing an MC ray tracer and then adding the techniques in the second paper you linked. That's what I've used in my code as well. I just skimmed through the paper and I think the book covers most of the material from the paper with the exception of spatial subdivision. I will have a more careful read later to see exactly what my implementation is missing from this.

[0] https://raytracing.github.io/books/RayTracingTheRestOfYourLi...