Hello,
I’m developing a custom extension on Omniverse USD Viewer (Kit 108.x) and trying to implement an “X-ray mode” for a building in a USD stage.
Goal
-
When X-ray is ON:
-
The building becomes semi-transparent (e.g., opacity 0.1–0.2) and optionally tinted (cyan)
-
This must be done non-destructively using the Session Layer (so the original USD is untouched)
-
When X-ray is OFF:
- All overrides are removed and the stage returns to the exact original look (materials, colors, opacity)
-
X-ray image
Current Stage Structure (example)
-
/root/World/Building/inside
-
/root/World/Building/outside
-
(sometimes I toggle /root/World/Building/wired visibility too)
What I tried
- Session Layer override using primvars:displayColor / primvars:displayOpacity
- Removing material bindings in Session Layer
Environment
Questions
-
In USD Viewer with RTX, is displayOpacity expected to affect actual transparency?
If not, what is the recommended approach?
-
What is the best practice to implement an X-ray mode non-destructively?
-
Should I create a dedicated X-ray material (e.g., UsdPreviewSurface/MDL) and bind it with bindingStrength=strongerThanDescendants to override all child materials?
-
If so, what is the most reliable way to:
-
Are there known settings/flags in USD Viewer / Kit 108 that prevent transparency from showing (e.g., alpha handling, sorting, post-processing)?
Any references or example code (Kit 108 / Python) would be appreciated.
Thanks!
In USD Viewer / Kit 108 with RTX, displayOpacity is not used by the RTX material pipeline, so setting primvars:displayOpacity in the Session Layer will not make geometry visually transparent in the RTX viewport. For an X‑ray mode you need to override the actual material (UsdPreviewSurface/MDL) in a non‑destructive layer rather than relying on display attributes.developer.nvidia+1
Why displayOpacity does not work
displayColor / displayOpacity are viewport hint attributes primarily respected by simple preview renderers (e.g., Storm). RTX in Omniverse shades from bound materials (MDL, UsdPreviewSurface, etc.) and ignores displayOpacity for real transparency.sidefx+1
- As long as a material with its own opacity settings is bound, RTX will use that shading network and not the displayOpacity primvar, so the building remains opaque.omniverse.nvidia+1
Recommended X‑ray workflow (non‑destructive)
The usual pattern is:
- Create a dedicated X‑ray material (either MDL or UsdPreviewSurface) with:
- Base color = cyan (or your tint).
opacity in the shader set to ~0.1–0.2 and opacityThreshold set appropriately so transparent blending works.sidefx+1
- In the Session Layer, bind this material to the building root with stronger strength so it overrides all descendants:
- Set
material:binding (and, if needed, material:binding:preview) on /root/World/Building with bindingStrength = "strongerThanDescendants".omniverse.nvidia+1
- Because of USD’s material binding rules, this one opinion will override child bindings and GeomSubset bindings for visual shading.omniverse.nvidia
- When X‑ray is turned OFF:
- Remove those binding opinions from the Session Layer (clear the
material:binding* attributes or deactivate the Session Layer), and the composed stage falls back to the original bindings and appearance.omniverse.nvidia+1
This gives:
- Fully non‑destructive behavior (all edits live only in the Session Layer).omniverse.nvidia
- A single, predictable material controlling color and opacity for the entire building, independent of how many materials or GeomSubsets exist underneath.developer.nvidia+1
Implementation tips (Kit 108 / Python)
High‑level steps in your extension:
- On X‑ray ON:
- Ensure Session Layer is the edit target.
- Create or reference the X‑ray material prim (e.g., under
/Looks/XRay_Mat).
- On
/root/World/Building, author:
material:binding = </Looks/XRay_Mat>
material:binding:preview = </Looks/XRay_Mat> (if you use preview)
material:binding:collection:bindingStrength = "strongerThanDescendants" (or equivalent attribute, depending on API helper).developer.nvidia+1
- On X‑ray OFF:
- In the Session Layer, clear these binding properties on
/root/World/Building. Once removed, the original bindings from weaker layers resume control.omniverse.nvidia
There are no special RTX flags in USD Viewer 108 you need to flip beyond having a correctly transparent material; just make sure the material’s own opacity is below 1, and that you are not using debug settings like “Hide Geometry That Uses Opacity” in the RTX renderer options.omniverse.nvidia
- USD Viewer (Kit 108): Make building “X-ray” semi-transparent via Session Layer (displayOpacity not affecting RTX)
- RTX - Common — Omniverse Materials and Rendering
- UsdPreviewSurface use alpha of UsdUVTexture as opacity input | Forums | SideFX
- material-binding — Requirement Documentation
- Layers — Omniverse Extensions
- Lights — Omniverse Materials and Rendering
- https://ppl-ai-file-upload.s3.amazonaws.com/web/direct-files/attachments/images/95700674/0df6635b-7f07-4596-89c1-e64039ff3ffd/image.jpg
- Kit 108.0 Release Notes — Omniverse Developer Guide
- https://www.facebook.com/groups/OctaneRender/posts/2570991036411292/
- Core Platform - NVIDIA Developer Forums
- https://www.youtube.com/watch%3Fv=cjGawB63cq4
- https://www.youtube.com/watch%3Fv=JX8c6xmra1g
- Kit 108.1 Release Notes — Omniverse Developer Guide
- https://www.facebook.com/groups/OctaneRender/posts/3014542538722804/
- https://www.youtube.com/watch?v=mUsfSD241Ck
- USD Connecting non-existent opacity texture | Forums | SideFX