-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
Loader: MaterialX #24707
Loader: MaterialX #24707
Conversation
Looking great! 🙏 Minor thing: Instead of using a dropdown, maybe it would be better to display all the materials at once by repeating the model in a grid? |
This looks very promising, @sunag! In order to make visual validation as straightforward as possible, you might consider including the https://academysoftwarefoundation.github.io/MaterialX/ This would allow comparisons between the two viewing environments, with lighting environments sufficiently aligned to discern subtle visual differences. One visual difference that often comes up is slightly different interpretations of color spaces, where the color triples values in our example library are in https://github.com/AcademySoftwareFoundation/MaterialX/blob/main/resources/Materials/Examples/StandardSurface/standard_surface_carpaint.mtlx#L2 |
// Original shader code from: | ||
// https://github.com/AcademySoftwareFoundation/MaterialX/blob/main/libraries/stdlib/genglsl/lib/mx_transform_color.glsl | ||
|
||
export const mx_transform_color = code( `#define M_AP1_TO_REC709 mat3(1.705079555511475, -0.1297005265951157, -0.02416634373366833, -0.6242334842681885, 1.138468623161316, -0.1246141716837883, -0.0808461606502533, -0.008768022060394287, 1.148780584335327) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can actually convert this code to ShaderNode code already?
|
||
node = this.getNodeByName( 'value' ); | ||
|
||
} else if ( element === 'position' ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we move this to MtlXLibrary?
|
||
node = positionLocal; | ||
|
||
} else if ( element === 'tiledimage' ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can move this (and image
) to MtlXLibrary, if we use a ShaderNode there and pass file
similar to other arguments.
@LeviPesin I'm thinking of reviewing this after the |
Related issue: #24674
Description
Finishing the first version of MaterialX Loader...
https://raw.githack.com/sunag/three.js/dev-materialx-loader/examples/webgl_nodes_loader_materialx.html
This contribution is funded by Google