Skip to content
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

Re-support glTF 1.0 premultipliedAlpha #7419

Closed
OmarShehata opened this issue Dec 17, 2018 · 8 comments
Closed

Re-support glTF 1.0 premultipliedAlpha #7419

OmarShehata opened this issue Dec 17, 2018 · 8 comments
Labels

Comments

@OmarShehata
Copy link
Contributor

Cesium used to support the glTF 1.0 premultipliedAlpha property. This was removed in 1.50 when we we updated the glTF pipeline:

#6805 (comment)

This would only work when OIT is disabled. See forum thread:

https://groups.google.com/d/msg/cesium-dev/6dCttPKnJWw/vxCNm2jEBAAJ

This breaking change was not mentioned in CHANGES.md, which made this much harder to find. It might be worth adding a note about it there too.

@lilleyse
Copy link
Contributor

This affects some of our glTF 1.0 sample models. The propellers should be the lighter version, which I got only after editing the shader to not premultiply.

air-premultiplied

air-unpremultiplied

@xtassin
Copy link
Contributor

xtassin commented Feb 12, 2019

Using Cesium > 1.50 on iOS 12.x appears to always use premultipliedAlpha, no matter what value is specified in the GLTF model. On the other hand, Chrome on Windows 10 never uses premultipliedAlpha. This is a problem as it is impossible to use the same models and shaders on all platforms.

@xtassin
Copy link
Contributor

xtassin commented Jun 18, 2019

This is still an issue as of June 2019. Any chance of a fix coming soon or perhaps someone could give me a pointer on where to look so I could attempt to fix it myself?

@OmarShehata
Copy link
Contributor Author

@xtassin there was a recent fix where Chrome on Windows was incorrectly setting premultiplyAlpha to true, this was turned off in this PR: #7804

I imagine this is what's causing:

On the other hand, Chrome on Windows 10 never uses premultipliedAlpha.

Based on the discussion here: #7795 (comment) it sounds like always set premultiply to false was the intended outcome, so the fact that iOS is using premultiply is the problem here?

@xtassin
Copy link
Contributor

xtassin commented Jun 20, 2019

@OmarShehata yes, it appears iOS always requires premultiplied alpha. I am testing with an (old) iPad Air 2 with iOS 12.1.1

@xtassin
Copy link
Contributor

xtassin commented Aug 7, 2019

I would like to give an update: I have received screenshot from users on desktop where this problem is visible (wrong handling of pre-multiplied alpha). This would indicate that the issue may also be GPU/OS dependent. I will try to gather more details.

@xtassin
Copy link
Contributor

xtassin commented Aug 23, 2019

@OmarShehata, disabling orderIndependentTranslucency forces Cesium to use pre-multiplied alpha correctly on all platform. However, it creates other rendering issues that make it un-usable as a workaround in production.

@j9liu
Copy link
Contributor

j9liu commented Aug 19, 2022

I'm closing this issue, since as of 1.97 we're only providing limited support for glTF 1.0.

@j9liu j9liu closed this as completed Aug 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 participants