Hey everyone,
I just wanted to give the community an overview of the work I’ve done towards integrating OpenVDB volumes into Blender for the purposes of rendering level sets and heterogeneous volumetric fields. Before I get into the details, here is a shot from one of the movies that was rendered for our upcoming Siggraph Asia 2016 paper on scalable fluid simulation for heterogeneous platforms.
( For more results, please see the paper, the accompanying videos, and this page )
Basically we were faced with the challenge of not only simulating fluids on domains with over 1 billion degrees of freedom, but then producing high quality renders for the submission. In the past, I had used Blender quite successfully for rendering solids for other projects, so I was interested in how I could leverage my Blender experience for this challenge. After looking around, I eventually contacted Kevin Dietrich, who had previously started some OpenVDB integration with Blender. Using his initial code as a guide, I finished the integration task by adding support for level set rendering, in addition to the initial volume rendering that Kevin had experimented with.
I have made my changes available on Github if people want to experiment with them:
Blender+OpenVDB on Github
Instructions for building this version are here:
#!/bin/bash
# Setup
export LD_LIBRARY_PATH=/usr/local/lib
echo "dash dash/sh boolean false" | debconf-set-selections
DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash
mkdir /blender_experimental
# Build OpenEXR
cd /blender_experimental
git clone https://github.com/openexr/openexr.git
cd openexr/IlmBase
/bin/bash ./bootstrap
/bin/bash ./configure
make
make install
cd ../OpenEXR
/bin/bash ./bootstrap
/bin/bash ./configure
make
make install
# Build OpenVDB
cd /blender_experimental
git clone https://github.com/thecsapprentice/openvdb.git
cd openvdb/openvdb
git checkout cycles_fixes
make lib PYTHON_VERSION= HT=/usr/local HDSO=/usr/local/lib/ BLOSC_INCL_DIR= DESTDIR=/usr/local
make install PYTHON_VERSION= HT=/usr/local HDSO=/usr/local/lib/ BLOSC_INCL_DIR= DESTDIR=/usr/local
# Build Blender
cd /blender_experimental
git clone https://github.com/thecsapprentice/blender-cycles_openvdb.git
cd blender-cycles_openvdb
git checkout openvdb
git submodule init
git submodule update
python scons/scons.py BF_QUIET=1 -j 40
It should build fine on Ubuntu 14.04 ( the test platform we had at the time ), or any similar system. I have noticed that Blender is moving to a pure CMake build system, so this scons build is a bit behind the times. I will probably get around to merging in the latest Blender master at some point, but for now this is based off of v2.76.
Building on Ubuntu 14.04 will require the following packages:
apt-get install git scons g++ make python3 python3-dev libjpeg-dev libz-dev libgl1-mesa-dev libglu1-mesa-dev libavformat-dev libswscale-dev libfftw3-dev libfreetype6-dev libboost1.55-dev libavdevice-dev libtiff5-dev libsdl1.2-dev libilmbase-dev libopenexr-dev autoconf libtool
libopenal-dev libxi-dev libspnav-dev libtbb-dev liblog4cplus-dev libboost-system1.55-dev libpython3.4-dev libjemalloc-dev
libboost-iostreams1.55-dev doxygen libboost-filesystem1.55 libboost-thread1.55 libboost-locale1.55 libopenimageio-dev
libopencolorio-dev libyaml-cpp0.3-dev libtinyxml-dev
I would love to see these changes eventually integrated into the upstream code base of Blender, but at the moment I’m a little busy with my dissertation, so that will have to wait for now.