This article shows how to convert a rayfile into a surface source.
Rayfiles are heavy and contain a limited number of rays whereas surface sources are light and have an unlimited number of rays. Surface sources are particularly useful for high-end visualizations with inverse simulation. A video summarizing this article is available at the end.
Overview
A basic surface source emits light uniformly from each point of the surface of a geometry. This simplistic approach can be used in early development stages when the sources are not specified.
An advanced surface source models a light source much more accurately by using external files previously captured from a rayfile source. We will use this approach in this article:
Step 1: Capture rayfile(s) properties with a preliminary simulation.
Step 2: Create the surface source(s) using the properties previously captured.
In order to create a surface source, 4 elements are necessary:
- Flux: Found in datasheet, or captured via a preliminary simulation
- Exitance: Constant or captured with an irradiance sensor via preliminary simulation.
- Intensity: Mathematically defined, or captured with intensity sensor via preliminary simulation
- Spectrum: Found in datasheet, or captured via a preliminary simulation
Prerequisites
- Rayfile source in Speos using a rayfile (see Additional Resources)
- The document explaining how to correctly position the rayfile in the scene.
- The datasheet and CAD of the LED are also recommended.
These prerequisites are typically made available by LED manufacturers.
Step 1: Capture rayfile(s) properties with a preliminary simulation
1. Irradiance Sensor
Create an irradiance sensor a short distance in front of the last visible surface of the LED (e.g. 0.1 mm)
For visible wavelength only, the “Type” should be set to Photometric.
For UV/IR wavelength, the “Type” should be set to Radiometric.
2. Intensity Sensor
Create an intensity sensor at the same location as the irradiance sensor.
The visualization radius of the sensor can be changed for comfort:
- Intensity sensor “Orientation” should be Conoscopic with a 90° start angle.
- To capture wavelength-dependency, “Type” should be set to Spectral.
- Adjust the wavelength settings to include the desired wavelength range and sampling.
- A higher resolution sampling will create more accurate conversion.
3. Direct Simulation
Run a direct simulation using the LED rayfile source(s), and the two created sensors. The minimal number of rays for the simulation should be the number of rays in the rayfile(s). Depending on the complexity of the design, a high number of rays can be necessary to accurately simulate the output.
Repeat these steps for each rayfile, three times for example in the case of an RGB LED with one rayfile per chip.
Step 2: Create the surface source(s) using the properties previously captured.
Create a surface source using the irradiance and intensity results as inputs. These two outputs can be grabbed from the “SPEOS output files” folder.
1. Exitance
Set variable exitance to “True” and select the irradiance result as file. The “Origin” and “X/Y directions” should be the same as previously used in sensor.
2. Intensity
Set the intensity type to “Library” and select the intensity result as intensity file.
The “Origin” and “X/Y directions” should be the same as previously used in sensor.
3. Geometry (optional)
An “Exit geometry” can be selected. See Understanding the Parameters of a Surface Source for more information on exit geometries.
Note: The definition of the “surface source” is done through a coordinate system and two XMP maps, so a surface is not necessary.
GPU simulation is compatible with Exit geometry from 2024 R1.
4. Spectrum
If the intensity sensor type was not set to “colorimetric” or “spectral”, a spectrum file needs to be added in the surface source definition. This spectrum must be captured from the datasheet using a digitizer tool such as Engauge Digitizer.
The Speos spectrum file format is a text-based format described in the User Guide: Parameters of a Spectrum.
The resulting surface source is the one to be used in further simulations. Click “compute” to update the visualization in the 3D view:
Repeat these steps for each surface source, three times for example in the case of an RGB LED with one rayfile per chip.
The irradiance sensor, intensity sensor, rayfile source(s) and the direct simulation can be deleted. This leaves only the surface source(s) in the LED model, making it lighter to import and use in other projects.
Important Model Settings
The flux can either be set from the intensity file, or “manually” from the datasheet. In the latter case, set “Flux from intensity file” to “False” and enter the value found in the datasheet.
Taking the Model Further
- The created model can be imported on a set of coordinate systems using Speos Pattern. The surface source first needs to be exported as a Speos Light Box to be used in the Speos Pattern function.
- The surface source can be patterned using the SpaceClaim Pattern functions.
- A Light Field source can be created to create a propagation result of a sub-optical system to be reused in a more complex optical system to gain time when computing simulation.