-
Notifications
You must be signed in to change notification settings - Fork 38
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
AlphaMode parameter is missing in the Material class #88
Comments
@kcoley i also see transparency is missing and scale values are literally high when converting gltf to usda. Can you please look into this asap? |
@ShantanuSriv @gopikrishnachaganti I didn't see an alphaMode option in the UsdPreviewSurface API spec, so I left it out: https://graphics.pixar.com/usd/docs/UsdPreviewSurface-Proposal.html There is a material opacity option, which I set using the base color factor, if a base color texture with alpha isn't set in Though I should set the opacity regardless whether there is alpha in the base color texture, which I can quickly fix. @gopikrishnachaganti when you say scale values, are you referring to normal scale, emissive factor, base color factor, etc? I also set these in usd_material.py based on their parameters though I can run some tests to verify they are working against these models: https://github.com/KhronosGroup/glTF-Asset-Generator/tree/master/Output/Material. If referring to model scale, models by default are scaled by 100 to convert from glTF meters to centimeters, though this can be adjusted with the |
@ShantanuSriv @gopikrishnachaganti I pushed a fix for opacity with base color factor that I mentioned previously. I also tested the alpha modes based on Though I am not sure if ArQuicklook is respecting the scale factors of the textures based on looking at the renders on Mac and iOS. @ShantanuSriv As for adding support for alpha modes to the USD spec, I think that is a good question for the USD interest group: https://groups.google.com/forum/#!forum/usd-interest |
@kcoley Thanks a lot for such a quick response! I will look into the new changes and test it. |
@kcoley I have tried converting the files from gltf to usdz. Even after the changes of the latest patch, I see the transparency issues. I have a question to ask: is this the issue with ARQuickLook or is there some edge cases that are not handled properly during the conversion. Plus, I have tried converting obj to usdz -- from another tool -- but the same transparency issues. So, what I have concluded that there is some issue with how ARQuickLook is handling transparency -- not sure though. Do you have any confirmation on this issue? Here are some of the files in glTF and its corresponding usdz-converted files: glTFusdz-convertedAlso, do you have any official usdz sample file from Apple which has transparency exposed in it? |
@ShantanuSriv hmm, it could be an issue with ArQuickLook. Apple does not have any sample usdz models with transparency on their gallery: https://developer.apple.com/arkit/gallery/ I noticed that if there is alpha in the base color texture, it gets used in ArQuickLook even when set to not be used in the UsdPreviewSurface in the usdz file. I could put in a check for that and overwrite the transparency to completely opaque if the alpha mode is set to opaque. |
@ShantanuSriv I just added support for alpha mode in the Material class (#93). Note that Alpha Mask is not yet supported in USD so it will default to Alpha Blend. If that doesn't fix your issue, feel free to reopen. |
gltf2usd/Source/_gltf2usd/gltf2/Material.py
Line 104 in 2fb00ed
I was going through the code and couldn't find anything which handles alphaMode parameter of material class -- for handling transparency nature of the asset? I wanted to know whether this is purposely left out because of no API support or did @kcoley miss adding the support for it?
As, I converted a few glTF files to usdz and there were issues with transparency of the converted files.
The text was updated successfully, but these errors were encountered: