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

Normal maps in MaterialX renders incorrect in hydra storm #1585

Closed
dlarsson-adobe opened this issue Aug 6, 2021 · 9 comments
Closed

Normal maps in MaterialX renders incorrect in hydra storm #1585

dlarsson-adobe opened this issue Aug 6, 2021 · 9 comments

Comments

@dlarsson-adobe
Copy link

Description of Issue

Normal maps in MaterialX comes out wrong/different in hydra storm compared to materialx view

Steps to Reproduce

Open the file cone.usd in the supplied package in usdview in a materialx build of usd.

Result for the material normal_map_issue.mtlx in MaterialXView
materialxview

Result for the material normal_map_issue.mtlx in Usdview
usdview

Scene reproducing the issue
usd_mtlx_normal_map.zip

System Information (OS, Hardware)

Windows 10

Package Versions

Usd 21.08

Build Flags

--MaterialX

@jilliene
Copy link

jilliene commented Aug 6, 2021

Filed as internal issue #USD-6823

@dgovil
Copy link
Collaborator

dgovil commented Sep 21, 2023

Hi, I jut wanted to see if there was any updates or details to provide on the cause of this issue?
We're hitting the same issue with Hydra specifically, where the normals are rendered incorrectly.

Having some details of the cause would help in case its something the community can help with as well.

Screenshot 2023-09-21 at 7 29 39 AM

@dgovil
Copy link
Collaborator

dgovil commented Oct 24, 2023

@jesschimein or @tcauchois , I was wondering if Pixar had any more information to provide on this one? I believe there was some work underway but I can't find any more recent information and it's an issue that's unfortunately making usdview quite difficult to use to validate assets.

Based on what the internal state was, we could try and take a look as well too.

@jesschimein
Copy link
Contributor

jesschimein commented Oct 26, 2023 via email

@pixar-oss
Copy link
Member

Hey @dgovil, we took a look and think that this might be fixed with some color space updates in the 23.11 release. Could you let us know if that fixed things on your end, too?

@dgovil
Copy link
Collaborator

dgovil commented Oct 31, 2023

I'm still seeing issues with the normals on MaterialX shaders here with USD 23.11.

Just taking the right two in my screenshot above (also realized I didn't attach our sample scene previously). Theoretically they should look the same , just like in the Houdini GL and RealityKit viewports.

image

vistest_normals_scale_bias_mtlx.usdz.zip

I will note that the cone from Adobe does look better now but it does feel like the normals are vertically inverted?
So definitely better than it was in both cases, but still not correct I think.

image image

Thanks again for the continued progress on this.

@dgovil
Copy link
Collaborator

dgovil commented Oct 31, 2023

Just for reference (for me mostly)

Spheres: Ideally the right two should match the left most one. The second from the left will never match since the scale/bias are purposefully not authored.
Currently the right most one doesn't match as it uses MaterialX, which displays the issue at hand.

USD 23.8
image

USD 23.11
image

For the Cone

USD 23.8
image

USD 23.11
image

In both cases, USD 23.11 is better but the normals still look inverted to my eyes for the cone as each brick has shadows on the top edge, despite lighting coming from above., It's definitely inverted for the sphere.

@pixar-oss
Copy link
Member

Hi Dhruv! Do you know if the latest dev push (from earlier this week) fixes what you're seeing? And would you be able to provide more repro details?

@dgovil
Copy link
Collaborator

dgovil commented Nov 2, 2023

I tried with ceb3699 and I don't see an improvement unfortunately.

Repro is opening the attached file above/here with usdview
vistest_normals_scale_bias_mtlx.usdz.zip

There are four items, from left to right:

  1. Geometry on the left as a reference
  2. USD PreviewSurface normal map with incorrect bias/scale (this will never look right so please ignore it)
  3. USD Preview Surface Normal map with correct scale and bias. This will match the geometry in 1
  4. MaterialX Shader using a USDPreviewSurface MaterialX and normals with correct scale and bias. This should match both 1 and 3, but doesn't
image

pixar-oss pushed a commit that referenced this issue Nov 28, 2023
Note that the difference in lighting in the baseline is due to differences in
how UsdPreviewSurface and MaterialX's implementation of PreviewSurface
handles roughness values for direct lights.

Fixes #1585

(Internal change: 2306122)
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

5 participants