TL;DR: Iimplemented a Neural Radiance Fields (NeRF) rendering pipeline in both PyTorch and Mojo, including ray sampling, neural network inference, and volume rendering. PyTorch is currently 73.5x faster, but the project taught me a lot about Mojo and its potential.
What I Built
Complete End-to-End NeRF Implementation: Not just the neural network, but the entire 3D rendering pipeline:
-
Ray Generation: Camera rays for each pixel
-
Point Sampling: 3D points along rays
-
NeRF MLP: Neural network for density + color prediction
-
Volume Rendering: Alpha compositing integration
-
Image Synthesis: Final pixel color computation
Both frameworks render the same algorithm identically - this isn’t just a toy example, it’s a real implementation that generates real results (24.59 dB PSNR on the class Lego scene).
Try It Yourself
Clone the github repo and test it for yourself
- Memory Optimization: Novel approaches to graphics pipelines