7.7. Material-Interface class
Material interface objects are assigned to the surfaces of the imported 3D model. The assignment is based on the material identifier already present in the CAD file. However, the front side and the back side of the surface are generally assigned differently (see 7.3.2). The internal faces of opaque objects can be omitted, as no ray should impact there. This allows raising exception warnings if inner faces are still accessible, which would then indicate an error in the geometry
The class definition of the TRCMaterialInterface is contained in the module TRCMaterial


As can be seen in the class definition, the material interface comprises the three main elements that allow the definition of a generic material based on the models discussed in Chapter 4 and depicted in the overview in Figure 103. The fundamental elements of the class are:
1. Fresnel module: the necessary parameters for the Fresnel approach are covered by the refractive index classes (TRIbaseclass) (section 4.6) of the two materials and any existing thinflims, as well as the müller matrix component TMuMatMap.
2. Subsurface scattering: the RhoDiff encapsulates the desired model and relevant parameters to perform the diffuse sub-subsurface reflection (section 4.11).
3. Surface roughness: the microfacet roughness model (section 4.10) is simply defined by the parameters Rcorrelated, Ralpha_x and Ralpha_y.
The method SetupMMM initialises the Müller matrix calculations (see section 4.9). For materials with high absorption, the Boolean parameter transparent can be set to true in order to absorb any rays transmitted below the surface immediately. Otherwise, the ray would be traced through the object and set to “absorbed” only at the next collision point. Therefore, defining the material as transparent increases the efficiency of the algorithm. By utilizing these models, the TRCMaterialInterface is able to model a large variety of opaque or transparent materials with different roughness and subsurface scattering behaviours. A typical scattering profile for an opaque material, representing a rough painted surface, that combines surface-roughness and subsurface scattering is depicted in Figure 104.

As can be seen, the parameterized material model is able to generate typical BRDF functions, including specular and diffuse components. The Fresnel reflection on the microfacet surface results in a polarisation of the specularly reflected beam, while the diffuse subsurface reflection is unpolarised (see also section 4.3.3).
The material interface class is primarily used to initialise the associated surface scattering TLSISroughPol module (see below). So far, the options provided by the combined model have been sufficiently versatile to model all relevant materials (coated surfaces, painted surfaces, metallic surface, coated and uncoated glasses). If necessary, alternative material interface definitions can be added in future versions of the raytracer.