Brdf1
=====
:stem: latexmath
:source-highlighter: highlight.js

Keywords: BRDF

== Summary ==
This scene demonstrates use of the various options for attributing
objects with bidirectional reflectance distribution function (BRDF)
surface properties.

== Related Materials ==
The following demos, manuals and tutorials can provide additional
information about the topics at the focus of this demo:

* Related Demos
** N/A
* Related Manuals
** https://dirsig.cis.rit.edu/docs/new/surface_props.html[Surface Properties Manual]
* Related Tutorials
** N/A

== Details ==
This scene contains a series of example materials that have examples for
configuring a variety of diffuse (Lambertian) and specular materials.
These material configurations include examples of the following:

* The http://www.dirsig.org/docs/new/rad_solvers.html#MirrorRadSolver[Mirror]
  radiometry solver.
* The http://www.dirsig.org/docs/new/optical_props.html#ShellTarget[Shell
  Target] model.
* The http://www.dirsig.org/docs/new/optical_props.html#Ward[Ward] model.

== Important Files ==
This section highlights key files important to the simulation.

=== Geometry ===
The geometry of the scene is completely defined in the `geometry\demo.odb`
file using built-in geometry primitives (boxes, spheres, cylinders, etc.).

=== Materials ===
The materials are described in the `materials/demo.mat` file.  The table
below summarizes the materials used in the scene:

.BRDF Materials
[width="50%",halign="center",frame="topbot",grid="none",options="header"]
|=======================================================================
|ID     |Material               |Rad Solver     |BRDF Model
|2      |Perfect Reflector      |Mirror         |N/A
|10     |Lambertian White       |Simple         |Ward
|11     |Lambertian Black       |Simple         |Ward
|500    |Glossy Red Paint       |Simple         |Shell Target (method=0)
|510    |Glossy Red Paint       |Simple         |Shell Target (method=1)
|520    |Glossy Red Paint       |Simple         |Shell Target (method=2)
|600    |Gold, shiny            |Simple         |Shell Target (method=0)
|610    |Gold, slightly dull    |Simple         |Shell Target (method=1)
|=======================================================================

The "Perfect Reflector" material uses the specialized
http://www.dirsig.org/docs/new/rad_solvers.html#MirrorRadSolver[Mirror]
radiometry solver, which models a perfect mirror.  As such, it does
not need any surface material properties defined.

The lambertian materials use the
http://www.dirsig.org/docs/new/optical_props.html#Ward[Ward] BRDF to
described spectrally flat reflectors that have no specular component.

The variants of the "glossy red paint" and "gold" use the *Shell Target*
BRDF model to describe more complex BRDFs.  The various variants are
differentiated by the spectral interpolation method, which is discussed
in greater detail
http://www.dirsig.org/docs/new/optical_props.html#ShellTarget[here].

All of the materials (except the mirror-like material) use the
http://www.dirsig.org/docs/new/rad_solvers.html#SimpleRadSolver[Simple]
radiometry solver with the "low" setting, which does a good job of
capturing the contributions of these well behaved BRDFs.


== Setup ==
There are two simulation scenarios in this demo:

. A single-frame simulation
. A multi-frame (video) simulation

=== Running the Single-Frame Simulation ===
This single-frame simulation produces a single image file.
To run the simulation, perform the following steps:

. Run the DIRSIG `demo.jsim` file
. Load the resulting `demo-t0000-c0000.img` file in the image viewer.


=== Running the Multi-Frame Simulation ===
The multi-frame simulation produces 51 image files.
To run the simulation, perform the following steps:

. Run the DIRSIG `spint.jsim` file
. Load the resulting `demo-t0000-c0000.img`, `demo-t0000-c0001.img`, etc.
  files in the image viewer.


== Results ==

=== Single-Frame Simulation ===
The single-frame simulation produces the single-frame simulation shown
below:

.Output of the single-frame simulation (two percent scaling).
image::images/demo.png[]

=== Multi-Frame Simulation ===
The output of the multi-frame simulation is 51 individual image files.  
The frames can be scaled and encoded into a video format for viewing using
a variety of 3rd party software tools (ffmpeg, mpeg_encode, etc.).

.Animation of the multi-frame "spin" collection.
image::images/spin.gif[]

=== DIRSIG5 Notes ===
Maximum sample count observed is 3344 using the "reference" convergence
criteria June 21, 2017 for demo.sim for dirsig5 5.0.6 (r1477M)
