defineGlassPreviewMaterial#
Fully qualified name: usdex::core::defineGlassPreviewMaterial
- pxr::UsdShadeMaterial usdex::core::defineGlassPreviewMaterial(
- pxr::UsdStagePtr stage,
- const pxr::SdfPath &path,
- const pxr::GfVec3f &color,
- const float indexOfRefraction = 1.5f,
- const float roughness = 0.02f,
- const float opacity = 0.2f,
Defines a Glass PBR
UsdShadeMaterialdriven by aUsdPreviewSurfaceshader network for the universal render context.The input parameters reflect a subset of the UsdPreviewSurface specification commonly used when authoring glass materials.
Note
To make the color take effect, opacity must be used to make the material sufficiently opaque.
- 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, minimum 1.0; suggested maximum 4.0
roughness – The Roughness Amount to set, 0.0-1.0 range where 1.0 = flat and 0.0 = glossy
opacity – The Opacity Amount to set, 0.0-1.0 range where 1.0 = opaque and 0.0 = invisible
- Returns:
The newly defined
UsdShadeMaterial. Returns an Invalid object on error.