Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hydra: Materials bound to geomsubsets are ignored with an "identified" UsdImagingDelegate #1896

Closed
jufrantz opened this issue Jun 8, 2022 · 5 comments

Comments

@jufrantz
Copy link

jufrantz commented Jun 8, 2022

Description of Issue

When using an UsdImagingDelegate with a delegateID (diff than /), materials bound to geomsubsets are ignored, meshes are rendered with the fallback grey material.

I could reproduce the issue with usdview/Storm thanks to USDIMAGINGGL_ENGINE_DEBUG_SCENE_DELEGATE_ID

Steps to Reproduce

  1. Open attached usd scene cube_with_geomsubsets.zip in usdview
  2. Notice we have a red and a green material assigned to cube faces, they are correctly rendered in Storm
  3. Set USDIMAGINGGL_ENGINE_DEBUG_SCENE_DELEGATE_ID environment variable to any (non root) path, and open the same scene, for instance
    USDIMAGINGGL_ENGINE_DEBUG_SCENE_DELEGATE_ID=/Foo usdview cube_with_geomsubsets.usd
  4. Notice that the cube is now rendered without usd material bindings

Note

On our side we are considering patching UsdImagingMeshAdapter::GetTopology this way:

diff --git a/pxr/usdImaging/usdImaging/meshAdapter.cpp b/pxr/usdImaging/usdImaging/meshAdapter.cpp
index f95d0e14a..b1aca9951 100644
--- a/pxr/usdImaging/usdImaging/meshAdapter.cpp
+++ b/pxr/usdImaging/usdImaging/meshAdapter.cpp
@@ -397,7 +397,7 @@ UsdImagingMeshAdapter::GetTopology(UsdPrim const& prim,
                    HdGeomSubset {
                        HdGeomSubset::TypeFaceSet,
                        subset.GetPath(),
-                       GetMaterialUsdPath(subset.GetPrim()),
+                       _ConvertCachePathToIndexPath(_GetMaterialUsdPath(subset.GetPrim())),
                        indices });
             }
         }

Current meshAdapter code assigns an usdPath to HdGeomSubset.materialId, whereas clients in pxr render delegates seem to expect a SPrim path (e.g. HdStGetMaterialNetworkShader() HdPrman_ResolveMaterial())

System Information (OS, Hardware)

  • Linux CentOS

Package Versions

  • USD-21.11
  • USD 22.05a

Build Flags

@sunyab
Copy link
Contributor

sunyab commented Jun 13, 2022

Filed as internal issue #USD-7419

@tgvarik
Copy link
Contributor

tgvarik commented Aug 17, 2022

Shares an underlying cause with #1687

@jufrantz
Copy link
Author

jufrantz commented Jan 9, 2023

Thank you @tgvarik. The fix in USD 22.11 works for us as well; I'm closing the issue.

@jufrantz jufrantz closed this as completed Jan 9, 2023
@jufrantz
Copy link
Author

jufrantz commented Nov 3, 2023

Hello,

I'm reopening the issue as a similar problem has (re)surfaced.
I did notice it with USD-23.08 and didn't test earlier USD versions or 23.11. I will probably give them a try.
It can be reproduced with the same steps as the original issue, using usview and USDIMAGINGGL_ENGINE_DEBUG_SCENE_DELEGATE_ID env.

-- Julien

@jufrantz jufrantz reopened this Nov 3, 2023
@jufrantz
Copy link
Author

jufrantz commented Nov 6, 2023

The issue has been found to be on our side within our own USD build.
My apologies for this mix-up.

@jufrantz jufrantz closed this as completed Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants