createMdlShader#

Fully qualified name: usdex::rtx::createMdlShader

pxr::UsdShadeShader usdex::rtx::createMdlShader(
pxr::UsdShadeMaterial &material,
const std::string &name,
const pxr::SdfAssetPath &mdlPath,
const pxr::TfToken &module,
bool connectMaterialOutputs = true,
)#

Create a UsdShadeShader as a child of the UsdShadeMaterial argument with the specified MDL.

Parameters:
  • material – Parent UsdShadeMaterial for the shader to be created

  • name – Name of the shader to be created

  • mdlPath – Absolute or relative path to the MDL asset

  • module – Name of the MDL module to set as source asset sub-identifier for the shader

  • connectMaterialOutputs – If true, creates surface, displacement and volume outputs on the material and connects them to the shader output

Returns:

The newly created UsdShadeShader. Returns an Invalid prim on error.