You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function HdSt_MaterialNetworkShader::CanAggregate() will compare the hash of the GLSL shader text to know if it can aggregate two material networks.
MaterialX will use the node names when generating a uniform variable name when there are connected ancillary nodes. If these node names vary, the hash will differ and the merging will fail.
Steps to Reproduce
Load attached scene in USDView goldRamp.zip
[BUG] compiles 11 GLSL shaders where only one would be needed
The scene was designed to show the issue by having a ND_dot_float with a varying name connected in exactly the same way on each surface.
Potential fix
One option would be to anonymize the node names in the network so they follow a consistent scheme. This will harmonize the uniform parameter names and allow more material networks to reuse the same shader.
System Information (OS, Hardware)
Package Versions
Build Flags
The text was updated successfully, but these errors were encountered:
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.
Description of Issue
The function
HdSt_MaterialNetworkShader::CanAggregate()
will compare the hash of the GLSL shader text to know if it can aggregate two material networks.MaterialX will use the node names when generating a uniform variable name when there are connected ancillary nodes. If these node names vary, the hash will differ and the merging will fail.
Steps to Reproduce
[BUG] compiles 11 GLSL shaders where only one would be needed
The scene was designed to show the issue by having a
ND_dot_float
with a varying name connected in exactly the same way on each surface.Potential fix
One option would be to anonymize the node names in the network so they follow a consistent scheme. This will harmonize the uniform parameter names and allow more material networks to reuse the same shader.
System Information (OS, Hardware)
Package Versions
Build Flags
The text was updated successfully, but these errors were encountered: