-
Notifications
You must be signed in to change notification settings - Fork 358
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
Add UDIM example and fix UDIM bug in MaterialXGraphEditor #2113
base: main
Are you sure you want to change the base?
Conversation
Hi @ld-kerley, |
@kwokcb Do you know where I can get that BB8 UDIM example? I'm happy to test something we know already works in the graph editor - perhaps there was a code regression or perhaps my new example is subtly broken somehow. I'm not super familiar with the graph editor code - which is why I was hoping @lfl-eholthouser would be able to take a look too. The way the current code appears to work it calls At least thats what I think I was seeing - I do think perhaps if the UDIMs were being assigned to separate pieces of geometry - then the fallback material assignment might be correct, by conicidence, but my understanding of UDIMs is that you're allowed to use multiple tiles on a single shape - at least that how we were using them at Imageworks. Now if only we had a normative specification for UDIMS..... :) |
Hi @ld-kerley, For the logic, MaterialXView has this option that Jonathan wrote: For Maya, which builds h/w a texture atlas Jerry and I added code to compute UDIM scale / offset hints which is inserted into the generated shader code. Not sure how to test this out but maybe worth adding in @JGamache-autodesk on the review ? For the code, I'd need to take a closer look as it's been a while :). |
Ahh the patch above is for the MaterialXGraphEditor - not MaterialXViewer. I didn't have any problem loading the asset in to MaterialXViewer (when using GLSL backend, MSL backend doesn't currently work). |
Hi @ld-kerley ! This seems like a great fix. The initial version of the Graph Editor did not support loading additional geometry so I think UDIMs were just not taken into account originally. You mentioned the asset working correctly in the Viewer is that without turning on split by udim? |
I hadn't changed any settings in MaterialXView - and when I load this mesh the split by UDIMs is enabled, and everything appears to render as I'd expect. Toggling this checkbox on/off does not appear to change the image at all for me . |
Got it! I was just curious if that was affecting the asset at all. |
This looks very promising, thanks @ld-kerley! Do you have a sense of why this faceting might be present on the face of the bunny model? Usually I would not expect multi-UDIM geometries to have divergent normals and tangents along their UDIM seams, and I wonder if something may have gone wrong in the split of this geometry into multiple UDIMs: Following the suggestion above from @kwokcb, I'll ask our team whether sharing the classic BB-8 geometry from earlier SIGGRAPH presentations might be an option in 2025, as this is a great multi-UDIM asset that has been used in both production contexts and public talks: https://materialx.org/assets/ASWF_OSD2021_MaterialX_slides_final.pdf#page=20 |
Ah, I see that the bunny geometry was created by @crydalch to demonstrate a bug in this post, and the associated material was created by me to resolve the bug in this follow-up post. As an alternative, perhaps an artist at one of our companies could put together a simple multi-UDIM example and contribute this to MaterialX? It could be as simple as three cubes with texture coordinates that fall in different UDIMs, allowing a different material to be displayed on each cube. |
@ld-kerley Would it make sense to split this into two contributions, where the rendering fix for UDIMs would be merged and included in MaterialX v1.39.2, and an artist would follow up and create a good multi-UDIM example file in the time frame of v1.39.3? |
c53a067
to
7ba8f10
Compare
I pushed an update with a simple cube as the example - hopefully this works for testing. |
Hoping to address #2007 - and also have some data to test while working on improving UDIM support in MaterialX.
I "borrowed" the example from here, and updated the textures a little to be able more easily differentiate the tiles.
Once I modified the textures it became clear that loading this in to MaterialXGraphEditor didn't actually load the correct images in to the correct materials. They would all end up using the fallback material, so this PR includes a small fix to address that.