-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Materials for Ground Primitives don't work for small areas on newer mobile devices #6739
Comments
I think it's a batch table problem. Here's a Sandcastle with a stripped down version of the shader that just computes texture coordinates using planar distances. Here's the same Sandcastle, but with all batch table reads replaced with hardcoded values. The former computes texture coordinates very incorrectly on iPad. |
Pretty sure it's because of how high/low values are being encoded. Sandcastle that just passes a diff between batch table read and expected from VS to FS. Haven't binary searched yet, but diff here is in the range of 980,000 to 990,000 in the R channel on our A9X iPad Pro. |
At @bagnell's suggestion, tried disabling floating point textures in the batch table which results in the same thing happening on Desktop. So that's interesting. The iPad should have float texture support though. |
Maybe the iPad is actually doing the same packing thing under the hood, which might also explain the depth texture problems... that is very bad. Regardless, I'll open a PR soon adding a check for float texture support. |
BTW on Desktop, using our float packing code, the diff doesn't seem to be as bad as it is on iPad. |
^ that was on Windows Nvidia, it's less on Linux/Intel which is interesting. [EDIT] that would also theoretically work for iPad, but we'd have to use feature detection to force something, which is never super satisfying. But it's better than just throwing in the towel! |
So I tried: All of these seem plausible on desktop but don't produce useable results on the iPad, so we probably have to scrap the range reduction idea. |
A good thing to have might be minimal proof of the iPad's float texture misbehavior, it'll at least help if we try to report this problem to Apple. |
I think I have to put this aside for a couple days at least, here's a few more notes for picking this back up: last resort
Two more ideas to try
|
Pointed out by @mramato: https://www.khronos.org/webgl/public-mailing-list/public_webgl/1703/msg00036.php It's nice to not be alone |
A lot of users have been running into this and #6735 lately, because Cesium currently uses materials for GroundPrimitives to batch corridors when it detects the required extensions and many users consider corridors to be a legacy "fallback" for polylines on terrain. For now we should disable both polylines on terrain and materials-on-GroundPrimitives on mobile, this way any legacy fallbacks will still work. |
I'm one of this users; Question: polylines on terrain are a very useful (and wanted) feature and are working on mobile (although with some graphical glitches when camera is too near or too far). For my use cases it would be better to be free to choose between polylines on terrain and corridors than disable the first ones at all. Thank you! |
Sandcastle
Increasing
offset
to larger than1.0
switches to spherical coordinates, which mostly works other than some depth precision issues.Related: #6735
[EDIT] for anyone new to this issue, Cesium uses the materials-on-GroundPrimitives codepath when available for batching colored
GroundPrimitives
, which is why on some newer mobile platformscorridors
on terrain won't work bu on earlier mobile platforms without depth texture support they will work.The text was updated successfully, but these errors were encountered: