# \[Hackathon\] NeRF in Mojo

**URL:** <https://forum.modular.com/t/hackathon-nerf-in-mojo/1844>\
**Category:** Community Showcase\
**Tags:** modular-hack-weekend\
**Created:** [June 29, 2025, 11:01pm UTC](https://forum.modular.com/t/hackathon-nerf-in-mojo/1844 "2025-06-29T23:01:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mojouser](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@mojouser](https://forum.modular.com/u/mojouser)\
**Post date:** [June 29, 2025, 11:01pm UTC](https://forum.modular.com/t/hackathon-nerf-in-mojo/1844/1 "2025-06-29T23:01:38Z")

</div>

## **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](https://github.com/tjwielem/nerf-mojo) and test it for yourself

- **Memory Optimization** : Novel approaches to graphics pipelines

---

<div class="post-metadata">

**Author:** ![DarinSimmons](https://sea1.discourse-cdn.com/flex001/user_avatar/forum.modular.com/darinsimmons/32/12_2.png) [@DarinSimmons](https://forum.modular.com/u/DarinSimmons)\
**Post date:** [June 30, 2025, 4:25pm UTC](https://forum.modular.com/t/hackathon-nerf-in-mojo/1844/2 "2025-06-30T16:25:33Z")

</div>

This topic is very hot in the GIS space right now.

Your title says " PyTorch is currently 73.5x faster, but the project taught me a lot about Mojo and its potential." but the [readme.md](https://github.com/tjwielem/nerf-mojo#key-achievements) says mojo+gpu is 10,077x faster than PyTorch GPU NeRF. Bit confused. Are those two separate benchmarks that aren’t comparable?

---

<div class="post-metadata">

**Author:** ![v26i](https://sea1.discourse-cdn.com/flex001/user_avatar/forum.modular.com/v26i/32/663_2.png) [@v26i](https://forum.modular.com/u/v26i)\
**Post date:** [July 8, 2025, 3:14am UTC](https://forum.modular.com/t/hackathon-nerf-in-mojo/1844/4 "2025-07-08T03:14:46Z")

</div>

the link is not working.. can you pl share updated link. super interested in how LumaAI’s nerf were implemented and to compare with mojo implementations

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex001/uploads/modular/original/1X/2751e0fbdc595a99718b216730957e9db4448cfd.jpeg) [@system](https://forum.modular.com/u/system)\
**Post date:** [January 4, 2026, 3:15am UTC](https://forum.modular.com/t/hackathon-nerf-in-mojo/1844/5 "2026-01-04T03:15:20Z")

</div>

Closed on January 4, 2026, 3:15am UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
