Material Assignments During Raytracing
This process is often transparent to the user, but it is important to understand how FRED determines which material the ray is in during the trace.
FRED's raytrace is "surface-based", meaning that rays intersect individual surfaces rather than solid objects. Although the user will typically have constructed a collection of surfaces to form a solid object, each surface is treated independently of the others during the raytrace. For example, consider a cube element primitive with the immersion material set to Standard Glass. When a ray hits one of the the cube's six surfaces, the raytrace engine considers only this surface in isolation of the others. How, then, does the raytrace engine resolve the fact that the ray will pass through this solid cube made of Standard Glass?
Each surface defines a boundary between two materials. In the case of the cube example, each of the six surfaces defines a boundary between Standard Glass and Air. These two boundary materials can be seen on the Materials tab of a surface's Edit/View dialog. Observe that the specification is, generically, "Material 1" and "Material 2". There is no specification of "where" these two materials are relative to the surface's local coordinate system.
Without any additional information, the specification above would be ambiguous (which side of the surface does each material reside on?). The additional key piece of information is that every ray knows what it's current immersion material is at all times during the raytrace. This information is stored with the ray and updated each time the ray interacts with a surface. When a ray interacts with a surface, the raytrace engine identifies which material assignment, either Material 1 or Material 2, matches the incident ray's immersion material. Let's say that the ray is immersed in Material 2 when incident on a surface. If the ray reflects from the surface, the ray keeps it's current immersion material. If the ray refracts across the surface boundary, its immersion material is updated to Material 1.
So, how does FRED know which material the ray starts in? If you edit a source using the Edit/View Detailed Optical Source option you will see an Immersion Material specification on the middle left of the Source tab. The default immersion material specification is Air.
In this scheme, the source's Immersion Material specification can have profound consequences on the interpretation of solid objects in the model. Below is a raytrace of a prism created using surfaces whose material designations are Air and N-SF6 and the source's immersion material is set to Air. When the rays are incident on the prism, they refract across the surface boundary and the rays become immersed in N-SF6. Next they refract through the central hole in the prism and become immersed in Air. Finally, they refract through the central hole boundary a second time and become re-immersed in N-SF6. This is consistent with our intended interpretation of the prism being a solid object made of N-SF6 and immersed in an Air environment.
In the picture below, the source's Immersion Material has been reset to N-SF6. The rays refract across the first boundary of the prism and become immersed in Air. Next, they refract across the inner hole boundary and become immersed in N-SF6. Lastly, they refract across the inner hole boundary a second time and become re-immersed in Air. By changing the source's immersion material, we have now defined a prism made of Air and immersed in a world of N-SF6!
The associated FRED file: PentagonalPrism.frd