PixarAnimationStudios / OpenUSD

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

usdview: Texture from USDZ with MaterialX graph doesn't show up #3181

Open hybridherbst opened 3 months ago

hybridherbst commented 3 months ago

Description of Issue

The attached file has been exported from Reality Composer Pro. To the best of my understanding it only uses standard MaterialX features (and will display correctly in QuickLook / Finder on Mac). However, the the texture doesn't show up in usdview.

Steps to Reproduce

  1. Download TravoltaVideo-2k.usdz.zip
  2. Select in Finder, see MaterialX graph in action
  3. Open in usdview, note that the cube is displayed, but no texture can be seen
  4. My expectation would be that the first frame is shown (with #3178 it would cycle through the displayed frames).
spiffmon commented 3 months ago

Reality Composer is going beyond what is supported by the USDZ spec, and I believe even if MaterialX “normally” supports movie files as textures, in Storm it is Hydra’s texture manager that loads the textures, and it does not handle movies. It is an active area of discussion, though.

On Mon, Jul 29, 2024 at 8:22 AM hybridherbst @.***> wrote:

Description of Issue

The attached file has been exported from Reality Composer Pro. To the best of my understanding it only uses standard MaterialX features (and will display correctly in QuickLook / Finder on Mac). However, the the texture doesn't show up in usdview. Steps to Reproduce

  1. Download TravoltaVideo-2k.usdz.zip https://github.com/user-attachments/files/16415495/TravoltaVideo-2k.usdz.zip
  2. Select in Finder, see MaterialX graph in action
  3. Open in usdview, note that the cube is displayed, but no texture can be seen
  4. My expectation would be that the first frame is shown (with #3178 https://github.com/PixarAnimationStudios/OpenUSD/issues/3178 it would cycle through the displayed frames).

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

hybridherbst commented 3 months ago

This is not a movie file, it’s just a single PNG texture with UV panning!

spiffmon commented 3 months ago

OK, had a look at your scene. There are two issues, I think. One, as you've noted elsewhere, the Mtlx Time node (or any time/frame substitution) is not supported in Hydra. But the reason no texture shows up is that there needs to be some tyong of the tex coords to the geometry, and currently usdImaging/Hydra does not supply any default tex coords for any of the implicit prim types, like Cube. It's something we've discussed and think would be good, but is hard to prioritize, as implicit prim types never make it into final scenes in our pipeline. If you change the Cube into a simple Mesh with st's, you should get something, (I think, I don't fully understand how texCoord binding works with usdMtlx/hdMtlx) though it still won't be animated. If someone wants to propose a default ST mapping for the implicits, please do!

jesschimein commented 3 months ago

Filed as internal issue #USD-9899

hybridherbst commented 3 months ago

Thanks for the explanation – besides my personal wish of this being more consistent I think this is definitely something that should go into the spec! ("this" being: either "they explicitly don't have UV coordinates" or "they have exactly these UV coordinates" instead of some implicit, application-dependant behaviour...).

as implicit prim types never make it into final scenes in our pipeline This is definitely different for realtime applications :) For example, in this case I literally just made a default cube in Reality Composer and started creating a material graph. Importing geometry would kind of defeat the purpose of iterating quickly on the material.

Quick Test to confirm that there's definitely disagreement on what "default primitive UVs" are :)

Tool Preview
Unity image
Blender image
Reality Composer Pro image