-
-
Notifications
You must be signed in to change notification settings - Fork 35.6k
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
Broken AOMap in USDZ with Transform2d #21906
Comments
If you hand edit the file to have the transform you expect, is it working in QuickLook? Based on the notes in https://github.com/google/usd_from_gltf#emulated-functionality-for-ar-quick-look, I'd thought it didn't support this:
^Since three.js requires multiple UVs for AO, and QuickLook apparently doesn't support them, that's a bit of an obstacle. 😕 |
Exported USDZ file has the correct transform and AO map has the scale of (1,1). I have tried to convert the same 3D model with:
The resulting USDA may differ in structure but Transform2d for textures is the same. I want to make an important note about UVs. If you have AO map on UV2 which is completely different from UV1 (intentionally made by 3D artist ), then of course, you can't put it on UV1 and hope that it will work well. I have experimented a bit trying to add the UV2 to USDZ meshes during the export. Then I tried to use st2 PrimVar based on UV2 for transformations. The result was not quite right. I mean it was somehow working, but it seems like tiling was extremely high, like 100x instead of 6-8 set in transform scale. Overall I think it is a good idea dig more into it. WorkaroundAs for now, you simply must sacrifice AO map in favor of tiling or vice-versa. One possible solutions if you want to have both is:
This solutions has 2 major drawbacks:
Possible solutionCan we still do something so we can have both AO and tiling in QuickLook?
So far I have successfully done 1 and 2. As for n3 there are a couple of challenges. In particular, we want to render parts of the geometry completely transparent and do not interact with lighting where AO map is near white . If you want to help me with this, do not hesitate ;-) |
This all sounds great, but I wonder if we could have a simpler solution short-term? Like detect when the AO map is not going to work right and just disable it? The render above is a big problem, but without AO at all, it would be decent, if not ideal. |
Looking in GLTF loader, it assumes that AO map should be on the second UV channel and if a geometry where there is a material with AO map does not have one, there is a workaround to create the second UV channel from the first one. The information about whenever the workaround was applied is unknown during the USDZ export. AO map won't work correctly in USDZ if it was initially on secondary UV channel by design. Maybe @Mugen87 knows how to extend the workaround in the way we can preserve the information about initial UV set used by AO map so we can use it to decide to exclude AO map from USDZ export. Please also correct me if any of the assumption I've made is wrong. There is another deciding factor to exclude AO map from export - when diffuse map is repeated more than once. I will make PR with this workaround soon. |
This should be now fixed: #25996 |
After introducing support for texture repeat and offset in #21852, the ambient occlusion map is repeated many times, despite the fact that we are setting the scale separately for each texture:
float2 inputs:scale = ${ buildVector2( texture.repeat ) }
To Reproduce
Steps to reproduce the behavior:
Expected behavior
AO map should not be tiled/repeated.
Screenshots
from #21871

Platform:
The text was updated successfully, but these errors were encountered: