Mojo GPU Raytracer

Since a search for “raytracer” didn’t show any results and as a learning experiment, I coded a quick and dirty GPU raytracer myself.
It’s inefficient, slow and buggy, but here it is:

9 Likes

Awesome, thank you for sharing!

It’s a CPU and GPU raytracer now, and less buggy. :slight_smile:

1 Like

Nice! Let the graphics begin!

Awesome! I’m hoping that someone would write something like the Cycles renderer in mojo. :smiley:

Certainly doable, but:

  1. Wait for C interop in Mojo. :frowning:
  2. Start with Embree since that’s what Cycles is using.
  3. Compile it yourself.
  4. Re-implement the triangle intersector. Ignore everything that’s not absolutely needed (likely etc.) and add everything that is needed (Vec3v).
  5. Run the Minimal tutorial and make sure it works.
  6. Compile standalone Cycles, make sure it uses your Embree and compare frame rates.

From there it’s just wading through the endless templates of Embree to find the functions that are actually used, and implement them one step at a time. :slight_smile:

And finally, if you’re still not exhausted, do the GPU thing. :exploding_head: