-
Notifications
You must be signed in to change notification settings - Fork 322
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
Improve MDL thin-film support #1282
Improve MDL thin-film support #1282
Conversation
Hello! I'm seeing a regression when I use these changes with my MaterialX/MDL-based renderer:
I've prepared a glTF+mtlx version of this asset in hope that it can be reproduced with the MDL SDK DXR example: |
I can reproduce it. And it showed another problem as well:
@jstone-lucasfilm can you tell how such But I'm a bit surprised about the missing gold here. I'll investigate and keep you posted. |
Ah right, I brought up the color3-vector3 issue in #1038 before. I actually work around this in my renderer by patching the network, but dumped the source too early. I believe there were talks about adding a |
- push down the thin film parameters to the nodes that can use them, i.e., dielectric, conductor and generalized schlick - removed additional inputs, that transport thin film parameters, from the public material interface by making them non-editable - make sure thin_film will not result in undefined behavior when passing zeros as parameters (0 thickness disables thin film but 0 ior is invalid)
…tains TODOs for mix, add, and multiply
Due to bug in the MDL SDK this case is not handled correctly. A thickness of 0.0 should disable the layer completely. And IOR smaller than 1.0 is handled wrong. Adding this workaround which can be removed when bumping to MDL 1.8
0814f70
to
084e1ca
Compare
Looking into the regression and it revealed an MDL bug which will be fixed with MDL 1.8. Meanwhile, I added a workaround to detect the problematic case and handle it correctly. |
about the color to float conversion, I left a comment with a suggestion in #1038 |
If we want the vec3 version of USDUVTexture how about we bring it up in the MTLX/USD channel and see what folks have to say. |
@jstone-lucasfilm and @kwokcb is there something outstanding for this PR? I believe the type of the usd texture return rgb is a different topic discussed in #1038 |
@krohmerNV As long as the original regression noted by @pablode has been addressed, I'm not aware of any outstanding issues, and I'll plan to take a closer look at these changes soon. |
Signed-off-by: Jonathan Stone <jstone@lucasfilm.com>
Signed-off-by: Jonathan Stone <jstone@lucasfilm.com>
Signed-off-by: Jonathan Stone <jstone@lucasfilm.com>
Signed-off-by: Jonathan Stone <jstone@lucasfilm.com>
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.
Thanks for this improvement, @krohmerNV, and this looks good to me!
597bce9
into
AcademySoftwareFoundation:main
- push down the thin film parameters to the nodes that can use them, i.e., dielectric, conductor and generalized schlick - removed additional inputs, that transport thin film parameters, from the public material interface by making them non-editable - make sure thin_film will not result in undefined behavior when passing zeros as parameters (0 thickness disables thin_film but 0 ior is invalid)
push down the thin film parameters to the nodes that can use them, i.e., dielectric, conductor and generalized schlick
removed additional inputs, that transport thin film parameters, from the public material interface by making them non-editable
make sure thin_film will not result in undefined behavior when passing zeros as parameters (0 thickness disables thin_film but 0 ior is invalid)
Vertical Layering, push base deeper than one level, needs review, contains TODOs for mix, add, and multiply (If not 100% sure this is correct, we can drop that commit and postpone.