defineGlassMaterial#

Fully qualified name: usdex::rtx::defineGlassMaterial

pxr::UsdShadeMaterial usdex::rtx::defineGlassMaterial(
pxr::UsdPrim parent,
const std::string &name,
const pxr::GfVec3f &color,
const float indexOfRefraction = 1.491f,
)#

Defines a Glass UsdShadeMaterial interface that drives both an RTX render context and the universal render context.

The resulting Material prim will have “Interface” UsdShadeInputs which drive both render contexts. See Material and Shader Prims for use with the RTX Renderer for details.

Note: The use of MDL shaders inside this Material interface is considered an implementation detail of the RTX Renderer. Once the RTX Renderer supports OpenPBR or MaterialX shaders we may change the implementation to author those shaders instead of MDL.

Parameters:
  • parent – Prim below which to define the Material

  • name – Name of the Material

  • color – The color of the Material

  • indexOfRefraction – The Index of Refraction to set, 1.0-4.0 range

Returns:

The newly defined UsdShadeMaterial. Returns an Invalid prim on error