Some belated #weeknotes on my #raytracerchallenge in #ocaml - I did some performance work to try speed up how it was rendering large amounts of unstructured triangels, and then undid that by making it easier to load yet more triangles by implementing STL file reading - which included the surprise that STL files often have colour information stashed in them via unofficial usage of an unused field!

https://digitalflapjack.com/weeknotes/performance_and_stl_files/

Another #weeknotes update on getting through the #raytracerchallenge in #ocaml - https://digitalflapjack.com/weeknotes/raytracing_progress/

  • Adding groups, bounding boxes, and triangles
  • Adding 3D model support (using X3D rather than OBJ)
  • Tweaking it to let me make small animations
  • Using instruments to work out why it's slow (or at least confirm my assumptions)
I guess it was bound to happen at some point in the #raytracerchallenge - the classic teapot. In the end I implemented a minimal reader for X3D files to load this, as they are just XML and can handle colour per surface (not used here, but useful for my other test files).
Did a little restructuring of my #raytracerchallenge code to make it easier for me to make little animation loops.

Not a lot to show for recent #raytracerchallenge in #ocaml work, as I took time out from the book to use OCaml domains (aka multithreading) to accelerate the rendering, as it gets quite slow when you throw in a lot of transparency and reflection (and I've not made any other efforts to optimise things yet).

Still, here's a bunch of coloured glass tubes. I quite enjoy mixing the techniques I learned from #genuary and #tcc to generate scenes for my ray tracer.

Next on the #raytracerchallenge was the humble cube. A little boring on it's own, but solved by application of a loop and some random.
Got through the transparency part of the #raytracerchallenge - not the best test scene, but it's impressive how quickly this is starting to chug now compared to before.

It's still my breakfast coffee and I've not started work, so I got reflections working for #raytracerchallenge over the break after all :D

Don't like the way the reflections look on the gray panel on the ground, not sure if that's just the limitations of the simple reflection model or I've fluffed the math somewhere. Alas that definitely will need to wait as it's back to work now!

Still, it was nice to do some #ocaml for a bit, as I don my waders for getting back into Python again :)

Not sure I'll make it to reflectivity in #raytracerchallenge before the break time runs out, but at least I have a classic checkerboard pattern working now, which is half the look and feel of old school ray tracing demos :)
Today's progress with #raytracerchallenge in #ocaml. We have planar surfaces and I bumped my viewer up to retina resolution. Still a lot of the book to go and the break is almost over, but it's been nice to exercise my OCaml muscles again for a bit.