A lot of memory with GLTF

Could you share the code you’re using to dispose the original model in a new thread? It sounds like it isn’t fully being disposed, perhaps.

EDIT: Oh, I see How to free up render memory?. Let’s continue discussion there in order to keep this thread on topic.

1 Like

If you’re having trouble installing it could you post details? I’d rather fix that if possible.

Thank you sou much, you made me thing about the installation, the problem was in the executable .toktx, I had in other directory, so I change to /usr/bin/lib and gltf-transform work fine, thank you so much

By the other hand, do you kwon I can fix this ?

RENDER WARNING: texture bound to texture unit 0 is not renderable. It might be non-power-of-2 or have incompatible texture filtering (maybe)?

The eyes are the only texture that show in black in Android devices and Chrome in Mac Os, in iOS devices and Safari Mac OS looks good

Thank you!

This sounds like the issue described in A lot of memory with GLTF — textures need to use power-of-two dimensions, like 512px/1024px/2048px, and they need to be small enough that mobile devices can support them. Try to make sure that no texture is any larger than 2048px. You’ll need to resize the textures before converting them to Basis.

2 Likes

Hi @donmccurdy,

I’m trying to load a gltf model has size around 150MB ~ 200MB, and launch a web app in mobile devices.
Sounds like impossible.
Any recommendations?

Thank you!

You’ll need to optimize the glTF model further until it is within the device’s limitations. There are a number of threads about this topic on the forums and elsewhere, one good example is this thread:

But as mugen87 mentions there, optimizing requires you to understand what parts of your model are not optimized to begin with. If you need help with that, I would recommend starting a new thread and sharing information about the model you’re trying to improve.

1 Like

Thank @donmccurdy,

I also found out another thread about how to reduce the file size of glTF model which use gltf-pipeline as mugen87 suggested in this thread.
However, I’m still stuck in reducing file size of my model.

My original file is 43.4MB, but when I do:
gltf-pipeline -i MyModel.glb -o modelDraco.gltf -d
and the new file is made with 51.3MB in size.

The other option to do is:
gltf-pipeline -i MyModel.glb -o model.gltf
But the new file is 57.9MB in size.

Am I doing anything wrong?
Thanks,

Before trying to reduce the size of the model, you’ll need to figure out why it’s large to begin with. Draco compression reduces geometry size, but a model could be large for other reasons: large textures, animations, node trees, etc. The quickest way I know of to debug is with the gltf-transform inspect input.glb CLI, which should print your mesh and texture sizes.

Aside, the reason the model’s size is actually increasing in your example is because it’s being converted from .glb (binary) to a .gltf (plaintext with embedded Data URI). A better set of options, if Draco is in fact necessary for this model, would be:

gltf-pipeline -i MyModel.glb -o ModelDraco.glb -d -b

If the model has large textures (this is usually the problem) then you’ll want to unpack them, resize or compress the textures, and repack the file:

gltf-pipeline -i input.glb -o tmp.gltf --separate

// ... resize textures in whatever tool, then ...

gltf-pipeline -i tmp.gltf -o output.glb -b
1 Like

Thanks, @donmccurdy

Now I got 38.4MB in size.
I probably need to resize the textures as you said. This could be a problem.
Anw, thanks a lot! :slight_smile:

1 Like

You rocks!! Thank you so much!
I’ve resized the eyes by 2048px to 512px and works fine
Again thank you!

1 Like