GitHunt
MA

maximecb/batchmarching

A recursive screen-space algorithm to render SDFs

Adaptive Ray Batch Marching (ARBM)

A recursive screen-space algorithm to render SDFs. This technique is most suitable for CPU rendering.

There is prior work in cone marching using multiple rendering passes on GPUs.

Running the Demo

Press the numbers 1, 2, 3, 4 on your keyboard to toggle between 4 different raymarching algorithms:

  1. Standard ray marching
  2. Accelerated raymarching with over-relaxation (Balint & Valasek 2018)
  3. Adaptive ray batch marching (ARBM)
  4. ARBM with approximate/interpolated shading

Press the space bar to start/stop the rotation.

cargo run --release

Build Instructions

Dependencies:

Installing Rust and SDL2 on macOS

Install the Rust toolchain:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Install the SDL2 package:

brew install sdl2

Add this to your ~/.zprofile:

export LIBRARY_PATH="$LIBRARY_PATH:$(brew --prefix)/lib"

Installing Rust and SDL2 on Debian/Ubuntu

Install the Rust toolchain:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Install the SDL2 package:

sudo apt-get install libsdl2-dev

Installing Rust and SDL2 on Windows

Follow the Windows-specific instructions to install the Rust toolchain.

Get SDL2.dll from one of SDL2 Releases.

Copy SDL2.dll (unzip) to the vm/ folder.

maximecb/batchmarching | GitHunt