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

Extending mix node to allow per channel mixing #1063

Closed
friedererdmann opened this issue Aug 31, 2022 · 3 comments
Closed

Extending mix node to allow per channel mixing #1063

friedererdmann opened this issue Aug 31, 2022 · 3 comments

Comments

@friedererdmann
Copy link
Contributor

Hello,

we're trying to currently match a large number of shaders that have been created in a game engine to MaterialX counter parts. Our current shaders are making use of HLSL code.

While trying to translate the functionality of lerp from HLSL we tried matching it to MaterialX' mix node, which seems to serve the same purpose. However, mix only takes a float as blend argument, making per-channel interpolation impossible.

I'd like to ask if it would be possible to overload mix to also allow the mix input to match the data type of fg/bg to allow per channel blending?

The same change would most likely benefit also most other compositing nodes.

@jstone-lucasfilm
Copy link
Member

This sounds like a good proposal to me, @friedererdmann. Feel free to write up a pull request for this change if you have the bandwidth, and we'll plan to update the specification for mix and other similar nodes in the 1.39 specification.

@friedererdmann
Copy link
Contributor Author

I've started experimenting here https://github.com/friedererdmann/MaterialX/tree/extend_mix_datatypes but since this is my first contact with MaterialX' codebase, I'm very open to suggestions if I approach this correctly.

@jstone-lucasfilm
Copy link
Member

Thanks for this original report, @friedererdmann, as well as for the fix in #1077!

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