How to get memory usage by model

Hi @all, I want to know how do i get the info about how much memory is used by the model?
is it possible to get the detail of it like in this demo someone used? this might help

1 Like

is there any other way also so i can generate form my side ?

currently I’m using gltf transform to generate the files but in that file there is no info about memory usage.

With GLTF-Transform you may count textures VRAM with this snippet:

        let totalVRAM = 0;

            .forEach((tex) => {
                const vram = ImageUtils.getVRAMByteLength(tex.getImage()!, tex.getMimeType());
                totalVRAM += vram!;
1 Like

I’m using the gltf cli, is there any other way to get the result using the cli or should i have to write code for it?

gltf transform cli gives the analytics, try that

GLTF-Transform CLI gives the GPU size for each texture but doesn’t count the total sum.

 gltf-transform inspect somefile.glb --format=csv

You may grab csv and count the total from it.
Or remake inspect.ts to get the desired info - glTF-Transform/packages/functions/src/inspect.ts at a99ff403ba976a05374369556119d76ed555a329 · donmccurdy/glTF-Transform · GitHub
Or write your own function just for this purpose, as here -

1 Like