rtx#

Fully qualified name: usdex::rtx

namespace rtx#

usdex::rtx provides utility functions for creating, editing, and querying UsdShade data models which represent MDL Materials and Shaders for use with the RTX Renderer.

Functions#

bool addDiffuseTextureToPbrMaterial(pxr::UsdShadeMaterial &material, const pxr::SdfAssetPath &texturePath)

Adds a diffuse texture to the PBR material.

bool addMetallicTextureToPbrMaterial(pxr::UsdShadeMaterial &material, const pxr::SdfAssetPath &texturePath)

Adds a metallic texture to the PBR material.

bool addNormalTextureToPbrMaterial(pxr::UsdShadeMaterial &material, const pxr::SdfAssetPath &texturePath)

Adds a normal texture to the PBR material.

bool addOpacityTextureToPbrMaterial(pxr::UsdShadeMaterial &material, const pxr::SdfAssetPath &texturePath)

Adds an opacity texture to the PBR material.

bool addOrmTextureToPbrMaterial(pxr::UsdShadeMaterial &material, const pxr::SdfAssetPath &texturePath)

Adds an ORM (occlusion, roughness, metallic) texture to the PBR material.

bool addRoughnessTextureToPbrMaterial(pxr::UsdShadeMaterial &material, const pxr::SdfAssetPath &texturePath)

Adds a roughness texture to the PBR material.

pxr::UsdShadeShader computeEffectiveMdlSurfaceShader(const pxr::UsdShadeMaterial &material)

Get the effective surface Shader of a Material for the MDL render context.

pxr::UsdShadeShader 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.

pxr::UsdShadeInput createMdlShaderInput(pxr::UsdShadeMaterial &material, const pxr::TfToken &name, const pxr::VtValue &value, const pxr::SdfValueTypeName &typeName, std::optional< const usdex::core::ColorSpace > colorSpace=std::nullopt)

Create an MDL shader input.

pxr::UsdShadeMaterial defineGlassMaterial(pxr::UsdPrim parent, const std::string &name, 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.

pxr::UsdShadeMaterial 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.

pxr::UsdShadeMaterial definePbrMaterial(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 a PBR UsdShadeMaterial interface that drives both an RTX render context and the universal render context.

pxr::UsdShadeMaterial 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.