Closed lanxinger closed 1 week ago
Hi! Thanks for the report.
As Dhruv says, this sounds like an iOS/Apple specific bug where the runtime does not fall back to the preview binding. guc should also author the default material binding instead.
I'll investigate the normal issue and keep you posted.
@lanxinger I've implemented the binding fix and am planning to release a new version in the next few days.
Unfortunately, I can't see any issue with the normals. Could you elaborate how the above screenshots were created? Also, could you verify that (if you used usdview) 'Flat Shaded' is not enabled?
I've also checked the converter output by setting TF_DEBUG=GUC and it doesn't generate flat normals. Furthermore, the USD file attached above seems to have valid smooth normals (here, rendered without material):
hi @pablode thank you for the quick action.
the screenshots above are from blender actually. I haven't tried usdview but good to know it is working properly there.
I am unable to change the shading to smooth inside blender for this model. maybe another ticket I need to file there for that. However it does seem to work properly for the initial USDZ we get from object capture: https://drive.proton.me/urls/ZYSW6YM7NW#XN8F3uwqvBMy
I think this may be a Blender issue based on following observations:
Perhaps this issue is related? https://projects.blender.org/blender/blender/issues/107696
Will try to verify with NVIDIA Omniverse.
Looks correct in Omniverse.. at least the normals.
Interestingly, the three NVIDIA render delegates didn't fall back to the preview material binding, too.
thanks @pablode for the thorough investigation. I have also suspected a blender bug for the normal shading. maybe I can contribute this issue to the filed ticket you linked above.
I wonder if the fallback to the preview material binding is somewhat related to the USD version being used in the build.
I see that in Apple's case it's reported as Apple USD Tools (0.24.3) which means it's one release behind the latest 0.24.5.
Maybe also worth filing this on the OpenUSD GitHub?
The binding issue should be fixed in 0.4, thanks for reporting!
Regarding the behaviour in USD: I don't think it's related to any version. My hunch is that it's caused by the HdRenderDelegate::GetMaterialBindingPurpose() getter, which allows the renderer to only return full
or preview
(unlike GetMaterialRenderContexts
, where a preference list is returned).
Moved over from a discussion on the Alliance for Open USD forum: https://forum.aousd.org/t/obj-gltf-to-usdz-usdzconvert-discontinued/1648/9
Material bindings are set to preview after performing a glTF to USDZ conversion with guc and iOS ARKit/RealityKit/SceneKit doesn't display the materials on the model as a result.
The model does display view the Storm Renderer used in macOS Preview though.
rel material:binding:preview = </Asset/Materials/UsdPreviewSurface/Materials/Texture>
changing that torel material:binding = </Asset/Materials/UsdPreviewSurface/Materials/Texture>
works as expected.I furthermore found the face normals get modified to flat shading during that conversion:
Here is the link the the USDZ model: https://drive.proton.me/urls/DJ0SRP3N44#20IZrmyz28Zy
Input glTF binary: https://drive.proton.me/urls/X9A1TRZN5G#HirzCL9ik1BG