Ray-tracing

Ray-tracing is a method in physics for calculating the path of EM waves or other types of waves or particles through a system with regions of varying propagation velocities and absorption and reflection characteristics. In optics, ray-tracing can be used to model how light interacts with optical components such as mirrors and lenses where the EM wave is approximated by a large number of narrow beams or rays that are traced throughout the optical system. Ray-tracing is also used in computer graphics for generating photorealistic 3D images.

In light scattering theory, ray-tracing is an energy approximation where bundles of energy (rays) are traced throughout their interactions with a rough surface until they leave the surface. The surface is treated as locally smooth so that each scattering event on the surface is treated as a specular reflection (Fresnel approximation). The approximation is a computationally less intensive alternative to more exact wave-theoretical methods (e.g. MoM, etc.) and has been shown to be valid for s cos(q0) / l > 0.17 and s /t < 2.0 , where s and t are the rms height and the correlation length of the surface, respectively, l is the wavelength of the light and q0 is the angle of incidence [1].

Ray-tracing is an approximation that is well suited for modelling absorption since it incorporates both shadowing and multiple scattering very intuitively, see Figure 1 for illustrations. Shadowing is when certain sections of the surface are blocked from the view of the incident ray and multiple scattering is when light interacts more than once against the rough surface, both phenomena of which have a major impact on the amount of absorbed light [2,3].

Shadowing (left) and multiple scattering (right) illustrations
Figure 1: Illustrations of shadowing (left) and multiple (double in this case) scattering (right), both phenomena of which are easily treated using ray-tracing.

Monte Carlo simulations of random rough surface scattering

Monte Carlo methods are a class of computational algorithms often used in the simulation of physical and mathematical systems, where there exist a large number of degrees of freedom and where there are significant uncertainty in inputs. Examples can be found in fluid mechanics, molecular dynamics, particle physics, financial analysis, telecommunications and in applications of radiation and energy transport where these statistical methods have proven efficiency and gained in importance largely due to the evolution of the power of modern computers.

In Monte Carlo methods, the physical system is modelled directly and not through the differential equations that describe the system. The only requirement is that the system can be described by probability density functions (pdf's), such as Gaussians, exponential or Cauchy distributions. Random sampling from this statistical description is then performed from which the simulation proceeds to produce individual trials or histories. The desired result is then finally taken as an ensemble average over a large number of these accumulated single observations.

In the case of light scattering from random rough surfaces, the ruling pdf's are given by the height distribution functions and the autocovariance functions describing the rough surfaces and the ray distribution describing the incident light.


MATLAB code

NEW! GUI for 2D and 3D ray-tracing simulations of light scattering and absorption of rough surfaces.

GOA (v1.01)
DESCRIPTION: GUI for ray-tracing simulations of light scattering of 1D and 2D rough surfaces, either in Monte Carlo mode using random rough surface generation or by loading previously saved surfaces.
INPUT: Surface properties (Monte Carlo mode), light properties and material properties.
OUTPUT: Directional-hemispherical reflectance, BRDF, scattering points, amount of shadowing, etc.
REQUIREMENTS: MATLAB, Statistics and Signal Processing Toolboxes.

Click thumbnail to open a larger version in a new window
Figure 2: Screenshot of GUI, click thumbnail to open a larger version in a new window.

2D ray-tracing

[R,drcscat,scat,shad,w] = goa2D (f,x,thd,n1,k1,n2,k2,nfrp,dstrb,br)
DESCRIPTION: calculates the directional-hemispherical reflectance for light incident from a medium with complex refractive index n1 + i*k1 on a 1-d rough surface y=f(x) with complex refractive index n2 + i*k2 with the angle of incidence thd (in degrees) with nfrp first reflection points.
INPUT: f-surface height, x-surface point, thd-(global) angle of incidence in degrees, n1-refractive index of medium 1, k1-extinction coefficient of medium 1, n2-refractive index of medium 2, k2-extinction coefficient of medium 2, nfrp-number of first reflection points (rays), dstrb-ray distribution (type 'uni' for uniform and 'gauss' for gaussian), br-beam radius
OUTPUT: R-directional-hemispherical reflectance, drcscat-differential reflection coefficient, scat-mean number of scattering events per each incident ray, shad-amount of shadowing (percentage), w-percentage of rays removed due to warnings

3D ray-tracing

[R,b1,b2,b3,scat,shad,w] = goa3D (f,x,y,thd,phd,n1,k1,n2,k2,nfrp,dstrb,br)
DESCRIPTION: calculates the directional-hemispherical reflectance for light incident from a medium with complex refractive index n1 + i*k1 on a 2-d rough surface z=f(x,y) with complex refractive index n2 + i*k2 with the angle of incidence thd (polar) and phd (azimuth) with nfrp2 first reflection points.
INPUT: f-surface height, x-surface point, y-surface point, thd-(global) polar angle of incidence in degrees, phd-(global) azimuth angle of incidence in degrees, n1-refractive index of medium 1, k1-extinction coefficient of medium 1, n2-refractive index of medium 2, k2-extinction coefficient of medium 2, nfrp-number of first reflection points (rays) along square side, dstrb-ray distribution (type 'uni' for uniform and 'gauss' for gaussian), br-beam radius
OUTPUT: R-directional-hemispherical reflectance, b1-first order scattering brdf, b2-second order scattering brdf, b3-third and higher order scattering brdf, scat-mean number of scattering events per each incident ray, shad-amount of shadowing (percentage), w-percentage of rays removed due to warnings

Hint!
To get good results from the ray-tracing algorithms, observe that the surface given as input needs to properly sampled. The Fresnel approximation, i.e. the assumption of local flatness, puts a more strict demand on the surface sampling frequency than for instance the Nyquist sampling theorem does (see under surface generation tab). Local flatness means the surface derivative must be a smoothly varying function. Therefore it may be necessary to use more surface points for surfaces with higher rms slopes. The warning signal w basically keeps account for errors due to failures of the Fresnel approximation and can be used as an indication of whether a higher sampling frequency is needed. In order to minimize the uncertainty, try to keep it as low as possible (preferably 0). Please also note that to get dense statistics for the brdf you will need more rays than necessary for convergence of reflectance/absorptance (and perhaps even larger surfaces and/or multiple realizations of surfaces, see Monte Carlo code below).



References:

[1] Tang, K.; Dimenna, R.; Buckius, R.: ”Regions of validity of the geometric optics approximation for angular scattering from very rough surfaces”, International Journal of Heat and Mass Transfer, Volume 40, Issue 1, pp. 49-59 (1997).

[2] Bergström, D.; Powell, J.; Kaplan, A.: "A ray-tracing analysis of the absorption of light by smooth and rough metal surfaces”, Journal of Applied Physics, Volume 101, Issue 11, pp. 113504/1-11 (2007).

[3] Bergström, D.; Powell, J.; Kaplan, A.: ”The absorption of light by rough metal surfaces - A three-dimensional ray-tracing analysis”, Journal of Applied Physics, Volume 103, Issue 10, pp. 103515/1-12 (2008).

Quick downloads:
(right click and save as)

goa2D.m (19.0kB)

goa3D.m (34.0kB)

New! GUI for ray-tracing simulations of 2D and 3D rough surfaces:
(right click and save as)

GOA.zip v1.01 (65.6kB)