omni::connect::core::defineOmniGlassMaterial

Defined in omni/connect/core/MaterialAlgo.h

pxr::UsdShadeMaterial omni::connect::core::defineOmniGlassMaterial(pxr::UsdStagePtr stage, const pxr::SdfPath &path, const pxr::GfVec3f &color, const float indexOfRefraction = 1.491f)

Defines an OmniGlass 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 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