Procedural Volumes (5 pts)
Implementation
Added files:
proceduralvolume.cpp
proceduralvolume.cpp
is really similar to heterogeneous.cpp
except that it does not take a density file as an
input, because the procedural volume obtains the current density scale by querying a new method proceduralDensity()
that I added
to medium.h
. Given a point, this method scales and offsets this point via some scale and offset parameters and then
calls the fBm()
method that was implemented by Michael for the procedural textures. The return value $val$ of fbm()
is then scaled
to the range $[0, maxDensity]$ (to have some upper bound on the density scale I use for Delta Tracking) and then proceduralDensity()
returns $val$ if $val > threshold$ and $0$ otherwise. The
threshold allows me to control how much "holes" there should be in the procedural medium.
To call proceduralDensity()
, proceduralvolume.cpp
must be provided with additional xml parameters:
nrOctaves, lacunarity, gain, scale, offset, maxDensity and threshold. All of them have the same purpose as for the procedural textures from Michael
(they control the noise) except for maxDensity and threshold which serve the purpose described above.
The xml format for specifying a procedural volume is the following (All parameters to control the noise can be
omitted in which case some default parameters will be used):
Validation
As a 1:1 comparison with other procedural volumes is not really possible. Instead I will display some example renders of my procedural volumes with varying parameters in the following.
Fractional brownian motion with different thresholds

threshold = 1

threshold = 1.25

threshold = 1.5
Fractional brownian motion at different scales

scale = [1 0.5 1]

scale = [0.5 1 1]

scale = [2 0.5 2]
Fractional brownian motion at different gains

gain = 0.1

gain = 0.5

gain = 0.6