Keywords: extinction, primitive, dirsig5
Summary
This demo shows how to model a variety of volumes (using the built-in primitive geometry) with unique spectral extinction properties and temperature. Primitive volumes are handled a bit differently than RegularGrid objects in that overlapping primitives do not "sum" in term of the concentration of medium materials. Instead, primitive define distinct regions in which the volume itself matches that primitive’s definition exclusively.

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 Optical Properties manual.
-
The ClassicAbsorption property manual.
-
The ClassicExtinction property manual.
-
-
Related Tutorials
-
None.
-
Details
The focus of this demo is the configuration of materials that have volume extinction (absorption) properties (scattering properties can be modeled as well but, due to radiometry complexities, are handled in plugins). While DIRSIG4 allowed these types of volumes to have arbitrary reflectance properties to be co-defined, DIRSIG5 has specific ways to handle reflective/ transmissive interfaces between two media. These absorbing primitive volumes are primarily intended for testing and setting up simple extinction along a path.
Important Files
The scene is composed of a flat background with a series of sphere, box and cylinder objects placed on and above it. The objects use the built-in geometry options primitives available in the GLIST file (there is no externally defined meshes or objects).
The geometry is defined in the file geometry/demo.glist
and the
materials in materials/demo.mat
. All the materials in this scene
use the Simple radiometry solver (arbitrarily chosen since this
is a DIRSIG5-only demo), but the material optical properties vary.
The top row of objects contains two adjacent floating boxes that are defined with spectrally constant absorption. One is defined as a "surface" material with backing extinction and the second is defined as a "bulk" material with an absorption (they are both equivalent). To distinguish the surface material from materials that use extinction for a virtual thickness, a "volume_boundary" flag is used in the glist. The box defined with bulk properties needs to set a concentration that is applied to the given absorption inputs (they are treated as "specific" coefficients) and also the temperature. The temperature of the surface material is defined in the material. There is a set of "baffle" boxs around the two emitting volumes to help with the dynamic range of the image.
The two spheres are modeled with different absorption properties in the manner of the boxes, but without emission. There is a small sphere in the center of each, one diffuse and one specular, for visualization. Finally, there are two cylinders demonstrating embedding lower concentration medium inside a higher one.
Simulations and Results
The default convergence criteria for DIRSIG5 are not sufficient for this setup due to the noise from sampling an extended source randomly and the number of surfaces encountered.
The Single-Frame Simulation
The single-frame simulation
$ dirsig5 --convergence=30,500,1e-6 --max_nodes=10 --force_temperature_prediction demo.sim
The output RGB radiance image can be scaled to a PNG using the gamma
autoscaling method available in the DIRSIG image_tool
utility:
$ image_tool convert --autoscale=gamma --format=png demo-t0000-c0000.img

The Multi-Frame Simulation
$ dirsig5 --convergence=30,500,1e-6 --max_nodes=10 --force_temperature_prediction video.sim
All the frames produced by the multi-frame simulation can be scaled in a
single execution of the image_tool
by using the appropriate wildcards
for the image filename:
$ image_tool convert --autoscale=gamma --format=png demo-t0000-c*.img
The FFmpeg tool is just one of many tools that can encode multiple frames into a video format. The example below shows how to use it to encode to an H.264 MPEG-4 video file:
$ ffmpeg -framerate 30 -i demo-t0000-c%04d.img.png -codec:v libx264 -profile:v high -pix_fmt yuv420p video.mp4
Or it can also be used to encode into an animated GIF:
$ ffmpeg -framerate 20 -i demo-t0000-c%04d.img.png -f gif video.gif
