USD Alab v2 import errors #100452

Open
opened 2022-08-17 03:55:27 +02:00 by Michael Kowalski · 15 comments

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-#100452 with work in progress on fixes so far.

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-#100452` with work in progress on fixes so far.
Michael Kowalski self-assigned this 2022-08-17 03:55:27 +02:00
Author
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Author
Member

Added subscriber: @makowalski

Added subscriber: @makowalski
Author
Member

Added subscriber: @deadpin

Added subscriber: @deadpin

Added subscriber: @SteffenD

Added subscriber: @SteffenD

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

After import After manual fixup
broken-glass.png slightly-better-glass.png

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.

The glass beakers are also problematic in Cycles. The material graph is different than what a typical Glass shader would look like. | After import | After manual fixup | | -- | -- | | ![broken-glass.png](https://archive.blender.org/developer/F13396208/broken-glass.png) | ![slightly-better-glass.png](https://archive.blender.org/developer/F13396222/slightly-better-glass.png) | 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.
Author
Member

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

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

Added subscriber: @HooglyBoogly

Added subscriber: @HooglyBoogly
Member

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.

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](https://archive.blender.org/developer/D14365) implements most of that change, and will most likely be part of 3.4 or 3.5.
Author
Member

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

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

Added subscriber: @ThomasDinges

Added subscriber: @ThomasDinges
Contributor

Added subscriber: @expenses

Added subscriber: @expenses
Author
Member

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).

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

image.png
image.png

blender_exr_udim_bug.zip

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). @deadpin By any chance, are you able to reproduce this issue with the attached files? ![image.png](https://archive.blender.org/developer/F13561239/image.png) ![image.png](https://archive.blender.org/developer/F13561235/image.png) [blender_exr_udim_bug.zip](https://archive.blender.org/developer/F13561241/blender_exr_udim_bug.zip)

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.

ok not ok - uses a named pass called 'rgb'
ok.png not-ok.png
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. | ok | not ok - uses a named pass called 'rgb' | | -- | -- | | ![ok.png](https://archive.blender.org/developer/F13561308/ok.png) | ![not-ok.png](https://archive.blender.org/developer/F13561310/not-ok.png) |
Author
Member

Thank you so much for looking into this, @deadpin! I created #101320. No rush, this can certainly wait till after the weekend!

Thank you so much for looking into this, @deadpin! I created #101320. No rush, this can certainly wait till after the weekend!

Added subscriber: @codeloadgame

Added subscriber: @codeloadgame
Bastien Montagne added this to the Pipeline, Assets & IO project 2023-02-09 15:39:30 +01:00
Philipp Oeser removed the
Interest
Pipeline, Assets & IO
label 2023-02-10 08:54:02 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No Assignees
7 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#100452
No description provided.