Home Examples Screenshots User manual Bluesky logo
OghmaNano Simulate organic/Perovskite Solar Cells, OFETs, and OLEDs DOWNLOAD

Ray-tracing Tutorial (Part A): MicroLens Demo (quick start)

In this tutorial you will use OghmaNano’s ray tracer to explore a microlens array with an aperture stop and a detector. You will first run the demo in its default configuration, then enable reflections and multi-bounce ray paths so you can see stray light (unwanted rays that reach the detector by indirect paths) and ghost paths caused by multiple reflections.

1. Create a new MicroLens simulation

Launch OghmaNano. In the main window, click New simulation. This opens the device-type library as shown in ??. In the list of ray-tracing projects, double-click Microlens (??), then choose a directory where the simulation should be saved. As with all OghmaNano simulations, it is best to use a local folder (for example on C:\) rather than a network or cloud drive.

OghmaNano new simulation window.
Click New simulation to open the device-type library.
Ray tracing demo list with Microlens highlighted.
Double-click Microlens to load the demo.

2. Inspect the detector, aperture and microlenses

After loading the simulation, the Optical Workbench opens and displays the 3D scene (??). The scene contains: (i) a detector (purple mesh) near the top, (ii) an aperture stop (blue square plate with a circular hole), (iii) a microlens array (red domes) on a substrate. The overall scene size is approximately 4 cm × 4 cm × 5 cm: they are small lenses, but not micro-scale in the strictest sense.

MicroLens demo showing detector (purple), aperture (blue) and microlens array (red domes).
The MicroLens demo scene: detector (purple), aperture stop (blue), and microlens array on a substrate (red).
View from beneath the microlens domes showing the light source region.
Underside view of the microlens array. The light source region sits beneath the domes and emits rays upward.

You can navigate the 3D view using the mouse:

Rotate the camera so you are looking up at the underside of the microlens domes. You will see the light source region beneath the array (??). In this demo, light is emitted from below the microlenses and propagates upward toward the aperture stop and detector. You can interpret the optics above the array as a simplified “collection system” (for example, a camera or microscope objective plus stop), whose job is to accept only a subset of the rays leaving the microlens array.

3. Run the baseline ray-tracing simulation

Click Run simulation (blue play icon) or press F9. You should see rays emitted from the source, refracted by the microlens, passing through the aperture stop, and then being captured by the detector plane (??). In the default settings, the ray tracer may terminate rays early or ignore certain interactions to keep the scene clean and fast. In the next step we will deliberately increase the amount of ray physics shown so we can study indirect paths.

Baseline ray tracing run showing rays passing through the microlens and aperture to the detector.
Baseline ray trace: rays propagate from below, through the microlens, through the aperture stop, and onto the detector.

Step 5: Enable reflections and multi-bounce rays (stray light / ghost paths)

Optical ribbon showing Ray tracing editor button.
The Optical ribbon. Click Ray tracing editor to fine-tune ray-tracer settings.
Ray trace editor configuration dialog.
Ray-tracer configuration. Set minimum ray intensity to 0.01, maximum bounces to 15, and enable both reflected and transmitted rays.

In practical optical systems, unwanted light can reach the detector by indirect routes: multiple reflections, grazing-incidence “skips” along surfaces, and paths that clip at the aperture stop and re-enter the system. Collectively these effects contribute to stray light, and when the same beam makes it to the detector by more than one reflection sequence it is often described as a ghost path. These effects are closely related to optical flare and veiling glare in imaging systems.

To expose these effects in the demo, open the Optical ribbon (??) and click Ray tracing editor. This opens the configuration dialog (??). Set the parameters as follows:

Now rerun the simulation (F9). With reflections and additional bounces enabled, you will see a much richer set of ray paths, including indirect rays that would normally be suppressed. The scene should resemble ?? and ??

Ray tracing with reflections enabled showing many indirect paths.
With reflections and multi-bounce paths enabled, many indirect rays become visible.
Close-up view showing complex ray paths near the microlens array.
Close-up: rays that miss the intended path can still reach the detector by indirect (stray-light / ghost) routes.

👉 Next step: Continue to Part B where you will change the aperture size and scan the source laterally to measure how the optical system’s acceptance depends on position.