Keywords: clouds, openvdb
Summary
This demo provides a working example of the CloudVDB plugin in DIRSIG, which allows the user to import a cloud using the using the OpenVDB voxel description. Cloud modeling is usually concerned with absorption and scattering at visible wavelengths and absorption and emission at thermal wavelengths (due to water vapor and ice crystals).
Related Materials
The following demos, manuals and tutorials can provide additional information about the topics at the focus of this demo:
-
Related Demos
-
None.
-
-
Related Manuals
-
The VDB Plugins manual.
-
-
Related Tutorials
-
None.
-
Details
This section explains any technical details of the simulation.
Important Files
This section highlights key files important to the simulation.
Cloud VDB File
The OpenVDB file for the cloud (see big_cloud_14.vdb
) was aquired
from here. The license for this
free example is "For personal use", which generally allows for sharing
of the file as long as it is not sold or used in a commercial application.
The creator also sells a
pack of 60 clouds, with an
expanded license allowing "For personal, educational or commercial use".

big_cloud_14.vdb
file in Blender.Cloud Plugin Setup
A cloud is added to a simulation by adding an instance of the
CloudVDB plugin
to the respective JSIM
simulation description. This plugin appears in the plugin_list
of the Cloud
object in the medium_list
. The setup below shows the
configuration for a statically positioned cloud in the
demo_static.jsim
file:
"medium_list" : [
{
"type" : "Cloud",
"plugin_list" : [
{
"name" : "CloudVDB",
"inputs" : {
"input_filename" : "./big_cloud_14.vdb",
"translate" : [0,0,1500],
"resolution" : 2.0,
"scale_concentration" : 10.0,
"use_concentration_distance_cache" : true
}
}
]
}
],
The translate
variable positions the VDB over the origin at an
altitude of 1,500 meters. The resolution
variable indicates that
the VDB voxels are to be interpreted as 2 meters. The
scale_concentration
flag was chosen to get the arbitrary values
employed by the graphics creator to physically sensible values
expected by DIRSIG. The use_concentration_distance_cache
flag
has been set to true
, which can speed up 2D array image simulations
like we are using here.
A cloud can also be dynamically positioned using a GenericMotion
PPD file. The setup below
shows the configuration for a dynamically positioned cloud in the
demo_ppd.jsim
file:
"medium_list" : [
{
"type" : "Cloud",
"plugin_list" : [
{
"name" : "CloudVDB",
"inputs" : {
"input_filename" : "./big_cloud_14.vdb",
"ppd_filename" : "./cloud_1500m.ppd",
"resolution" : 2.0,
"scale_concentration" : 10.0,
"use_concentration_distance_cache" : true
}
}
]
}
],
The cloud_1500m.ppd
file describes a linear translation of the
cloud across the scene at a constant altitude of 1,500 meters using
two a starting and ending location and orientation pair. The Z
rotation changes from 90.0
degrees (1.5707
radians) to 0.0
degrees (0.0
radians) between the start and end states. This
results in a slow rotation during the translation. This was done
as a demonstration that the motion is fully supported.
cloud_1500m.ppd
).<entry> <datetime type="relative">0</datetime> <position> <location type="scene"> <point><x>-1000</x><y>-100.0</y><z>1500</z></point> </location> </position> <orientation> <eulerangles> <cartesiantriple><x>0</x><y>0</y><z>-1.5707</z></cartesiantriple> </eulerangles> </orientation> </entry> <entry> <datetime type="relative">20</datetime> <position> <location type="scene"> <point><x>1000</x><y>-200</y><z>1500</z></point> </location> </position> <orientation> <eulerangles> <cartesiantriple><x>0</x><y>0</y><z>0</z></cartesiantriple> </eulerangles> </orientation> </entry>
Simulations and Results
The Static Cloud Simulation
Run the single-frame demo_static.sim
file using DIRSIG5 with an
increased number of nodes to account for the high scattering albedo of
the cloud:
$ dirsig5 --max_nodes=20 demo_static.jsim
Load the resulting static_pan-t0000-c0000.img
radiance file in
the DIRSIG image viewer and display the PAN band using one of the
high dynamic range scaling options (e.g., "two sigma" or "two
percent" scaling). Alternatively, the image_tool
provides the
non-linear "gamma" scaling option, which can be used to directly
produce a PNG with the following syntax:
$ image_tool convert static_pan-t0000-c0000.img

The Dynamic Cloud Simulation
Run the dynamic-frame demo_ppd.sim
file using DIRSIG5 with an
increased number of nodes to account for the high scattering albedo of
the cloud:
$ dirsig5 --max_nodes=20 demo_ppd.jsim
The dynamic simulation produces 33 separate image files. You can
load the resulting dynamic_pan-t0000-c0000.img
radiance file in
the DIRSIG image viewer and display the PAN band using one of the
high dynamic range scaling options (e.g., "two sigma" or "two
percent" scaling). Alternatively, the image_tool
provides the
non-linear "gamma" scaling option, which will be used in this case.
The key scaling trick used here is the --all_same
option, which
applies the scaling determined from the first image to all the
remaining images. And since the first frame only contains only a
portion of the cloud, the 16th frame (where the cloud maximizies
the frame) is supplied first to define the scaling for all the
images, and then a wildcard (*
) is used to specify the rest of
the images to be scaled (the 16th image will be scaled a 2nd time):
$ image_tool convert --all_same dynamic_pan-t0000-c0015.img dynamic_pan-t0000-c00*.img

The frames can then be encoded into a video file using ffmpeg:
$ ffmpeg -framerate 20 -i dynamic_pan-t0000-c%04d.img.png -codec:v libx264 -profile:v high -pix_fmt yuv420p dynamic_pan.mp4