Tag

Webassembly

2 articles tagged with "Webassembly"

From C to Browser: WebAssembly

From C to Browser: WebAssembly

Compiling native code to run in the browser.

The Challenge

MiniRT started as a C ray tracer using the minilibx graphics library. The goal was simple: get it running in a browser without requiring users to install anything.

Traditional approaches would have been:

  • JavaScript reimplementation — Months of work, potential performance loss
  • Native plugin — Dead technology, security concerns
  • Server-side rendering — Latency, no interactivity

WebAssembly offered a fourth path.

MiniRT — WebAssembly Ray Tracer

MiniRT — WebAssembly Ray Tracer

A real-time ray tracer running entirely in the browser via WebAssembly. Originally built as a 42 school project, MiniRT has been compiled to WASM to bring GPU-accelerated ray tracing to the web without any plugins.

Features

  • Real-time Rendering — Interactive camera controls with smooth navigation
  • Multiple Scene Support — Pre-bundled scenes including Billiards, Snowman, Solar System, and more
  • Custom Scene Editor — Write and test your own .rt scene files directly in the browser
  • File Upload — Load external scene files with full validation
  • No Plugins — Pure WebAssembly, runs natively in any modern browser

Controls

InputAction
W A S DMove camera
MouseLook around
RStart high-quality render
ESCExit interactive mode

Try It Out

Launch the interactive demo: Open MiniRT