defineGlassMaterial#

Fully qualified name: usdex::rtx::defineGlassMaterial

pxr::UsdShadeMaterial usdex::rtx::defineGlassMaterial(
pxr::UsdStagePtr stage,
const pxr::SdfPath &path,
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:
  • stage – The stage on which to define the Material

  • path – The absolute prim path at which to define 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