Creating Refraction

To create a glass diamond like the one above:

  1. In Action, first make sure you have a background image.

    Refraction affects whatever is behind the refracting object, so you need something in the back to see the effect.

  2. In Action, right-click the Schematic and select Import...
  3. From the import window, select PBS_Diamond and click Load.
  4. In the Action schematic, double-click the Geom node named PBS_Diamond to display its menu.
  5. In the PBS_Diamond menu, display the Geometry menu, and set Sort Box to Sort Transp.

    This ensures the polygons are properly sorted in 3D space, taking transparency into account when z-sorting its polygons.

  6. Back in the Action schematic, select the Material node named Cube and attached to PBS_Diamond.
  7. In the Cube menu, display the Blending menu and set Transparency to 100%.
  8. In the Refraction section, set IOR to that of the diamond, 2.418.

    You now have a glass cube that refracts its background. Rotate the cube to see its effect on the background.

To enable refraction on a 3D shape, you need a Material node with Transparency set to something other than 0%, and an index of refraction (IOR) set to something other than 1.0.

Index of refraction for some popular materials

Additional Refraction options control how the Material node distorts the background of the geometry.

Intensity
Use Intensity for artistic reasons or to recreate the effect where the background becomes inverted like we can see on glass containing liquid refraction.
Minimal Thickness
Defines the minimal thickness of the object. It ensures that geometries without depth, such as flat 3D shapes, have a default thickness value and can still refract the background.
Roughness
Smooths out the refraction result. The higher the Roughness, the blurrier the refraction. There is also an associated PBS Map option called Refraction Roughness. Use this map to control the Roughness attribute per pixel.
Transmittance
Mixes in the refraction the Deep and Shallow colours, based on the depth of the 3D object. Transmittance is ideal to create coloured glass objects. Deep controls transmittance within deeper areas of the object. Shallow controls transmittance in the thinner areas.
Dispersion
The Dispersion section determines the divergence of the Red, Green, and Blue channels of the background. It essentially recreates chromatic aberration. The Hue Shift field shifts the aberration colours. The Samples field controls the coarseness of the aberration: the greater the amount of samples, the "smoother" the aberration.

Trying Out Refraction

The following geometries were created for you to experiment with refraction.

PBS Refraction Maps

You can attach a Refraction map to the Material node to control the refraction index per pixel, instead using a global refraction index for the object.

There are three refraction maps. Each controls a different aspect of the refraction:

All three maps can be parented to a Material node and overrides their matching parameter in that node. The maps can be grayscale. If you provide a colour map, only the red channel is used.

To add a Refraction map to a Material node:

  1. Create a Refraction map in Batch Paint and attach it to an Action Input node.

    A Refraction map is a grayscale texture, where white is no refraction (IOR = 1) and black is maximum refraction.

  2. In Action, select the grayscale image in the Media List.
  3. Right-click the Material node and select Add Map > PBS Map.
  4. Select the material map and display the Controls menu.
  5. From the Material box, select Refraction.

    The geometry now refracts its background using an index of refraction determined by the Refraction map.

Note: A Refraction map data is not a straight up IOR value, but rather its inverse value, 1/IOR: the range of values in a Refraction map is from 0.0 to 1.0. Why? Real world IOR values are over 1.0, values that hard to paint or edit. The inverted IOR normalizes values between 0.0 and 1.0, and is easier paint, with 0 being black and 1 being white. An inverted IOR of 1.0 means no refraction at all, while 0.667 ( 1/1.5) is the inverted IOR value for glass.

Substance PBR Inverted IOR.

You can attach a Substance PBR asset with an inverted IOR to a Material node. If you do, you control the refraction from the Substance PBR map instead of the Material node.

To control a refraction generated by a Substance PBR material:

  1. Display the Substance PBR menu.
  2. In the Globals menu, edit the Inverted IOR field.
    Note: Only the Inverted IOR option is currently supported.

The following translucent assets are available in the Translucent folder when you load the Substance PBR node:

  • glass_chords
  • glass_clear
  • glass_rain
  • glass_spectrum_ice
  • glass_waterfall