Add refraction to your physically based shader

You can add refraction to your StingrayPBS node by setting the surface as transparent and setting the Refraction attribute to greater than 1.

  1. Assign a StingrayPBS shader to your object, and select Custom under the Preset Material drop-down list to create a new ShaderFX graph.
  2. Select the Standard Base node, and set the Blend Mode to Transparent.
  3. Create a Material Variable node.

    In the Attribute Editor, set its Type to Scalar. You can optionally rename the node to Transparency for more clarity.

    Connect the Result output of Transparency to the Opacity input of the Standard Base node.

  4. Create a second Material Variable node.

    In the Attribute Editor, set its Type to Scalar. You can optionally rename the node to Refraction for more clarity.

  5. Connect the Result output of Refraction to the Refraction input of the Standard Base node.
  6. Adjust the Refraction attribute to values greater than 1 in the Attribute Editor.

    A refraction value of 1.0 represents air, and a value of around 1.3 simulates glass.

    This example uses a value of 1.3.