So, I've now got depth of field working!
It was pretty straightforward. I just used a list comprehension to generate a list of points to jitter the rays with, and then it took a lot of fiddling to get the focusing working correctly.
I've also done various refactorings to my code.
All in all, it added roughly an extra 15-20 lines of code to the tracer. And that's without writing Perl-style gibberish.
Predictably enough, though, the tracer is now running much slower - about a minute for this image on my 2008 MBP. So, the next job will be learning how to optimise code in Haskell, and throwing some threading (back) in there.
No comments:
Post a Comment