Maniphest T100452

USD Alab v2 import errors
Confirmed, Normal

Assigned To
Michael Kowalski (makowalski)
Authored By
Michael Kowalski (makowalski)
Aug 17 2022, 3:55 AM
Tags
  • USD
  • BF Blender
  • Pipeline, Assets & I/O
Subscribers
Ashley (expenses)
Hans Goudey (HooglyBoogly)
Jesse Yurkovich (deadpin)
Kevin Collins (codeloadgame)
Michael Kowalski (makowalski)
Steffen Dünner (SteffenD)
Thomas Dinges (dingto)
Tokens
"Love" token, awarded by expenses."Love" token, awarded by kursadk.

Description

When loading the latest version of the Alab scene (v2), materials don't render correctly. I've narrowed the problem down to the following issues:

  • Some of the UV primvars in the Alab scene are of type Float2Array which is unusual. The Blender USD importer expects UV primvars to be of type TexCoord (e.g., TexCoord2fArray). Hence, some of the Alab UV maps are not getting imported, resulting in the wrong UVs getting applied in the Blender scene. The importer logic should be extended to import Float2Array primvars as texture coordinates as well.
  • The USD importer is attempting to read the varname input of the UsdPrimvarReader_float2 shader as a TfToken, which conforms to the original UsdPreviewSurface specification. However, in the latest specification, varname is a string. This type mismatch when reading the input can result in an empty map name in the UV Map node in Blender and the wrong texture coordinates getting applies.
  • For materials that have an authored opacity value, the importer sets the material Blend Mode to Alpha Blend. In the Alab scene this causes artifacts due to object sorting issues. Setting the Blend Mode to Alpha Hashed provides improved results.

To reproduce the issue, the Alab USD can be downloaded here:

https://animallogic.com/alab/

I created branch tmp-usd-alab-v2-T100452 with work in progress on fixes so far.

Event Timeline

Michael Kowalski (makowalski) changed the task status from Needs Triage to Confirmed.Aug 17 2022, 3:55 AM
Michael Kowalski (makowalski) created this task.
Michael Kowalski (makowalski) added a subscriber: Jesse Yurkovich (deadpin).Aug 17 2022, 4:49 AM
Michael Kowalski (makowalski) updated the task description.Aug 17 2022, 4:59 AM
Steffen Dünner (SteffenD) added a subscriber: Steffen Dünner (SteffenD).Aug 17 2022, 8:10 AM
Jesse Yurkovich (deadpin) added a comment.Aug 17 2022, 8:52 AM

The glass beakers are also problematic in Cycles. The material graph is different than what a typical Glass shader would look like.

After importAfter manual fixup

Typically the material would modify Transmission for the non-opaque parts (have to invert the Opacity texture) and the Base Color modulates the glass color itself (unsure how the BaseColor texture can be used here at all) -- see screenshots for what both of those textures look like.

Michael Kowalski (makowalski) added a comment.Aug 17 2022, 2:42 PM

Thanks for this insight, @Jesse Yurkovich (deadpin). This is very helpful. I'll add this to the list of issues.

Hans Goudey (HooglyBoogly) added a subscriber: Hans Goudey (HooglyBoogly).Aug 17 2022, 3:11 PM

For the UV vs. float2 issue, it might be helpful that we'll be moving away from the separation of "UV" and "float2" types, as part of the move to generic attributes.
D14365 implements most of that change, and will most likely be part of 3.4 or 3.5.

Michael Kowalski (makowalski) added a comment.Aug 17 2022, 3:38 PM

@Hans Goudey (HooglyBoogly) This is very helpful to know, in rethinking how the USD importer handles primvars in general. Thanks!

Thomas Dinges (dingto) added a subscriber: Thomas Dinges (dingto).Aug 17 2022, 5:12 PM
Hans Goudey (HooglyBoogly) added a project: BF Blender.Aug 18 2022, 12:08 AM
Philipp Oeser (lichtwerk) added a project: Pipeline, Assets & I/O.Aug 23 2022, 11:50 AM
kursad k (kursadk) awarded a token.Sep 21 2022, 4:28 AM
Ashley (expenses) awarded a token.Sep 21 2022, 3:05 PM
Ashley (expenses) added a subscriber: Ashley (expenses).
Michael Kowalski (makowalski) added a comment.Sep 23 2022, 10:22 PM

I've been looking into the UDIM load errors for this scene. Oddly, this might be an issue only when loading EXRs. If I convert the textures to PNG, the UDIMs appear to load correctly in the same scene. I've managed to reproduce the issue on a single mesh in two separate blend files in the attached zip file. The alab_chair_exr_udim.blend file, referencing the EXRs, displays incorrectly in the viewport (first image). The alab_chair_png_udim.blend file, referencing PNGs, displays correctly (second image).

@Jesse Yurkovich (deadpin) By any chance, are you able to reproduce this issue with the attached files?


Jesse Yurkovich (deadpin) added a comment.Sep 23 2022, 11:04 PM

Hmm, indeed. It seems to be when the EXRs have a "pass" specified (see below). Some of the EXRs do work, whereas others encounter some confusion. I don't have a good idea of where the problem might be but please file an issue specific to this and I'll try to look this weekend.

oknot ok - uses a named pass called 'rgb'
Michael Kowalski (makowalski) mentioned this in T101320: Multilayer EXR UDIMs display incorrectly.Sep 23 2022, 11:49 PM
Michael Kowalski (makowalski) added a comment.Sep 23 2022, 11:53 PM

Thank you so much for looking into this, @Jesse Yurkovich (deadpin)! I created T101320. No rush, this can certainly wait till after the weekend!

Kevin Collins (codeloadgame) added a subscriber: Kevin Collins (codeloadgame).Sep 24 2022, 6:48 AM