omni::connect::core::defineOmniPbrMaterial

Defined in omni/connect/core/MaterialAlgo.h

pxr::UsdShadeMaterial omni::connect::core::defineOmniPbrMaterial(pxr::UsdStagePtr stage, const pxr::SdfPath &path, const pxr::GfVec3f &color, const float opacity = 1.0f, const float roughness = 0.5f, const float metallic = 0.0f)

Defines an OmniPBR UsdShadeMaterial interface that drives both an RTX render context and a UsdPreviewSurface context.

MDL and UsdPreviewSurface use a linear color space, please convert RGB and sRGB values to linear

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

  • opacity – The Opacity Amount to set. When less than 1.0, Enable Opacity is set to true and Fractional Opacity is 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