PixarAnimationStudios / OpenUSD

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

usdview: rendering of flipped geometry looks incorrect #2536

Open hybridherbst opened 12 months ago

hybridherbst commented 12 months ago

Description of Issue

Looks like flipped geometry (e.g. scale -1,1,1) renders incorrectly in usdview. The spec says that winding order and lighting should be corrected, and some viewers (e.g. Storm in Omniverse) seem to respect this; however usdview does not.

Steps to Reproduce

  1. Download NegativeScaleAndAlphaScale.usdz.zip
  2. open with usdview
  3. note that the 2nd and 3rd cubes display black

image

  1. switch lighting to Dome
  2. note that the 2nd and 3rd cube still look wrong, looks like flipped normals?

image

Expected (Storm in Omniverse looks good): image

Discussion in usd-wg: https://academysoftwarefdn.slack.com/archives/C02TZPYMP8S/p1689118060187999

System Information (OS, Hardware)

Both Windows 11 and MacOS 13

Build Flags

On Windows: Omniverse usdview On Mac: build without further options from latest dev

spitzak commented 12 months ago

cubes.zip

This might be a useful test file(s), feel free to add them to any public repository of usd tests. Contains cubes (with the top missing) with all combinations of single/doublesided, normals or no normals, left/right handed, and inverted/normal transformation. No renderer does these all correctly. There is also a version where all the cubes are instanced, which is even worse.

spitzak commented 12 months ago

cubes Possibly-correct render from Storm of the non-instanced version

jesschimein commented 12 months ago

Filed as internal issue #USD-8497

meshula commented 12 months ago

These cube tests are great ~ and would make a lovely addition to https://github.com/usd-wg/assets/tree/main/test_assets !

To anyone not already on the aswf slack, there's related conversations going on here ~ https://join.slack.com/t/academysoftwarefdn/shared_invite/zt-1ygy120xu-CmzTocra0GYIxhxnGBwQOA

spitzak commented 12 months ago

Yes please add the tests to the free examples

spitzak commented 12 months ago

A shader with different front/back face colors would help as well, though I'm not sure if there is anything in UsdPreviewSurface

spiffmon commented 11 months ago

There is not. We were looking to MaterialX for a solution there, not sure if it has been deployed yet.

On Thu, Jul 13, 2023 at 9:49 AM Bill Spitzak @.***> wrote:

A shader with different front/back face colors would help as well, though I'm not sure if there is anything in UsdPreviewSurface

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

-- --spiffiPhone

mnaehrig commented 5 months ago

I'd like to point out that this is not a general problem with usdview. It depends on the platform. On Windows it also looks correct with usdview. On macOS it looks wrong. So I guess it has to do with the Metal backend. Still reproducable with OpenUSD 23.11.