PixarAnimationStudios / OpenUSD

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

hdSt fails to render EDF #3105

Closed dgovil closed 1 month ago

dgovil commented 3 months ago

Description of Issue

We're attempting to add MaterialX support in Blender, and hitting this issue where ND_surface includes a EDF input. However , hdSt always fails with the following.

I've tried removing it from the output usda file, and it still seems to try and pick it up. It looks like this is because the ND_standard_surface lofts up the EDF attribute and hdSt fails to deal with it. Instead of just ignoring it during the compile, it just outright fails.

Is there a workaround for this that anyone might know of in the meantime?

Warning: in _ValidateCompilation at line 229 of /Users/dhruvgovil/Projects/usd/pxr/imaging/hdSt/glslProgram.cpp -- Failed to compile shader (FRAGMENT_SHADER): program_source:1200:5: error: unknown type name 'EDF'
    EDF edf;
    ^

Warning: in _ValidateCompilation at line 229 of /Users/dhruvgovil/Projects/usd/pxr/imaging/hdSt/glslProgram.cpp -- Failed to compile shader (FRAGMENT_SHADER): program_source:1137:5: error: unknown type name 'EDF'
    EDF edf;
    ^

Warning: in _ValidateCompilation at line 229 of /Users/dhruvgovil/Projects/usd/pxr/imaging/hdSt/glslProgram.cpp -- Failed to compile shader (FRAGMENT_SHADER): program_source:2457:5: error: unknown type name 'EDF'
    EDF edf;
    ^

Warning: in _ValidateCompilation at line 229 of /Users/dhruvgovil/Projects/usd/pxr/imaging/hdSt/glslProgram.cpp -- Failed to compile shader (FRAGMENT_SHADER): program_source:2394:5: error: unknown type name 'EDF'
    EDF edf;
    ^

ERROR: Usdview encountered an error while rendering.
    Error in '&pxrInternal_v0_24__pxrReserved__::HdSt_DrawBatch::_GetDrawingProgram' at line 408 in file /Users/dhruvgovil/Projects/usd/pxr/imaging/hdSt/drawBatch.cpp : 'Failed to compile shader for prim /root/Plane/Plane.'
    Error in '&pxrInternal_v0_24__pxrReserved__::HdSt_DrawBatch::_GetDrawingProgram' at line 408 in file /Users/dhruvgovil/Projects/usd/pxr/imaging/hdSt/drawBatch.cpp : 'Failed to compile shader for prim /root/Sphere/Sphere.'

Steps to Reproduce

  1. Load the usda or mtlx file here in usdview, and look for the warnings in the terminal Diffuse Graphs.zip

System Information (OS, Hardware)

Happens on macOS and Linux

Package Versions

USD 24.3/24.5 with MaterialX 1.38.6 and MaterialX 1.38.10

jesschimein commented 3 months ago

Filed as internal issue #USD-9727