Navigation: Raytrace Properties > Monte-Carlo Raytracing

 

Monte-Carlo Raytracing

 

Contact Us: fredsupport@photonengr.com

 

Page Contents

Description

Examples

 

 

Description


The Monte-Carlo option is a method of ray splitting based upon statistics, where the geometric increase in number of rays normally encountered with ray splitting is suppressed in favor of a “one ray in,  one ray out” approach. Rather than splitting an incident ray into parent and child rays and allowing each to continue along its path, FRED determines the future of each ray based upon probability.  The probability that a given parent or child ray continues its life is proportional to the individual ray power and only one ray will continue while the rest are discarded. The greater a ray's power the greater its chance of survival. Note that Monte-Carlo is applied on a surface-by-surface basis because it is a Ray Trace Control property and is not a system-wide specification.

 

As a final note, it is important to understand that the accuracy of the Monte-Carlo method is determined by Poisson statistics. Specifically, Signal-to-Noise is equal to the square root of the number of rays traced. Therefore, accuracy increases with the number of rays traced.

 

Several short examples below serve to illustrate the Monte-Carlo feature in action.

 

 

Examples


Example 1

Consider an optical surface with transmittance T=0.8 and a reflectance R=0.2. No scatter or absorption is involved and T + R = 1. In the normal mode (no Monte-Carlo), an incident ray is split into a transmitted ray and a reflected ray. The transmitted ray has 80% of the incident ray flux and the reflected ray has 20% of in incident ray flux. When a ray is incident upon this surface in the Monte-Carlo mode, one ray leaves the surface. Regardless of which ray is chosen, that ray continues with the same flux as the incident ray. Statistically speaking, the probability of transmission is PT=0.8 and the probability of reflection is PR=0.2. In other words, on average 80% of the existing rays are transmitted and 20% are reflected.

 

Example 2

Consider now an optical surface with only its reflectance defined; T=0, R=0.8. In the normal mode, a reflected ray leaves the surface with 80% of the incident ray flux. Exactly the same thing happens in the Monte-Carlo mode. Every ray incident on the surface becomes a reflected ray with 80% of the incident ray flux.

 

Example 3

In this example, assume that an optical surface has reflectance, transmittance and an implied absorptance; T=0.1, R=0.8. In this case, T+R<1. In the normal mode, the rays split into transmitted and reflected rays each carrying away an adjusted flux value. The transmitted rays have 10% of the incident ray flux and the reflected rays have 80% of the incident ray flux. In the Monte-Carlo mode, the number of reflected rays would be on average R/(T+R)*N where N is the total number of rays incident. The number of transmitted rays would be T/(T+R)*N. In addition, the reflected and transmitted ray flux would be scaled by the factor (T+R).

 

Example 4

This example is similar to Example 1 above except for the addition of scatter. Consider a surface with specular T=0.8, R=0.2 and reflected Total Integrated Scatter TIS=0.3. Under all conditions, FRED recognizes that 30% of the incident flux goes into scatter. Therefore, the transmitted specular flux would be FTsp=0.8*(1-.3)*F where F is the total incident flux. The reflected specular rays would have flux FRsp=0.2*(1-.3)*F and the reflected scattered rays have flux of FRscat=0.3*F. Note that FTsp+FRsp+FRscat=F and that energy is conserved. In the case of Monte-Carlo, once again FRED recognizes the scatter contribution. The probability of a ray being transmitted, reflected or scattered then becomes PT=0.7*0.8, PR=0.7*0.2 and Pscat=0.3, respectively. Note that these probabilities sum to unity. Thus, the number of specular transmitted rays would be PT*N, specular reflected rays would be PR*N and scattered rays would number Pscat*N. As before with no absorption (implied or otherwise), incident ray flux remains unaltered.

 

Example 5

This example adds scatter to the case illustrated in Example 2. Assume T=0, R=0.8 and TIS=0.1. FRED allocates 10% of the incident flux to scatter. As a result, the specular reflection contains 0.8*(1-0.1)*F=0.72*F. The scattered flux is as specified; 0.1*F. The total amount of flux leaving the surface is then 0.82*F.

 

In the case of scatter, the user must select the number of scattered rays per incident ray when setting up an Importance Sampling. FRED will determine Monte-Carlo probabilities based upon all the rays that the user requests.

 

Consider now the situation encountered when using peaked scatter functions such as Harvey-Shack. Choosing more than one scattered ray per incident ray is likely to produce at least one near-specular ray. Since near-specular rays have significantly more energy than their counterparts at larger angles, these rays have a significantly enhanced probability of survival. Thus, choosing more than one scattered ray per incident ray with the Monte-Carlo option in certain cases will result in a non-uniform ray direction density; an effect the user may or may not find desirable. The user has the freedom to decide if this is appropriate, but in either case FRED will give the correct answer.

 

 

 

 

 

 

Copyright © Photon Engineering, LLC