#include <taichi>
Yuanming Hu MIT CSAIL
What is Taichi?
2015 Random codebase of a computer graphics newbie
2016 Physically based Computer Graphics Library
2017 Computer Graphics Library
2018 Computer Graphics R&D Infrastructure
Taichi as of 2018Taichi MLS-MPM-CPIC Simulator
SIGGRAPH 2018, SCA 2018
Narrowband Topology Optimization SIGGRAPH Asia 2018
ChainQueen Differentiable Physics Engine, Taichi-GPU
(in submission to ICRA 2019)
#include <taichi> Advanced Computer Graphics@ MIT & UW
Computational Methods for Physical Systems@ Dartmouth …
,
What is the minimal time to have a hackable computer graphics application
deployed?
What is the minimal time to have a hackable computer graphics application
deployed?
What is the minimal time to have a hackable computer graphics application
deployed?
What is the minimal time to have a hackable computer graphics application
deployed?
What is the minimal time to have a hackable computer graphics application
deployed?
What increases deployment time?
✦ Large files
✦ Long build instructions
✦ Missing hardware (e.g. GPUs)
✦ Missing/wrong/broken external software dependencies
✦ Long compilation time
✦ Compilation errors
✦ Linking errors
✦ Slow, long turnaround time
Related Work
✦ Virtual machines
✦ smallpt (hard to read, no GUI) ๏ smallpssmlt ๏ smallppm
✦ shader toys (limited computational patterns)
✦ #include <os>
✦ …
taichi.h (Single C++ header)
#include <taichi> demo implementation cpp
~100 lines of code
Is it even possible?
multigrid.cpp
sparse_grid.h conjugate_gradient.h
cstdio unistd.h immintrin.h
Amalgamation
✦ Analyze #include’s and simulate pre-processor (recursively) ๏ Do not include non-taichi files ๏ painful (a lot of corner cases), but doable
✦ Benefits ๏ Faster compilation/execution speed (sqlite.h/c) ๏ Single header - extremely portable
Eliminating Hardware Dependencies
✦No GPU -> No OpenGL
✦Software rasterizer
✦painful to write, but worthy….
taichi.h (Single C++ header)
#include <taichi> demo implementation cpp
~100 lines of code
Helvetica.ttf Go-Regular.ttf
…
No, no, no… No extra files!
Microsoft Visual Studio: Fatal error C1091:
compiler limit: string exceeds 65535 bytes in length
Opening a Window
✦Need to show the bitmap in memory on screen
✦Cannot depend on Qt
✦Cross-platform: manual engineering for all platforms
✦Windows (C API)
✦Linux X11 (C API)
✦OS X (Cocoa - Objective-C only)
taichi.h (Single C++ header)
#include <taichi> demo implementation cpp
~100 lines of code
cocoa_gui.m
No Objective-C!
Opening a Window (OS X)✦ Run Objective-C code with pure-C++
[window setAcceptsMouseMovedEvents:YES] -> call(window, "setAcceptsMouseMovedEvents:", YES);
Finally….
Examples: Topology Optimisation (120 LoC)
Examples: MLS-MPM (88 LoC)
Examples: MLS-MPM Tetris (140 LoC)
Pros
✦ Extremely Portable
✦ Easy to read, understand, build and hack
✦ Relatively long compilation time (5-10 seconds)
✦ Not suitable for large projects
Cons
Practical applications:
prototyping/education/learning/proof-of-simplicity
10 seconds.
What is the minimal time to have a hackable computer graphics application
deployed?
Thank you! Questions are welcome!
Thank Andy, Tao, Liang, Beichen, Wojciech, Bo, Fanfu for testing & support