Bulk scattering
The object bulk scattering method is set in the "Bulk Scatter" section of the Object Properties window. Bulk (volumetric) scattering models random scattering of rays while propagating through a solid object. OpticStudio supports 3 modes for the bulk scattering of a solid object: No Bulk Scattering, Angle Scattering, and DLL Defined Scattering.
No Bulk Scattering
If no bulk scattering is selected, rays will propagate through the solid without scattering.
Angle Scattering
Angle scattering uses a simple model for scattering within a solid. Rays traveling a distance x within the media have an integrated probability of having been scattered given by
, where
,
and the symbol M is the mean free path in lens units. Note that as x increases, the probability that the ray has scattered asymptotically approaches 1.0. Setting this expression to a randomly selected value between 0.0 and 1.0, then solving for x, yields a randomly generated path length with the correct statistics. If this path length is greater than the distance the ray propagates to the next ray-object intersection, then no scattering occurs; otherwise, the ray scatters at the specified position along the propagation direction.
Once the position is determined, the scattering is modeled by a new ray direction being chosen. For angle scattering, a random angle is chosen so that the new ray direction lies uniformly distributed within a cone that makes an angle with respect to the current ray direction. The semi-angle of the cone is one of the parameters to the model, and this parameter should be set to between 0.0 and 180 degrees. The latter value will scatter the ray randomly in any direction. Once the ray scatters, OpticStudio automatically will adjust the polarization vector and randomize the phase of the scattered ray.
DLL Defined Scattering
If the angle scattering model is not sufficient, more complex bulk scattering functions may be defined via an external program called a Dynamic Link Library (DLL). Sample DLLs are provided with OpticStudio with source code. New DLLs may be easily created with a suitable compiler. See also "Comments about DLLs".
Defining an Object to use DLL Defined Bulk Scattering
To make an object use a DLL defined bulk scatter function, choose the Bulk Scattering tab from the object properties dialog box, then select Model: "DLL Defined Scattering". The available DLL functions are then listed in the "DLL:" control.
To check the input and output data for each DLL, check: Data[] values for Bulk Scatter, Diffraction, Surface Scatter DLLs.
DLL parameters
Each DLL may use between zero and 16 user defined data values as parameters in the computation of the media properties. These values are defined by the DLL and are only used by the DLL.
Creating a new DLL
The DLL must include two functions:
- UserBulkDefinition
- UserParamNames
While ray tracing through a solid using DLL defined bulk scattering, OpticStudio passes to the UserBulkDefinition function the current propagation length along the ray, various ray data values, and other parameter data as defined by the user. UserBulkDefinition then is required to determine if the ray will scatter at some point along the propagation length. If the ray will scatter, then UserBulkDefinition must determine the following values:
The position at which the ray will scatter the new direction cosines of the ray the attenuation of the ray, if any Optionally the new electric field vector (if this is not provided OpticStudio will make a reasonable guess)
These values are returned to OpticStudio and are used to continue the trace. The function UserParamNames is used to define the names of all used parameters. These names appear in the Bulk Scatter tab of the object properties dialog box. Bulk scattering DLLs must be placed in the <data>\DLL\BulkScatter folder. See " Folders ".
Sample bulk scattering: Poly_bulk_scat.DLL
The sample bulk scattering file poly_bulk_scat defines the scatter probability as follows:
where θ is the polar angle of the scattered ray with respect to the unscattered ray direction. The source code file poly_bulk_scat.c is provided with OpticStudio as a sample file.
Sample bulk scattering: Henyey-Greenstein-bulk.DLL
The Henyey-Greenstein bulk scatter model defines the scatter probability as follows:
where θ is the polar angle of the scattered ray with respect to the unscattered ray direction. The parameter g can be any value from -1 to 0.9999. If the input value for g is less than -1, g is set to -1. If the input value for g is greater than 0.9999, then g is set to 0.9999. If the input value for |g| is less than 1.0e-4, then g is set to 1.0e-4. The source code file Henyey-Greenstein-bulk.c is provided with OpticStudio as a sample file.
Sample bulk scattering: Rayleigh.DLL
The Rayleigh bulk scattering model defines the scatter probability according to Rayleigh theory for an unpolarized input beam:
where θ is the polar angle of the scattered ray with respect to the unscattered ray direction and λ is the wavelength. The inputs to the DLL are the Reference Wavelength (i.e. the wavelength associated with the input value for the Mean Path) and the Transmission (which allows for energy to be lost during each scattering event). More details are provided in the article entitled "Bulk Scattering with the Rayleigh Model" in the OpticStudio Knowledge Base. The source code file Rayleigh.c is provided with OpticStudio as a sample file.
Sample bulk scattering: Mie.DLL
The Mie bulk scattering model defines the scatter probability according to Mie theory. The algorithm used in OpticStudio was taken from the book "Absorption and Scattering of Light by Small Particles" by Craig F. Bohren and Donald R. Huffman (John Wiley & Sons, 1983). The inputs to the DLL include the particle index, the particle size (in micrometers), and the particle density (in cm-3). More details are provided in the article entitled "How to Simulate Atmospheric Scattering using a Mie model" in the OpticStudio Knowledge Base. The source code file is not distributed with OpticStudio.
Sample bulk scattering: Phosphor.DLL
The Phosphor bulk scattering model is meant to represent a phosphor material in which both fluoresce and scattering can occur. Light in a particular wavelength range (defined as "blue") enters the medium in which the DLL is applied, and that light can either be converted to another wavelength (i.e. undergo fluorescence) or simply bulk scatter. When the input light undergoes fluorescence, the resultant light is emitted into a 180 degree cone angle with equal probability (i.e. the input light "scatters" according to the Angle Scattering model). When the input light scatters with fluorescing, it does so according to the Mie distribution. The fluoresced light (or any other input light not in the "blue" wavelength range) may also scatter according to the Mie distribution. The inputs to the DLL include the mean-free path for fluorescence, the wavelength range defining the "blue" wavelength range, and the particle parameters associated with the Mie distribution. More details are provided in the article entitled "Modeling a White Light Source using a Phosphor" in the OpticStudio Knowledge Base. The source code file is not distributed with OpticStudio.
Next: