Depth of Field
inconvergent.net
inconvergent.net
> find the new position, w = v + rndSphere(r).
For anyone wanting control over the look of the defocus blur, also known as the "bokeh", random sphere gives you more samples toward the center than the edges. For a circular aperture, it is slightly better & more correct to sample a disk than to sample a sphere, and slightly faster to converge as well. You can optionally use a hexagon or octagon on the disk if you want to get the look of a film-camera type aperture.
Intention is totally fine. This is reasonable if you actually intended to do something different than what a camera does, or if the intention is not physical correctness. This blog post seems to be intending to do something easy for picking samples, as opposed to something optically correct. I'm all for easy, but I also think it never hurts to understand the tradeoff you're choosing, nor to present the harder alternatives.
It's also worth considering disk sampling rather than sphere sampling, because it's barely any harder, and it will make the code converge to the same quality something like 2x faster. Sphere sampling spends too much time in the middle and not enough at the edges. Disk sampling only takes a teeny tiny bit more arithmetic. Jittering & QMC methods will also help a lot with efficiency.
sphere sampling has the appearance i want. but sampling inside discs with a probability over the disc radius would also work, probably. i didn't try it here.
Github: https://github.com/tylermorganwall/rayfocus Blogpost: https://www.tylermw.com/portrait-mode-data/
https://img.inconvergent.net/img/gen/20170523-193637-305712-...
https://img.inconvergent.net/img/gen/20170520-230701-136920-...
It's almost hard to believe they are computer generated. They just seem so organic.
Could you post the link to the blog post with those images? I’d absolutely love to see them!
I've been interested for a while and played around a bit, but I'd like to dive in a bit more since I have a bit more spare time now than I've had in while.
Either way, the author posted the links, so I saw what jv22222 was talking about.