addOrmTextureToPreviewMaterial#

Fully qualified name: usdex::core::addOrmTextureToPreviewMaterial

bool usdex::core::addOrmTextureToPreviewMaterial(
pxr::UsdShadeMaterial &material,
const pxr::SdfAssetPath &texturePath,
)#

Adds an ORM (occlusion, roughness, metallic) texture to a preview material.

An ORM texture is a normal 3-channel image asset, where the R channel represents occlusion, the G channel represents roughness, and the B channel represents metallic/metallness.

It is expected that the material was created by definePreviewMaterial()

The texture will be sampled using texture coordinates from the default UV set (generally named primvars:st).

Note

If you intend to create a Material Interface, it is preferable to author all initial shader attributes (including textures) before calling addPreviewMaterialInterface(). This function will not attempt to reconcile any existing inputs on the Material.

Parameters:
  • material – The material prim

  • texturePath – The SdfAssetPath to the texture file

Returns:

Whether or not the texture was added to the material