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

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

Open
ld-kerley opened this issue Mar 16, 2024 · 1 comment

Comments

@ld-kerley
Copy link

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
Copy link
Collaborator

Filed as internal issue #USD-9461

erikaharrison-adsk pushed a commit to autodesk-forks/USD that referenced this issue May 6, 2024
Fixes:

- MaterialX: Storm fails to reuse GLSL shaders for networks differing only on node names PixarAnimationStudios#2330
- Storm shader compilation errors when using MaterialX triplanarprojection node. PixarAnimationStudios#3004
- Improve transparency detection and fix generation

Using a topo-trimmed network resulted in all shaders being generated
with opaque semantics. The shaders are now created with the right
transparent hardware settings.

Also improved transparency detection at the _GetMaterialTag level by
adding more checks for known surfaces and delegating to MaterialX when
dealing with custom shaders, but without generating the full MaterialX
document.
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

2 participants