PixarAnimationStudios / OpenUSD

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

Shadows not working on Metal with MaterialX #3176

Open erikaharrison-adsk opened 1 month ago

erikaharrison-adsk commented 1 month ago

Description of Issue

When USD is handling the material processing, shadows exhibit fine (see usdPreviewSurfaceSelfShadow.usda and screenshot). image

However, when we use MaterialX, the shadows are unsupported - whether using standard surface - see: mtlxSelfShadow.usda and screenshot; image

or using usd preview surface - see: mtlxPreviewSurfaceSelfShadow.usda and screenshot: image

All of the above shows shadows fine on Windows with OpenGL.

Steps to Reproduce

  1. Build using dev branch and the attached patch file. Note: The attached patch hacks shadows in usdview for simple demonstration, with a simple fixed light. shadow-patch-using-dev.patch

  2. Launch usdview with eg. the attached mtlxSelfShadow.usda file. shadow_test.zip

Expected results: Shows a shadow on the wall. Exhibits self-shadowing on the spirals of the object.

Actual results: No shadows on the wall. No self-shadows.

System Information (OS, Hardware)

Macbook Pro, MacOS Sonoma 14.5 Apple M1 16 GB

Package Versions

N/A - using https://github.com/PixarAnimationStudios/OpenUSD/tree/dev with attached patch

Build Flags

python build_scripts/build_usd.py --generator Ninja --build-variant debug -j 8 --build ./Build ./Install --build-args OpenImageIO,-DCMAKE_FIND_USE_CMAKE_SYSTEM_PATH=OFF USD,-DCMAKE_CXX_FLAGS=\"-D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION\"

jesschimein commented 1 month ago

Filed as internal issue #USD-9886