How long does it take to trace a million rays? The answer depends on the nature of the model and the speed and resources of your computer. Since you probably can’t upgrade your com-puter every time your model becomes more complex, you will want LightTools to trace rays as efficiently as possible. You can easily control LightTools to balance the need for accuracy of the results with speed of the calculations. This paper provides an overview of LightTools settings that can save you a signifi-cant amount of simulation time.
The most important controls to significantly impact the ray trace speed are:
••••
Accelerated Ray Tracing
Source Starting Point ClassificationRepairing Imported GeometryProbabilistic Ray Splitting
The discussion below explains how and when to use these cru-cial controls in LightTools to improve the efficiency of ray tracing. We will use a sample projection system and a sample backlight system as examples. These systems are shown below in Figure1 and Figure2. In both cases, all refractive surfaces are set to consider Fresnel reflections.
Figure1.Projection system used for ray trace acceleration examples with componentslabeled:
R2R1T1B1S1•Rear reflector (R1) - imported spline (parabolic) •Front reflector (R2) - imported spline (spherical)•Tandem lens array (T1) – imported•Bulb geometry (B1) - imported•Cylinder source (S1) - native to LightTools
The green rays reflect from the parabola (R1) and propa-gate to the lens array; red rays reflect from sphere (R2), go back through source (S1), then reflect from the parab-ola (R1) and propagate to the lens array.
Red rays strike sphere and reflect back through source to the parabola and exit.
Bumps
Reflector
Figure2.Backlight system used for ray trace acceleration examples. Reflector and Light guide were imported from a CAD system and contained 3846 spline surfaces. Many of these splines are bumps on the bottom of the back-light. Cylinder source is native to LightTools.
Light guide
Page 1
The table below summarizes the effect of ray trace controls for the two systems described above. The numbers shown in “With” and “Without” columns indicate the number of rays
traced per second. For Source Starting Point Classification, “With” = Semi-Automatic and “Without” = Automatic.
Speed Improvement Examples
Projection SystemBacklight SystemRays / secImprove Rays / secImprove
FactorFactor
WithoutWithWithoutWith
357341645
50004534357
14.01.322.137.93
4003730125
166712537400
4.173.381.233.20
LightTools Control
Accelerated Ray TraceRepair
Source Starting Point
ClassificationProbabilistic Ray Split
Criticalfor
1. Imported geometry
2. Spline (“Generic”) surfaces1. Imported geometry
2. Spline (“Generic”) surfaces1. Imported geometry
2. Source(s) immersed in medium1. Systems with Split surfaces (e.g., light guides with Fresnel loss)2. Scattering surfaces which both transmit and reflect
Total Ray Trace Speed Improvement Factor31255.5
From this table, it is clear that the proper use of ray trace con-trols can result in dramatic performance improvements. Next, each of these controls is described in more detail.
Accelerated Ray Tracing
Accelerated ray tracing is most beneficial when your model contains geometry imported from another CAD package or spline (“Generic”) surfaces. The accelerated ray trace mode includes many enhancements to the ray tracing algorithm. Typ-ical ray trace speed improvements can range from 4X to 150X, depending on the nature of the model.
The only disadvantage to accelerated ray tracing is that it can cause a slight decrease in accuracy due to surface approxima-tions. In order to handle a wide range of systems, LightTools
provides control of the ray trace mode at both the model and the individual component levels. This allows you to use the precision ray trace for imaging (or critical) components and accelerated ray trace for less critical illumination components. The model-level control is found under the View > Preferences menu by selecting General Preferences > Ray Trace. The default is “Precision Ray Trace.” When “Accelerated Ray Trace” is selected, you can use the slider to select the desired speed/accuracy setting. If you then want to adjust the ray trace mode of an individual entity, select the object and open its Properties dialog box. At the top level, select the Ray Trace tab and check “Override Global Ray Trace Settings” and set the desired ray trace mode for that object. Figure3 illustrates the location of these controls in the LightTools user interface.
(a)(b)
Figure3.The accelerated ray trace controls. The global control (a) affects the entire model. The individual controls (b) can be used to override the global settings for an individual object.
Page 2
Repairing Imported Geometry
The repair feature is critical when ray tracing imported geome-try and spline (“Generic”) surfaces. During data exchange, most CAD systems represent geometry using spline surfaces, even if the surface shape can be described by an analytic equa-tion. The Repair command analyzes the surfaces and converts spline surfaces to simple analytical surfaces (planes, spheres, cylinders, toriods, etc.) when possible. These substitutions can produce significant ray trace speed improvements.
“Repair” is accessed under the Edit > Imported Geometry > Repair Selected Geometry menu choice. It is also available from the 3D Editing palette as shown in Figure4.
Figure5.Source location resides within multiple bounding boxes of objects in Projection System example.
In order to handle a wide range of situations, LightTools pro-vides several options to control how the starting point classifi-cation calculation is done. The starting point classification for a source is found on the “Emittance” tab of the properties dia-log box at the top level of the source, as shown in Figure6.
Automatic Repair
Custom Repair
Figure6.Input choices for source starting point classification
Figure4.Command buttons to access Repair feature
The behavior of each option is as follows:
Automatic – LightTools does a rigorous calculation for all rays to determine the starting medium.
•Immersing Region – Starting material is set to the
immersing object’s material (default is air); no additonal computation time is required.
•Semi-Automatic (default) – LightTools uses less than 10
sample points to determine the media. If all of the sample rays begin in the one medium, LightTools uses that
medium for all rays; the subsequent ray trace is identical to “Immersing Region” mode. If some rays begin in a dif-ferent medium, LightTools reverts to Automatic mode.Semi-Automatic mode is appropriate for most systems. The Immersing Region option is preferable when the source is either immersed in a single medium or is in air. The Automatic mode is appropriate when different portions of the source reside in different media.•
Source Starting Point Classification
When tracing rays from sources during an illumination simula-tion, LightTools must first determine the material in which the ray starting point resides. This “Starting Point Classification” process can be time consuming for imported objects, objects with spline surfaces, or very complicated objects.
LightTools evaluates the bounding boxes of the objects in the model as it determines the material for the ray starting point. The bounding box is the virtual minimum volume that encom-passes an entire solid object. Multiple bounding boxes can overlap a source as shown in Figure5. To determine the mate-rial for the ray starting point, LightTools first must detect if the starting point falls within any of the bounding boxes in the close vicinity. If the ray falls within one or more bounding boxes, LightTools must then decide if the starting point is within the solid object associated with each bounding box.
Page 3
Probabilistic Ray Split
Many systems include surfaces where part of the incident beam is transmitted and part is reflected. This can occur with an uncoated optical surface where Fresnel loss is specified and the Ray Trace Mode is set to “Split.” It also can occur on scattering surfaces where the Ray Propagation Direction is specified as both reflected and transmitted. A single ray incident on a split surface produces two rays that are propagated, often with vastly different powers. If the split surface is encountered mul-tiple times, an exponential growth of rays can occur, dramati-cally increasing the ray tracing time.
The Probabilistic Ray Split control provides for an efficient ray trace by tracing only one outgoing ray for each ray incident on the split surface. LightTools uses a probabilistic approach to determine whether the incident ray is reflected or transmitted. For example, consider a split surface of reflectance R and transmittance T. The probabilities that a ray will reflect or transmit are calculated as:
split surface: 100 incident rays produce 100 transmitted rays and 100 reflected rays. These two cases are shown in Figure8. In both cases, the total power in the transmitted direction (or reflected direction) is the same.
Split surfaceRR+TT
probabilitytotransmit=
R+Tprobabilitytoreflect=
Similar probability calculations are performed for other set-tings such as Fresnel Loss or user coatings. Note that this approach works well only when you trace a large number of rays. For a small number of rays, the system will be under sam-pled by tracing almost all rays in the more probable direction. Because of the potential for under sampling by a small number of rays, probabilistic ray splitting is not appropriate for stray light analysis.
We can use a simple example to illustrate probabilistic ray splitting. Let us take a planar surface, and set the optical prop-erties of the split zone as shown in .
Figure8.Ray Trace trhough a split surface with (a) probabilistic ray splitting; (b) simple ray splitting
In many systems, the ray splitting can result in a significant growth in the number of rays. Figure9 shows a light guide where all zones have the ray trace mode set to split. A single ray enters the light guide as shown by the arrow. With the sim-ple ray splitting (a), the ray splits every time it enters or exits the light guide and each resulting ray can split further. With the probabilistic approach (b), there is no ray splitting; one ray enters the model and one ray exits.
(a)
(b)
Figure9.Light guide with a single incident ray and (a) simple ray splitting; (b) probabilistic ray splitting.
Other Controls Impacting Ray Trace Efficiency
Figure7.Settings for split rays with probabilistic ray split on smooth optical property zone.
In addition to the previously discussed settings, other controls can also affect the ray trace performance. Two of these settings are described briefly.•
Simulation Update Interval
The update interval specifies when the results of a simu-lation are updated; it is accessed under the Illumination > Simulation Info menu. After the specified number of
Using the Probabilistic approach, when 100 rays are incident on this surface, roughly 95 rays are transmitted and 5 are reflected. When the Probabilistic ray split is disabled by unchecking “Preferred Direction,” the surface acts a simple
Page 4
rays is traced, the graphical output windows including views, charts, tables and dialog boxes are updated. The update interval can have a significant impact on simula-tion time when there are large receiver meshes (over 100 x 100 mesh bins) or CIE meshes defined in the model. Therefore, the most efficient ray trace occurs when “Update Results After” is set to “Total Rays” as shown in Figure10.
scattered ray for each incident ray. You must be sure to trace an adequate number of rays to sample the entire distribution. When the number of scattered rays is set greater than 1, LightTools generates the specified num-ber of rays per incident ray. This setting is appropriate when the model is being evaluated using NSRays as it more clearly illustrates the scattering distribution.
Figure11.Number of scattered rays control for a Lambertian scatterer.
Recap
LightTools provides a variety of controls that impact the illu-mination simulation time. Accelerated ray tracing, proper source starting point classification, repairing imported geome-try, and maintaining “1 ray in/1 ray out” with probabilistic ray splitting and a single scattered ray can substantially increase the number of rays traced per second. In addition to these model-specific controls, allowing the simulation to proceed without update interruptions also improves ray tracing speed. Judicious use of these controls allows you to achieve accurate simulation results most efficiently.
Figure10.Selection of “Total Rays” for the simulation update interval.
•
Number of Scattered Rays
The “Number of Scattered Rays” control shown in Fig-ure 11 is very important for models with scattering sur-faces. For simulation purposes this control should
always be set to 1 so that LightTools generates a single
Page 5
3280 East Foothill Boulevard, Pasadena, California 91107
Telephone: (626) 795-9101 FAX: (626) 795-0184
E-mail: service@opticalres.com Web site: http://www.opticalres.com
© 2004 Optical Research Associates. All rights reserved.
因篇幅问题不能全部显示,请点此查看更多更全内容