google / usd_from_gltf

Apache License 2.0
547 stars 86 forks source link

Handling of baseColorFactor alpha highlights Quick Look renderer issue #28

Closed TyLindberg closed 4 years ago

TyLindberg commented 4 years ago

Currently when a glTF file specifies a baseColorFactor with an alpha value less than 1 and sets alphaMode to BLEND, the converter will bake that alpha value into base color texture. Doing so causes the transparency rendering issue referenced in the README to occur. If instead the the alpha value is set directly in the USD material and the texture is left unchanged, the renderer better represents the transparency while also decreasing overall file size by keeping JPEG compression on the texture.

I've attached a source glb file with an example alpha material along with two directories of USD assets. One is the output from usd_from_gltf and the other is model with the alpha set directly in the USD material.

usd_from_gltf_alpha_example.zip

C0DED00D commented 4 years ago

Hmmm... I thought there was an issue with material colors which is why we did that way. However, we did most of the compatibility testing on iOS 12. What version of iOS are you using for testing? Did you try on both? We've noticed difference in the feature set but have largely been trying to keep compatibility with iOS 12 for now.

Thanks!

On Thu, Nov 7, 2019, 2:05 PM Tyler Lindberg notifications@github.com wrote:

Currently when a glTF file specifies a baseColorFactor with an alpha value less than 1 and sets alphaMode to BLEND, the converter will bake that alpha value into base color texture. Doing so causes the transparency rendering issue referenced in the README https://github.com/google/usd_from_gltf#rendering-differences-between-gltf-and-ar-quick-look to occur. If instead the the alpha value is set directly in the USD material and the texture is left unchanged, the renderer better represents the transparency while also decreasing overall file size by keeping JPEG compression on the texture.

I've attached a source glb file with an example alpha material along with two directories of USD assets. One is the output from usd_from_gltf and the other is model with the alpha set directly in the USD material.

usd_from_gltf_alpha_example.zip https://github.com/google/usd_from_gltf/files/3821892/usd_from_gltf_alpha_example.zip

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/google/usd_from_gltf/issues/28?email_source=notifications&email_token=ABJPWAA2GLC3EEEL63WYBETQSSGLDA5CNFSM4JKOPRHKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HXXRUQA, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJPWAFW4EMT54CA5LUY3OTQSSGLDANCNFSM4JKOPRHA .

TyLindberg commented 4 years ago

Yeah, I'm seeing the same rendering results on iOS 12 and 13.

C0DED00D commented 4 years ago

Ok, we'll add it to our backlog to investigate!

hujasonx commented 4 years ago

@TyLindberg Hi Tyler, can you try again with the latest code? I believe this should be fixed now.

TyLindberg commented 4 years ago

Just ran a quick test and it seems to be working on my end. Thanks for the fix!