definePbrMaterial#

Fully qualified name: usdex::rtx::definePbrMaterial

pxr::UsdShadeMaterial usdex::rtx::definePbrMaterial(
pxr::UsdPrim parent,
const std::string &name,
const pxr::GfVec3f &color,
const float opacity = 1.0f,
const float roughness = 0.5f,
const float metallic = 0.0f,
)#

Defines a PBR 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 diffuse color of the Material

  • opacity – The Opacity Amount to set, 0.0-1.0 range where 1.0 = opaque and 0.0 = invisible. Enable Opacity will be set to true and Fractional Opacity will be enabled in the RT renderer.

  • roughness – The Roughness Amount to set, 0.0-1.0 range where 1.0 = flat and 0.0 = glossy

  • metallic – The Metallic Amount to set, 0.0-1.0 range where 1.0 = max metallic and 0.0 = no metallic

Returns:

The newly defined UsdShadeMaterial. Returns an Invalid prim on error