Add HW generation support for compound material nodes#2829
Open
jstone-lucasfilm wants to merge 2 commits intoAcademySoftwareFoundation:mainfrom
Open
Add HW generation support for compound material nodes#2829jstone-lucasfilm wants to merge 2 commits intoAcademySoftwareFoundation:mainfrom
jstone-lucasfilm wants to merge 2 commits intoAcademySoftwareFoundation:mainfrom
Conversation
This changelist adds hardware shader generation support for compound material nodes such as LamaSurface, which are defined as node graphs with material-type outputs. The following specific changes are included: - Add an `HwMaterialCompoundNode` class that extends `HwSurfaceNode` for nodegraphs with material-type outputs, discovering BSDF, EDF, and opacity input name mappings by analyzing the nodegraph's internal surface node connections. - Refactor `HwSurfaceNode` to resolve input names through virtual methods rather than hardcoded strings, and add null-safety for inputs that may not be present on compound material nodes. - Fix the fallback condition in `getShaderNodes` to check whether shader nodes were found, rather than whether the material node has inputs. - Fix `isTransparentSurface` to identify material nodes by output type rather than node category, so that compound material nodes are handled correctly. Fixes AcademySoftwareFoundation#1902 and AcademySoftwareFoundation#2801.
Instead of looping over nodes to find the first surface node, use graph traversal from each output, which should be more robust in complex graphs.
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This changelist adds hardware shader generation support for compound material nodes such as LamaSurface, which are defined as node graphs with material-type outputs. The following specific changes are included:
HwMaterialCompoundNodeclass that extendsHwSurfaceNodefor nodegraphs with material-type outputs, discovering BSDF, EDF, and opacity input name mappings by analyzing the nodegraph's internal surface node connections.HwSurfaceNodeto resolve input names through virtual methods rather than hardcoded strings, and add null-safety for inputs that may not be present on compound material nodes.getShaderNodesto check whether shader nodes were found, rather than whether the material node has inputs.isTransparentSurfaceto identify material nodes by output type rather than node category, so that compound material nodes are handled correctly.Fixes #1902 and #2811.