PixarAnimationStudios / OpenUSD

Universal Scene Description
http://www.openusd.org
Other
6.03k stars 1.19k forks source link

Hydra GL renderer ignores GeomSubset material bindings #542

Open jufrantz opened 6 years ago

jufrantz commented 6 years ago

Description of Issue

Attached usd file in geomSubsetMaterialBindings.tar.gz defines mesh /all/cube_redAndBlue with two face subsets red_set and blue_set. Each subset has a material bound to it using attached constant.glslfx shader.

from pxr import Usd, UsdShade 
stage = Usd.Stage.Open('geomSubsetMaterialBindings.usda') 
subsetPrim = stage.GetPrimAtPath('/all/cube_redAndBlue/red_set')
print(UsdShade.MaterialBindingAPI(subsetPrim).ComputeBoundMaterial()[0].GetPath())
# /all/Looks/constant_red

When rendered with hydra GL, subsets shaders are not taken into account.

Steps to Reproduce

  1. Open the geomSubsetMaterialBindings.usda file in usdview
  2. /all/cube_redAndBlue is drawn with a green displayColor fallback shader, instead of the two constant shaders.

System Information (OS, Hardware)

Linux

Package Versions

USD 0.8.5a

Build Flags

spiffmon commented 6 years ago

Hi @jufrantz , Thanks, this is a known current limitation. Currently, usdImaging and Hydra process GeomSubsets and make them available (with material bindings) to the render delegates, but only our IP hdPrman delegate (which will ship with Renderman) thus far implements it. Adding support for HdStream is on our radar, but I don;'t have a concrete date for you yet.

CHeers, -- @spiffmon

jtran56 commented 6 years ago

Filed as internal issue #162212.

jufrantz commented 6 years ago

Hello @spiffmon , Ok. Thank you for the detailed feedback. We will try to work around this in the meanwhile; and will keep an attentive eye on HdStream updates. Thanks !

jackcaron commented 5 years ago

Question, are GeomSubset can be used as the equivalent to multi-materials? If you know which faces use which material you can create a subset with the list of faces and bind them?

Also, is that supported by AR kit?

spiffmon commented 5 years ago

Yes, that’s the idea. ArKit does support this, and we expect hydra gl to support it soon, also.

On Mon, Jun 3, 2019 at 12:19 PM Jack Caron notifications@github.com wrote:

Question, are GeomSubset can be used as the equivalent to multi-materials? If you know which faces use which material you can create a subset with the list of faces and bind them?

Also, is that supported by AR kit?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/PixarAnimationStudios/USD/issues/542?email_source=notifications&email_token=ABPOU2EJIIF5FYVCOQEMKVLPYVVEPA5CNFSM4FGZV7L2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODW2NJ6A#issuecomment-498390264, or mute the thread https://github.com/notifications/unsubscribe-auth/ABPOU2CP5VHJVJVA27DL2F3PYVVEPANCNFSM4FGZV7LQ .

-- --spiffiPhone

hybridherbst commented 2 years ago

Just ran into this as well and noticed that while a number of viewers (including QuickLook) support this, usdview notably doesn't, making it harder to use it as "reference viewer" of sorts.

spiffmon commented 2 years ago

What version of USD are you using? Hydra has supported this for at least a couple of years, now!

On Fri, Jun 3, 2022 at 3:36 AM hybridherbst @.***> wrote:

Just ran into this as well and noticed that while a number of viewers (including QuickLook) support this, usdview notably doesn't, making it harder to use it as "reference viewer" of sorts.

— Reply to this email directly, view it on GitHub https://github.com/PixarAnimationStudios/USD/issues/542#issuecomment-1145830421, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPOU2DR6KRVMLNV556NAVDVNHN27ANCNFSM4FGZV7LQ . You are receiving this because you were mentioned.Message ID: @.***>

-- --spiffiPhone

asluk commented 2 years ago

Specifically, usdview does support material bindings to geom subsets now, I believe as of USD v21.11 - https://github.com/PixarAnimationStudios/USD/blob/release/CHANGELOG.md#storm-2 You can verify this via the test asset at https://github.com/PixarAnimationStudios/USD/tree/v22.05a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLGeomSubsets which produces images such as the ones in https://github.com/PixarAnimationStudios/USD/tree/v22.05a/pxr/usdImaging/usdImagingGL/testenv/testUsdImagingGLGeomSubsets/baseline .

The original geomSubsetMaterialBindings.tar.gz https://github.com/PixarAnimationStudios/USD/files/2133786/geomSubsetMaterialBindings.tar.gz doesn't work for me, but I think it's an issue with the shader setup--

Warning: in UsdImagingBuildHdMaterialNetworkFromTerminal at line 485 of C:\Users\aluk\git\omniverse\usd-build\USD\pxr\usdImaging\usdImaging\materialParamUtils.cpp -- Invalid info:id node: /all/Looks/constant_red/shader Warning: in UsdImagingBuildHdMaterialNetworkFromTerminal at line 485 of C:\Users\aluk\git\omniverse\usd-build\USD\pxr\usdImaging\usdImaging\materialParamUtils.cpp -- Invalid info:id node: /all/Looks/constant_blue/shader Warning: in UsdImagingBuildHdMaterialNetworkFromTerminal at line 485 of C:\Users\aluk\git\omniverse\usd-build\USD\pxr\usdImaging\usdImaging\materialParamUtils.cpp -- Invalid info:id node: /all/Looks/constant_red/shader

Best, -a.

On Fri, Jun 3, 2022 at 3:09 PM F. Sebastian (spiff) Grassia < @.***> wrote:

What version of USD are you using? Hydra has supported this for at least a couple of years, now!

On Fri, Jun 3, 2022 at 3:36 AM hybridherbst @.***> wrote:

Just ran into this as well and noticed that while a number of viewers (including QuickLook) support this, usdview notably doesn't, making it harder to use it as "reference viewer" of sorts.

— Reply to this email directly, view it on GitHub < https://github.com/PixarAnimationStudios/USD/issues/542#issuecomment-1145830421 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ABPOU2DR6KRVMLNV556NAVDVNHN27ANCNFSM4FGZV7LQ

. You are receiving this because you were mentioned.Message ID: @.***>

-- --spiffiPhone

— Reply to this email directly, view it on GitHub https://github.com/PixarAnimationStudios/USD/issues/542#issuecomment-1145947531, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAP7WZU4S4TFNEIIV75VBYLVNH7YVANCNFSM4FGZV7LQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

hybridherbst commented 2 years ago

Interesting, good to know – we're on Windows, so using the convenient download from https://developer.nvidia.com/usd. Looking at the download date, that is certainly more than a year old now!

I guess this issue can be closed then – and I'll have to start the frustrating hunt for an updated windows-usable USD version without the usual pains again... (unless there's a better one by now?)

asluk commented 2 years ago

Interesting, good to know – we're on Windows, so using the convenient download from https://developer.nvidia.com/usd. Looking at the download date, that is certainly more than a year old now!

I guess this issue can be closed then – and I'll have to start the frustrating hunt for an updated windows-usable USD version without the usual pains again... (unless there's a better one by now?)

I've provided @hybridherbst with v22.05 and v22.05a Windows builds for now while we at NVIDIA rework our packaging pipeline over the summer 🙏