Webgpu Raytracing in one weekend

Hi all, just wanted to share my vanilla webgpu adaptation of Peter Shirley’s “Raytracing in One Weekend” initially written in c++. It’s an incredibly interesting resource for anyone looking to get into raytracing from scratch. Since completing the first part, I wrote a blog on certain adaptations ; that developers porting from CPU code to GPU code especially in wgsl/webgpu; should be careful of like memory allocation and taking full advantage of the parallel architecture of the GPU when building and designing code systems. All links attached below! Enjoy!

Play around with the live demo: https://ray-tracing-in-one-weekend.vercel.app/

Memory allocation in webgpu: Memory Allocation and Bytes Alignment in WebGPU (Ray Tracing Tutorial) | by Oserebameh Beckley | Aug, 2025 | Medium

Mental notes on refactoring CPU code for the GPU: Building an effcient GPU-style rejection algorithm: Building an efficient GPU-style Rejection Algorithm | by Oserebameh Beckley | Medium

Raytracing in one weekend: https://raytracing.github.io/books/RayTracingInOneWeekend.html

1 Like