Ray-tracing Tutorial (Part C): Changing the surface
In Part A you loaded the Reflection from film ray-tracing demo, and in Part B you edited and moved the light sources. In this final part you will change the surface itself. The original demo uses a rough surface derived from an AFM image, but OghmaNano allows you to replace it with other shapes from the database and to change the optical material of the object. This is useful for exploring how different textures and refractive indices affect reflection and scattering.
Step 1: Open the surface object editor
Start from the simulation you configured in Parts A and B. Zoom and rotate the view so that the red AFM surface is clearly visible. Right-click on the surface and choose Edit object from the context menu, as shown in ??. This opens the Object Editor window for the selected surface object (??).
The Object Editor lists the general parameters of the surface:
- Offset (x, y, z): the position of the surface in the scene.
- Rotate: rotation angles around the x, y and z axes.
- Optical material: which material model is used (for example, silicon).
- Object shape: the 3D geometry that defines the actual surface profile.
For this tutorial we will keep the position and rotation fixed and instead modify the object shape and optical material.
Step 2: Open the Mesh Editor and choose a new shape
To change the surface geometry, click the three dots to the right of the Object shape field in the Object Editor. This opens the Mesh Editor (??), which controls how the geometry of the object is generated.
saw_wave, to use it as the new geometry for the surface object.
In the Mesh Editor make sure the Shape Database tab is selected. The current shape is the AFM image (shown in the text field). You can also adjust the xyz size values to scale the object if required, but for this tutorial we will keep the default dimensions.
Click the three dots button next to the shape field. The shape database
window opens
(??),
listing all available shapes. Double-click saw_wave (or
saw_wave) to select it. The Mesh Editor will now reference the saw-wave
profile instead of the AFM image.
Close the Mesh Editor and return to the main Optical Workbench window. The surface in the 3D view should now appear as a saw-wave structure rather than the original AFM-derived roughness, as shown in ??.
saw_wave shape from
the database. The incident rays now interact with a periodic saw-tooth structure.
Step 3: Re-run the simulation and inspect the output
Click Run simulation (or press F9) to ray trace the new surface.
Once the simulation has finished, open the Output tab as in Part A and
navigate to the detector output. Double-click the detector_efficiency0.csv file
to view the detector efficiency as a function of wavelength.
Compare this spectrum with the one you obtained for the original AFM surface. You should see that the detailed shape of the efficiency curve changes because the scattering and escape probabilities now depend on the saw-wave geometry instead of the AFM roughness.
Step 4: Change the optical material (Si → ITO)
The same object can also be assigned different optical materials. This allows you to separate the effects of geometry from those of refractive index and absorption.
- Re-open the Object Editor for the surface (right-click the surface and select Edit object).
- Locate the Optical material field. In the current example it is set to a silicon entry (for example
inorganic/si). - Click the three dots next to the optical material field to open the optical materials database.
- Select an appropriate ITO entry (for example
inorganic/ito) and confirm your choice. - Close the database window and ensure the new ITO material is shown in the Object Editor, then close the editor.
- Run the simulation again and inspect
detector_efficiency0.csvas before.
By comparing the detector efficiency for (i) the AFM surface with silicon, (ii) the saw-wave surface with silicon, and (iii) the saw-wave surface with ITO, you can begin to disentangle how both surface morphology and refractive index influence the collected light.
👉 Where next? You can now combine everything from Parts A–C to build your own custom ray-tracing scenes: import new shapes into the database, define appropriate optical materials, tune the light sources, and analyse the detector outputs for different wavelengths and configurations.