How To: Look Dev Transparent Surfaces
A transparent surface is a material interface that allows light to pass through. The law of refraction defines how light bends as it enters/exits from one medium to another (e.g., from air to water, or air to glass). MoonRay’s DwaRefractiveMaterial allows you to author a transparent material, and below are some tips on how to dial the settings to achieve a desired look.
Index of Refraction for Common Materials
|Medium||Index of Refraction|
Transparent surfaces require higher depth settings because light rays need more bounces to escape the medium. Increase the following SceneVariable settings to produce a brighter render:
- max_depth (default: 5)
- max_glossy_depth (default: 2)
- max_mirror_depth (default: 3)
See the Ray Depth page for more info.
What if you have overlapping transparent mediums (e.g. water in a glass cup)? You will need to set a material priority.
Independent Transmission IOR
By default the reflective and refractive IOR are the same. If you want to reduce distortions in refractions, lower the independent_transmission_refractive_indexon the DwaRefractiveMaterial.
BaseVolume for Refraction Color
Light gets absorbed as it travels through a refractive medium, which
BaseVolume more accurately simulates than transmission color.
Set diffuse_color to black to eliminate scattering within the volume, then set the attenuation_color to the desired absorption color.
Caustics occur when light rays are bent through a transparent medium then hit a specular surface. Due to the noisiness it produces in unidirectional path tracers, caustics are turned OFF by default in MoonRay. You should typically switch casts_caustics on in the material settings if the transparent surface occludes any other surface.
Some geometry models often used in production represent extremely “thin” objects, where the geometry is either “open” and does not enclose any spatial volume, or the geometry is technically closed but intended to represent a very thin film such as a soap bubble.
- a sheet of paper with zero thickness
- a soap bubble, where the walls of the bubble have zero thickness
- a glass window with zero thickness
- any other planar surface such as a wall, floor or ceiling
In MoonRay we refer to models such as these as “thin geometry” and their materials require special handling in order to look correct. The materials in moonray have an attribute called thin_geometry that is used to control the material’s behavior for both reflection and transmission events.
The diagrams below show how transmission events interact with these types of geometry based on the state of this material setting.
In this comparison the same sphere model is used to represent solid glass and a soap bubble. When thin_geometry is set to false the soap bubble looks incorrect. This comparison shows what happens when thin_geometry is set to true on the soap bubble material:
In this comparison the tinted glass slab on the left is modeled with thickness > 0 (a box), and the tinted thin glass sheet on the right is modeled with zero thickness (a simple plane). When thin_geometry is set to false on the thin sheet’s material the refraction looks wrong – the rays are bent as they enter the sheet but never unbent because there is no exit.
This comparison shows what happens when thin_geometry is set to true on the thin sheet’s material:
For reflections, the thin_geometry material attribute is also required for correct behavior. When a ray hits the backside of a “thin” surface, MoonRay considers this as an exiting event and inverts the relative index of refraction accordingly. This often has the unwanted effect of making the surface highly reflective when viewed from the backside, and in fact “total internal reflection” can occur. When thin_geometry is enabled on the material, both sides of the surface are treated as front-facing and the relative index of refraction is not inverted.
You can use clearcoat to decouple reflection and refraction roughness, where regular roughness will be used for refractions under the clearcoat reflections.
clearcoat_bending models a ‘physical’ layer of refractive material, and bends the incident ray according to the two IORS (clearcoat IOR over specular IOR). This setting is on by default.
Dispersion is the separation of white light into colors at a material interface. Refractive indices become wavelength-dependent when you use_dispersion. This is a very subtle change in most renders, but it is also not expensive.
The Abbe Number is the measure of the material’s dispersion in optics and lens design. This number is used to classify glass and other mediums in terms of chromaticity. Values range from:
- lower than 25 for flint glasses (high dispersion)
- around 34 for polycarbonate plastics
- more than 65 for crown, fluorite, and phosphate crown glasses (low dispersion)