Replies: 5 comments 1 reply
-
Thanks for the detailed analysis! I believe the warnings are spurious - glTF validator just doesn't know about KTX2 (might file a feature request on them). AR problems aren't too surprising - for iOS, USDZ autogeneration is failing (not too surprising), so you can use As for why Android is getting the wrong pixel values, that sounds like a problem with the basis-universal transcoder, so we'll have to follow up with them. |
Beta Was this translation helpful? Give feedback.
-
The JS console on Android has some pretty serious warnings:
This is on my Pixel 4a, and it's not showing a texture for any of your three examples. Do these have insanely large texture dimensions? I would not expect a 100MB model to render on any mobile GPU - you'll need to make a much downsampled version. And based on the size of the screen you're rendering on, that high res data would be wasted anyway. |
Beta Was this translation helpful? Give feedback.
-
Sorry, I saw the reply but was too busy to respond.
This seems to be due to glitch.me changing CDN links, after I posted the issue or maybe the project had timed out. I have refreshed the project now and updated the
Oh yes. These did have large textures. Meshroom defaults to 8192x8192 with 2x downscaling. So, the textures were in 4K. I have rerun the Meshroom pipeline and now, the textures for the meshes on the glitch.me site, are in 2K (4096 + 2x DS). This seems to be directly related to the "dark mesh" issue. After using a smaller texture size, This raises the following questions though:
The 300 - 400 MB figure was just to highlight how good meshopt is and why I require it in my project. The actual meshes would undergo further decimation / simplification. |
Beta Was this translation helpful? Give feedback.
-
Oh, and one more thing - if |
Beta Was this translation helpful? Give feedback.
-
Thanks for the details! I'm honestly not sure about answers, but everything to me is pointing to GPU OOM, in which case there's probably not much actionable for us here. It doesn't surprise me that it would affect subsequent models, since all the RAM is shared. For performance, you really don't want to be anywhere near the RAM limit, so I'd recommend you push through your "further decimation / simplification" and then you shouldn't have to worry about this anymore. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
In Chromium and Chromium-based browsers on Android,
<model-viewer>
displays meshes as completely dark or rarely with light and dark patches. This happens for meshes optimized / compressed usingmeshoptimizer
, with the following command:gltfpack -i input.glb -o output.glb -cc -tc
. Here,cc
denotes compression level, whiletc
is used to "convert all textures to KTX2 with BasisU supercompression". The purpose of this compression is to save storage space and bandwidth while serving the models over the web. Oddly enough, this problem never occurs on Chromium and Chromium-based browsers on the desktop on any platform. Safari (iOS + iPadOS / macOS) & Firefox (Android, desktop etc.) are completely unaffected too.If I remove the
-tc
flag, the models are loaded correctly. I have tried usinghttps://modelviewer.dev/editor/
to check for errors. There are no errors in any case, but there are some warnings that seem relevant. These are the outputs with & withoutKTX_texture_basisu
(-tc
) and also, for the uncompressed mesh:Flags:

-cc -tc
/ Max compression /KTX_texture_basisu
| Size: 6 MB | Shows up dark on Chromium on Android.Flags:

-cc
/ Medium compression / NoKTX_texture_basisu
| Size: 27 MB | Loads fine everywhere, but AR button may not work.No compression: Size: 34 MB | Loads fine everywhere & AR works without problems.

Note that, in these images, the models look okay, because the screenshots are from Edge on PC. Check the glitch.me link below for a demo.
As you can tell from the file-sizes,
meshopt
's compression is quite good. And I need this high compression level, since the actual meshes are going to be 1 - 2 GB in size. Withmeshopt
's compression, using those flags, I have been able to bring the size down to ~300 - 400 MB, without a drastic loss in quality. Is there a workaround for this issue?I am also fine with another model-viewer compatible compression scheme, that can nearly match
meshopt
. I have trieddraco
, but the results haven't been as good, at least not without substantial loss in quality.I am also puzzled by the models loading fine on Chromium etc. on PC. Could this be due to how Chromium
/
model-viewer
interacts withmeshoptimizer/meshopt_decoder.js
?Also, not sure if this is relevant, but the models have been generated via AliceVision Meshroom's photogrammetry pipeline.
Some possibly non-essential information:
The "Deploy Mobile" option on the editor page doesn't quite work. The model seems to load initially on the phone, but then the loading gets stuck. Refreshing doesn't help either. This always happens for models with
KTX_texture_basisu
in my testing.This issue also seemingly affects model-viewer's AR button's functionality, but I want to test it more, since the results I have are inconsistent. At the moment, AR never works with the
-tc
flag applied, but it does work sometimes without the flag. By "never works", I mean, on Android, it complains about there being "something wrong with the object" and on iOS / iPadOS, the button disappears, but the QuickLook view never opens. And by "work sometimes", I mean, the same model (-cc
, no-tc
) without any change to any part of the process, except a different time of day, loads without issues. Just including this for completeness' sake. More testing is needed.Live Demo
https://sparkling-mercurial-muenster.glitch.me/ (Ignore the astronaut poster)
Version
Browser Affected
OS
AR
Beta Was this translation helpful? Give feedback.
All reactions