UsdShade materials: Quick Reference — Visualization (NVIDIA-Certified Professional: OpenUSD Development)
UsdShade Materials – Quick Reference This quick reference provides key facts and definitions for UsdShade materials within the OpenUSD framework...
UsdShade Materials – Quick Reference
This quick reference provides key facts and definitions for UsdShade materials within the OpenUSD framework, essential for the NVIDIA-Certified Professional: OpenUSD Development exam, specifically under the Visualization topic.
1. What is UsdShade?
UsdShade is the schema in OpenUSD designed to represent materials and shading networks that define surface appearance for rendering.
2. Core Concepts
- Material: A container prim that defines the shading for geometry.
- Shader: A node representing a shading operation or program, e.g., a surface shader or texture.
- Input/Output: Shaders communicate via inputs and outputs to form shading networks.
- Binding: Materials are bound to geometry (e.g., usdGeom meshes) to apply shading.
3. UsdShade Material Structure
- Material Prim: Typically of type UsdShadeMaterial.
- Surface Output: The material exposes a surface output, which connects to a shader's output defining the surface appearance.
- Shader Prim: Usually a UsdShadeShader prim within the material or referenced externally.
4. Shader Types
- Surface Shader: Defines how light interacts with the surface (e.g., diffuse, specular).
- Displacement Shader: Alters geometry surface positions.
- Volume Shader: Defines volumetric effects inside geometry.
5. Shader Inputs and Outputs
- Inputs: Parameters such as textures, colors, or float values.
- Outputs: Usually the computed color or surface closure output.
- Connections between shaders are made by linking outputs to inputs.
6. Binding Materials to Geometry
- Direct Binding: Assigning a material to a specific usdGeom mesh prim.
- Collection Binding: Binding materials to collections of geometry.
- Bindings are expressed using material:binding API or UsdShadeMaterialBindingAPI.
7. UsdShade API Key Methods
- GetSurfaceOutput(): Retrieves the surface output of a material.
- CreateShader(): Creates a shader prim within a material.
- ConnectInputToSource(): Connects shader inputs to outputs of other shaders or parameters.
- Bind(): Binds a material to geometry.
8. Important Rules
- A material must have exactly one surface output for rendering.
- Shader connections must form a directed acyclic graph (no cycles).
- Material bindings override inherited bindings from parent prims.
- UsdShade materials are renderer-agnostic but can include renderer-specific metadata.
Worked Example: Creating a Simple UsdShade Material
Goal: Define a material with a diffuse surface shader and bind it to a mesh.
- Create a UsdShadeMaterial prim named MyMaterial.
- Create a UsdShadeShader prim inside MyMaterial of type UsdPreviewSurface.
- Set shader inputs such as diffuseColor to desired values.
- Connect the material's surface output to the shader's surface output.
- Bind MyMaterial to the target usdGeom mesh prim.
This setup defines a basic diffuse material ready for rendering.
For detailed API usage and examples, refer to the official UsdShade API documentation.
More in this topic
Ready to test your knowledge?
Put what you've learned into practice with a quick quiz and track your progress.
Test your knowledge →