• Stars
    star
    185
  • Rank 208,271 (Top 5 %)
  • Language
    C++
  • Created over 4 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Reference implementation for "Massively Parallel Rendering of Complex Closed-Form Implicit Surfaces" (SIGGRAPH 2020)

mpr

This is the reference implementation for Massively Parallel Rendering of Complex Closed-Form Implicit Surfaces, a technical paper which will be presented (virtually) at SIGGRAPH 2020.

Paper PDF (preprint, 4.6 MB)

Citation

@article {keeter2020,
    author  = {Keeter, Matthew J.},
    title   = {Massively Parallel Rendering of Complex Closed-Form Implicit Surfaces},
    journal = {{ACM} Transactions on Graphics (Proceedings of SIGGRAPH)},
    year    = "2020",
    volume  = "39",
    number  = "4",
    month   = "jul",
}

Major components

This code builds on libfive, which is included as a submodule.

mpr::Tape

The Tape constructor takes a libfive::Tree object, flattens it, assigns slots, and packs it into a set of uint64_t clauses in GPU RAM.

This is described in Section 2 of the paper.

mpr::Context

The Context class is responsible for actually rendering tapes on the GPU. In particular, Context::render2D implements Alg. 3 from the paper, and Context::render3D implements the 3D rendering discussed in Section 4.2

The eval_tiles_i kernel in context.cu implements Algorithms 1 and 2 from the paper.

mpr::Effects

This struct applies various post-processing effects on images rendered by a Context. Effects are limited to shading and screen-space ambient occlusion (SSAO).

This part of the code isn't as well tuned as the rest, because it's not a core part of the algorithm.

GUI

The GUI is an extremely basic tool for testing out the implementation.

Screenshot

It is based on Dear ImGui and uses ImGuiColorTextEdit as a text editor.

Reproducing our results on AWS

You can reproduce the results in the paper for about $5 on AWS!

First, make sure that your AWS account has permission to create a p3.2xlarge instance. New accounts don't, so I had to email support and ask for an increase in my vCPU limits.

Keep in mind, this instance costs $3.06/hour, so you'll want to be very careful about turning it off when not benchmarking; leaving it on for a month will cost you a cool $2276.

Once you've gotten permission to create the instance, spin up an server with the latest version of Deep Learning Base AMI (Ubuntu 18.04). I used Version 21.0 (ami-0b98d7f73c7d1bb71), but you should use the most recent release.

SSH into the server and run a bunch of commands:

# Install dependencies
sudo apt install mesa-common-dev ninja-build

# Install a recent version of eigen
wget https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.tar.gz
tar -zxvf eigen-3.3.7.tar.gz
cd eigen-3.3.7
mkdir build
cd build
cmake ..
sudo make install

# Install `mpr`
cd
git clone [email protected]:mkeeter/mpr
cd mpr
git submodule update --init --recursive
mkdir build
cd build
cmake -GNinja -DBIG_SERVER=ON ..
ninja

At this point, you can reproduce the benchmarks in the paper by running ../run_benchmarks.sh (from the build directory). This will print a bunch of performance values, starting with

============================================================
                      2D benchmarks
============================================================
Text benchmark
256 5.29331 0.261052
512 4.21138 0.00523862
1024 3.85596 0.00625019
...

The three columns are size, frame time (in milliseconds), and standard deviation.

The benchmarking script will save the output images into a subfolder for each model:

prospero
gears_2d
architecture
gears_3d
bear

Remember to turn off the server when you're done.

Building on MacOS

Install Homebrew and CUDA, then run something like

brew install cmake pkg-config eigen libpng qt guile boost ninja
git clone [email protected]:mkeeter/mpr
cd mpr
git submodule update --init --recursive
mkdir build
cd build
env CUDACXX=/usr/local/cuda/bin/nvcc cmake -GNinja ..
ninja

License

(c) 2019-2020 Matthew Keeter

This code is licensed with a similar strategy as libfive itself:

  • The mpr library is released under the Mozilla Public License, version 2. This is a weak copyleft license which allows you to use the code in your own work (including commercially) as long as changes to mpr itself are released.
  • The demo GUI is licensed under the GNU General Public License, version 2 or later, because it uses the libfive-guile Scheme bindings (which are themselves released under the GPL).

Disclaimer

This is research code, without institutional or commercial backing.

I'll provide best-effort support for running on AWS in the configuration described above.

Otherwise, if you encounter issues, please consider debugging independently and opening a PR with your fixes; I can't guarantee that I'll address your issues myself.

More Repositories

1

antimony

CAD from a parallel universe
C++
2,098
star
2

kokopelli

Script-based CAD/CAM in Python (deprecated)
Python
299
star
3

pont

An online board game in Rust and WebAssembly
Rust
260
star
4

futureproof

A live editor for fragment shaders, powered by Neovim, WebGPU, and Zig!
Zig
215
star
5

rayray

A tiny GPU raytracer, using Zig and WebGPU
Zig
142
star
6

fidget

blazing fast implicit surface evaluation
Rust
118
star
7

erizo

Fast native STL viewer
C
115
star
8

ssra

The Solid-State Register Allocator
Rust
81
star
9

Swingline

Weighted Voronoi Stippling on the GPU
C
60
star
10

pixelsim

Squishy pixel-art spaceships on the GPU
C++
53
star
11

raven

An implementation of the Uxn CPU and Varvara Ordinator
Rust
34
star
12

bumpy-firmware

Firmware for a DIY mp3 player
C
28
star
13

tiny-planets

Rust
27
star
14

bumpy-pcb

PCB design files for a DIY mp3 player
20
star
15

Graphene

Hierarchical computation graphs; details at
Racket
19
star
16

carvr

Image resizing app that uses seam carving
C++
17
star
17

ao-guile-repl

Standalone minimal REPL + viewer for ao-guile [DEPRECATED]
C++
14
star
18

advent-of-code

Advent of Code solutions
Rust
13
star
19

spacewar

2D ship-to-ship combat
Haskell
12
star
20

dotfiles

Vim Script
8
star
21

teapot-mrep

Experiments with direct ray-tracing of Bรฉziers using matrix representations
C
8
star
22

states-machine

Memorize the names and location of US states with spaced repetition
C
7
star
23

arm64-test

Rust
5
star
24

straylight

Nothing to see here...
C++
5
star
25

super-auto-sim

Standalone implementation of Super Auto Pets, for science!
Rust
3
star
26

guile-mingw

PKGBUILD for Guile 2.2
Shell
3
star
27

sudoku-z3

Sudoku โ†’ Z3
Scheme
3
star
28

Multitroids

Single-player asteroids clone, with a twist!
Python
3
star
29

nmbr9-z3

Rust
1
star
30

titan

A half-finished terminal browser for the Gemini protocol
Rust
1
star