PixarAnimationStudios / OpenUSD

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

Storm shader compilation errors when using MaterialX triplanarprojection node. #3004

Open ld-kerley opened 8 months ago

ld-kerley commented 8 months ago

Description of Issue

When using the MaterialX <triplanarprojection> in a material, then Storm reports shader compilation errors.

Warning: in _ValidateCompilation at line 228 of usd/pxr/imaging/hdSt/glslProgram.cpp -- Failed to compile shader (FRAGMENT_SHADER): program_source:3197:35: error: use of undeclared identifier 'triplanar_filex'
    NG_triplanarprojection_color3(triplanar_filex, triplanar_filey, triplanar_filez, triplanar_layerx, triplanar_layery, triplanar_layerz, triplanar_default, geomprop_Pobject_out1, geomprop_Nobject_out1, triplanar_upaxis, triplanar_blend, triplanar_filtertype, triplanar_framerange, triplanar_frameoffset, triplanar_frameendaction, triplanar_out);
                                  ^
program_source:3197:52: error: use of undeclared identifier 'triplanar_filey'
    NG_triplanarprojection_color3(triplanar_filex, triplanar_filey, triplanar_filez, triplanar_layerx, triplanar_layery, triplanar_layerz, triplanar_default, geomprop_Pobject_out1, geomprop_Nobject_out1, triplanar_upaxis, triplanar_blend, triplanar_filtertype, triplanar_framerange, triplanar_frameoffset, triplanar_frameendaction, triplanar_out);
                                                   ^
program_source:3197:69: error: use of undeclared identifier 'triplanar_filez'
    NG_triplanarprojection_color3(triplanar_filex, triplanar_filey, triplanar_filez, triplanar_layerx, triplanar_layery, triplanar_layerz, triplanar_default, geomprop_Pobject_out1, geomprop_Nobject_out1, triplanar_upaxis, triplanar_blend, triplanar_filtertype, triplanar_framerange, triplanar_frameoffset, triplanar_frameendaction, triplanar_out);
                                                                    ^

Steps to Reproduce

  1. usdview triplanar.usda (from attached zip file)

Loading the same MaterialX file in to MaterialXView displays the material as expected. MaterialXView --material triplanar.mtlx renders

Triplanar_MaterialXView

Investigations

Taking a cursory look at the code it appears that Storm expects there to only be one input port of type filename per shader node. Here the triplanar node has three.

triplanar_bug.zip

jesschimein commented 8 months ago

Filed as internal issue #USD-9461