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

Improvements to triplanar blending #1350

Merged

Conversation

crydalch
Copy link
Contributor

@crydalch crydalch commented May 12, 2023

Fixes triplanar node's blending, so the corner's are not bright. Also adds a blend control for users to adjust the blending between maps. The default blend value of 1.0 matches the original behavior (apart from the brightness bug). Here is a comparison of the old triplanar (left), with the new (right):

mtlxtriplanar_orig_compare

Here are some different blend values, showing sharper or smoother blending of the maps:

mtlxtriplaner_blends

Math worked out mostly by @BrianSharpe.

… adds a blend control for users to adjust the blending between maps.
@jstone-lucasfilm jstone-lucasfilm changed the title Fixes triplaner node's blending, so the corner's are not bright. Also… Improvements to triplanar blending May 18, 2023
@jstone-lucasfilm
Copy link
Member

@crydalch @BrianSharpe I like the overall direction of this proposed change, but I suspect there may be an error in the math, as both MaterialXView and MaterialXGraphEditor render triplanarprojection nodes as uniform black when running with this pull request.

Here's the example MaterialX file that I'm testing, which renders as expected in the main branch, but renders as uniform black with this pull request.

triplanar_example.zip

@BrianSharpe
Copy link
Contributor

Here is a fix for the color3 version

NG_triplanarprojection_color3.txt

@BrianSharpe
Copy link
Contributor

Also, I think the blend parameter should have a UI min/max on there
<input name="blend" type="float" value="1.0" uimin="0.0" uimax="1.0" />

@crydalch
Copy link
Contributor Author

crydalch commented Jun 26, 2023

Thanks @jstone-lucasfilm and @BrianSharpe, I've committed a fix that seems to have things working again, and adds the UI min/max for the blend parm. I also went ahead and added those fixes to the other signatures as well.

triplanar_blend_mtlxgrapheditor

Copy link
Member

@jstone-lucasfilm jstone-lucasfilm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this great work, @BrianSharpe and @crydalch, and I believe it's fine to allow this change in brightness as it's effectively a fix to a bug in the original node graph.

@jstone-lucasfilm jstone-lucasfilm merged commit 8a11005 into AcademySoftwareFoundation:main Jun 27, 2023
13 checks passed
Michaelredaa pushed a commit to Michaelredaa/MaterialX that referenced this pull request Oct 21, 2023
Fixes triplanar node's blending, so the corner's are not bright. Also adds a blend control for users to adjust the blending between maps. The default blend value of 1.0 matches the original behavior (apart from the brightness bug).
@jomaro110
Copy link

Don't know if I can comment here but this node is very basic and needs more settings.

It's missing the alpha (opacity) values for each image (X, Y, Z) and scale & rotation as well.
And it needs a projection type: (Object, World, Reference).

Thanks

@jstone-lucasfilm
Copy link
Member

@jomaro110 This would be a great topic to bring up on the MaterialX channel of the ASWF Slack, where developers from SideFX, Autodesk, and other teams can weigh in with their thoughts.

Here is the top-level page on how to join the ASWF Slack, and you'll find the dedicated MaterialX channel there:

https://www.aswf.io/get-involved/

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

Successfully merging this pull request may close these issues.

4 participants