Ray Tracing in One Weekend

I’ve wanted to do this particular kata for a long time and finally got to it.

There are some post hoc notes I’ve written down if you’re interested in reading stream of grumpy remarks (with the pictures of the intermediate steps!).

25 Likes

Thank you for your contribution. I enjoyed it completely. I love that you used massiv I think that it is a awesome library that demonstrates Haskell’s laziness allowing fusion and control over evaluation for parallel and concurrent programming. I’m not gonna lie geomancy is really giving me some SIMD envy. This is a good example of Haskell’s numerical strengths. I hope to contribute in this way more in the future. I also hope to see more contributions from you.

Found out there’s a gotcha then adding multiple -with-rtsopts args in a package. Had to collect them into one pile of - '"-with-rtsopts=-s -N -A64m"' to avoid the repeated overwriting of it. Gotta check the rest of my packages for this…

This is #18117: It's not possible to specify multiple `-with-rtsopts` flags · Issues · Glasgow Haskell Compiler / GHC · GitLab, it might be helpful to chime in there.

The interval class is just a pair of numbers, with extra functions. I briefly dived into Hackage archives, but the solutions are way to complex for the task.

There is indeed a zoo of libraries for intervals on Hackage. As a maintainer of data-interval: Interval datatype, interval arithmetic and interval-based containers, I’m curious if you can identify any possible improvements.

I ended up removing the Interval entirely. It was only needed to find the closest positive hit (if any).
The next book has BVH building chapter and I’m going to take data-interval for a walk.

2 Likes

What’s the next book?

Next two books, actually…

1 Like

“The Next Week” is finished too and the notes are up.

I’ll have some rest now and think if I want to do the final book in the series, delve into PBR book instead, or… do something else entirely (like generating that SPIR-V disassembler from the specs).

8 Likes