Is my .glb file too big for Three js?

Hello. I’m new to Three Js, but I’m trying to import a big .glb file from Blender into Three Js.
The file is called successfully, and the console prints “Finished Loading” after 1 second (perfect), but it takes about 5-10 seconds extra for the actual objects to show. I tried converting it to an FBX file, but this removed all of the textures.
You can see my code below, which is where I fetch the asset.

Maybe my Blender file is too big or has too many textures. You can see my Blender file and the statistics below:

I spend a really long time making this Blender Room, so I really don’t hope I have to undo it. I have removed most of the faces/vertices that are not visible from the camera, but It is still slow.
Note: A lot of the objects are imported from SketchFab, which might have caused big textures and objects to be imported.

Is there perhaps a way to see how much the textures are filling? Since I have an idea that this is the problem.

Note: My .glb file is 570,4 MB, which I think is quite big, so how can I decrease this?

I really hope you can help from a stuck developer.

1 Like

Update. I just exported my Blender file without any textures. This makes the objects show instantly. So it is the textures that are the problem. How can I lower the time it takes to load the textures?

Update: My former .glb file was 570,4 MB with textures. My new .glb file without textures is 1,4 MB. WOW

The numbers here are ok.

This number is not ok. Since your vertex count is quite low, the majority of that file size is most likely caused by the textures. Consider using max. 2K textures (2048px) for usual objects, and 4K (4096px) only for very important things that will certainly be looked at up-close by the user. Try to reuse textures, and avoid applying ones that have no effect - ie. 4K black texture for roughness mapping can just be replaced by a single roughness numerical value of 0.

3 Likes

open shell, type: npx gltfjsx yourmodel.glb --transform --simplify ommit the simplify if it has too many blemishes. the cut off for me is 2-3mb, an asset should not be larger than that. 570mb is an entire day sitting and waiting for it to load on mobile.

1 Like

Compress the model in blender and then use draco to uncompress the model in threejs, this method will allow you to load heavy models.

Aren’t I already doing that? I just followed a tutorial, I’m very new to Three Js

1 Like

If the model is so large because of textures (common for Sketchfab models) then Draco compression will not help. Draco only compresses geometry.

1 Like

Welcome to the wonderful world of THREEjs, take your time on your journey of learning making wonderful worlds, there is much to discover. Unlimited possibilities to make and invent.

What possibilities do I then have? I have managed to lower the quality of the textures down to 512/512, and now the file is 82 MB. How can I lower it even more?

Could you share the file? We cannot guess what causes your file to be any given size from screenshots alone. Otherwise I would need to ask you to gather and share some statistics about the file.

I can’t share the file since it is bigger than 8 mb. But this is the information about it. Please let me know if you need more information.
Note: It was not 82 mb but actually 88 mb.

If you drop the model into https://gltf.report/ and then open the “metadata” tab, the page will give information about meshes, textures, and other resources in the file. That is the information we probably need here.

Alternatively you can extract this information on the commandline:

npm install --global @gltf-transform/cli

gltf-transform inspect path/to/model.glb
1 Like

Wow thanks. I can see the metadata, and I got some eye opener for which files that needs to be lowered. Can I send the whole “metadata” tab, or would I have to send individual screenshots? Because that would take up quite a lot of screen shots.

And also, notice all of my materials are double sided. Would it help if make this one sided? And if so how is that possible?
Thank you in advance

If you highlight+copy+paste the contents of the Metadata tab into a forum comment, it should be formatted reasonably well. Probably easier than screenshots!

Ok I here is the whole metadata:

photo_library

receipt_longrulecodedark_modevolunteer_activismcontact_support

Metadata

Overview

VERSION 2.0
GENERATOR Khronos glTF Blender I/O v3.5.30
EXTENSIONS KHR_draco_mesh_compression
KHR_materials_emissive_strength
KHR_materials_ior
KHR_materials_specular

XMP

No XMP metadata.

Scenes

ID NAME ROOT_NAME BBOX_MIN BBOX_MAX
0 Scene Pac Man Sign -14.24539, -0.24767, -10.15593 12.59443, 12.166, 9.36034

Meshes

ID NAME MODE PRIMITIVES GL_PRIMITIVES VERTICES INDICES ATTRIBUTES INSTANCES SIZE
0 Plane011_back_0 TRIANGLES 1 4,335 3,273 u16 NORMAL:f32, POSITION:f32,
1 Box051_arcade_0 TRIANGLES 1 1,378 2,441 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 86.38 KB
2 pCylinder1_blinn3_0 TRIANGLES 3 2,573 1,590 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 66.32 KB
3 Object_4.001 TRIANGLES 16 16,137 16,803 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 634.52 KB
4 Body_Screen_0 TRIANGLES 1 26 16 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32, TEXCOORD_1:f32 1 796 Bytes
5 My Skills Machine Material TRIANGLES 14 4,898 3,781 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32, TEXCOORD_1:f32, TEXCOORD_2:f32 1 206.56 KB
6 Object_3.006 TRIANGLES 1 772 1,300 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 46.23 KB
7 Object_4.006 TRIANGLES 4 11,008 11,328 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 428.54 KB
8 Cube.002_Center Cabinet_0.001 TRIANGLES 1 4 6 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32, TEXCOORD_1:f32, TEXCOORD_2:f32 1 312 Bytes
9 Cube.001_Outer Cabinet_0 TRIANGLES 3 9,338 9,009 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32, TEXCOORD_1:f32, TEXCOORD_2:f32 1 488.46 KB
10 defaultMaterial.001 TRIANGLES 1 24 20 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 784 Bytes
11 defaultMaterial.014 TRIANGLES 1 3,819 3,535 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 136.03 KB
12 polySurface1_M_fan_light_0 TRIANGLES 1 2,306 1,957 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 76.46 KB
13 Object_18 TRIANGLES 2 259 547 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 19.06 KB
14 poster_1_backing_AlleMaterials_0 TRIANGLES 2 11,174 7,415 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 304.32 KB
15 defaultMaterial TRIANGLES 1 3,669 3,938 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 148.03 KB
16 Menu_Menu_0 TRIANGLES 2 5,213 13,305 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32, TEXCOORD_1:f32, TEXCOORD_2:f32 1 669.92 KB
17 Cylinder.001_wall_mount_0 TRIANGLES 2 9,135 10,555 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 392.57 KB
18 Object_0.002 TRIANGLES 1 3,929 2,157 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 92.6 KB
19 Object001__0 TRIANGLES 1 512 934 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 32.96 KB
20 ��������������.002_Material_0.001 TRIANGLES 2 818 646 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 25.58 KB
21 Object_0.004 TRIANGLES 3 74 66 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 2.56 KB
22 DartCabinet_DartCabinet1_0 TRIANGLES 3 10,248 15,540 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 558.77 KB
23 Object_0 TRIANGLES 3 25,204 26,724 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 1.01 MB
24 Circle_Material.002_0 TRIANGLES 2 5,262 4,068 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32, TEXCOORD_1:f32, TEXCOORD_2:f32 1 226.84 KB
25 Object_0.003 TRIANGLES 1 1,299 862 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 35.38 KB
26 Phone_01_-_Default_0 TRIANGLES 1 6,323 5,224 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32, TEXCOORD_1:f32 1 246.9 KB
27 polySurface1_M_fan_light_0.001 TRIANGLES 1 2,306 1,961 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 76.59 KB
28 KAC_KAC_0.002 TRIANGLES 1 13,063 14,304 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32, TEXCOORD_1:f32 1 650.54 KB
29 Object_4.002 TRIANGLES 1 18 20 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 748 Bytes
30 Mesh.010 TRIANGLES 1 17,348 9,807 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 417.91 KB
31 Plane.035 TRIANGLES 1 2 4 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 140 Bytes
32 Plane.036 TRIANGLES 2 14 20 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 724 Bytes
33 Cube.012 TRIANGLES 1 72 144 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 5.04 KB
34 Plane TRIANGLES 1 2 4 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 140 Bytes
35 Text TRIANGLES 1 49,872 27,131 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 1.17 MB
36 Text.003 TRIANGLES 1 1,212 3,024 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 104.04 KB
37 Text.001 TRIANGLES 1 22,761 21,881 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 836.76 KB
38 Text.004 TRIANGLES 1 48,998 47,328 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 1.81 MB
39 Text.005 TRIANGLES 1 703 735 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 27.74 KB
40 Text.006 TRIANGLES 1 1,639 1,727 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 65.1 KB
41 Text.007 TRIANGLES 1 5,741 5,749 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 218.41 KB
42 Text.009 TRIANGLES 1 1,977 1,973 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 75 KB
43 Text.010 TRIANGLES 1 210 236 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 8.81 KB
44 Text.011 TRIANGLES 1 1,634 1,644 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 62.41 KB
45 Text.012 TRIANGLES 1 580 584 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 22.17 KB
46 Text.013 TRIANGLES 1 5,621 5,649 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 214.49 KB
47 Text.014 TRIANGLES 1 12,456 6,929 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 296.46 KB
48 Plane.002 TRIANGLES 1 2 4 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 140 Bytes
49 Text.002 TRIANGLES 1 1,267 1,335 u16 NORMAL:f32, POSITION:f32, TEXCOORD_0:f32 1 50.32 KB

Materials

ID NAME INSTANCES TEXTURES ALPHA_MODE DOUBLE_SIDED
0 back 1 baseColorTexture OPAQUE
1 arcade 1 baseColorTexture OPAQUE
2 blinn3 1 baseColorTexture OPAQUE
3 blinn6 1 OPAQUE
4 blinn1 1 baseColorTexture OPAQUE
5 string 1 OPAQUE
6 metal 1 baseColorTexture OPAQUE
7 isolent 1 OPAQUE
8 Material.007 1 OPAQUE
9 Material.039 1 baseColorTexture OPAQUE
10 leaking.005 1 baseColorTexture BLEND
11 material 1 baseColorTexture OPAQUE
12 TT_checker_512x512_UV_GRID 1 OPAQUE
13 Material.019 1 OPAQUE
14 Material.040 1 baseColorTexture OPAQUE
15 metal_light 1 OPAQUE
16 red.001 1 baseColorTexture OPAQUE
17 Material.038 1 baseColorTexture OPAQUE
18 Material.042 1 OPAQUE
19 Material.015 1 baseColorTexture OPAQUE
20 Material.037 1 baseColorTexture OPAQUE
21 Material.023 1 OPAQUE
22 Rubber.2 1 OPAQUE
23 Red_Btn 1 OPAQUE
24 Blue_Light 1 OPAQUE
25 Board_Sticker 1 baseColorTexture OPAQUE
26 Black_Plastic.1 1 OPAQUE
27 Screen_Sticker 1 baseColorTexture OPAQUE
28 Top_Sticker 1 baseColorTexture OPAQUE
29 Blue_Btn 1 OPAQUE
30 White_Btn 1 OPAQUE
31 Side_Sticker_0 1 OPAQUE
32 Yellow Shine 1 OPAQUE
33 Side_Sticker 1 baseColorTexture OPAQUE
34 Rubber 1 OPAQUE
35 Silver_-_High_Reflection 1 OPAQUE
36 About Me Screen Material 1 OPAQUE
37 lambert6SG.001 1 OPAQUE
38 lambert2SG.001 1 baseColorTexture OPAQUE
39 lambert3SG.001 1 baseColorTexture OPAQUE
40 Pink Shine 1 OPAQUE
41 Material.013 1 OPAQUE
42 Outer_Cabinet 1 baseColorTexture OPAQUE
43 Red Shine 1 OPAQUE
44 Projects Machine 1 baseColorTexture OPAQUE
45 Screen.002 1 baseColorTexture OPAQUE
46 AtariMachine.001 1 baseColorTexture OPAQUE
47 M_fan_light 2 baseColorTexture OPAQUE
48 matBody 1 OPAQUE
49 matNeon 1 OPAQUE
50 AlleMaterials 1 baseColorTexture OPAQUE
51 Material.011 1 OPAQUE
52 DefaultMaterial 1 baseColorTexture OPAQUE
53 Menu 1 baseColorTexture OPAQUE
54 Letter 1 OPAQUE
55 cover 1 baseColorTexture OPAQUE
56 cables 1 baseColorTexture OPAQUE
57 Basketball_size6 1 baseColorTexture OPAQUE
58 Scene_-_Root 1 baseColorTexture OPAQUE
59 Material.044 1 OPAQUE
60 Metal.001 1 OPAQUE
61 material_frame 1 OPAQUE
62 material_poster 1 baseColorTexture OPAQUE
63 material_matting 1 OPAQUE
64 DartCabinet1 1 baseColorTexture OPAQUE
65 DartBoard 1 baseColorTexture OPAQUE
66 Dart 1 baseColorTexture OPAQUE
67 Material.008 1 OPAQUE
68 Material.009 1 OPAQUE
69 Material.057 1 OPAQUE
70 Material.032 1 OPAQUE
71 Material.010 1 metallicRoughnessTexture OPAQUE
72 material_0.001 1 baseColorTexture OPAQUE
73 01_-_Default 1 baseColorTexture OPAQUE
74 material.001 1 baseColorTexture OPAQUE
75 Contact Me Screen Material 1 OPAQUE
76 m_bar_stool_01 1 baseColorTexture OPAQUE
77 Material.064 1 baseColorTexture, normalTexture OPAQUE
78 Material.066 1 normalTexture OPAQUE
79 Material.003 1 normalTexture OPAQUE
80 Material.001 1 baseColorTexture OPAQUE
81 Material.002 1 baseColorTexture, normalTexture OPAQUE
82 Material.006 1 OPAQUE
83 Material.021 1 OPAQUE
84 Material.005 1 OPAQUE
85 Material.014 1 OPAQUE
86 Material.016 1 OPAQUE
87 Material.022 1 OPAQUE
88 Material.024 2 OPAQUE
89 Material.026 1 OPAQUE
90 Material.027 1 OPAQUE
91 Material.030 2 OPAQUE
92 Alexander Text Material 1 OPAQUE
93 Pac Man Screen 1 OPAQUE
94 Material.017 1 OPAQUE

Textures

ID NAME URI SLOTS INSTANCES MIME_TYPE COMPRESSION RESOLUTION SIZE GPU_SIZE
0 pac man baseColorTexture 1 image/jpeg 4096x4096 763.98 KB 89.48 MB
1 yellow Sign baseColorTexture 1 image/jpeg 512x640 19.99 KB 1.75 MB
2 Controls Pac baseColorTexture 1 image/jpeg 512x512 14.07 KB 1.4 MB
3 Pac baseColorTexture 1 image/jpeg 1024x1024 140.21 KB 5.59 MB
4 Gradient Black baseColorTexture 2 image/jpeg 512x512 13.45 KB 1.4 MB
5 Contact 2 baseColorTexture 1 image/jpeg 482x252 43.02 KB 647.32 KB
6 Greassy Tex baseColorTexture 1 image/png 512x512 393.69 KB 1.4 MB
7 red baseColorTexture 1 image/jpeg 512x512 15.66 KB 1.4 MB
8 Image_9 baseColorTexture 1 image/png 512x512 397.15 KB 1.4 MB
9 Blue baseColorTexture 1 image/jpeg 512x512 19.34 KB 1.4 MB
10 Paper baseColorTexture 1 image/jpeg 502x337 22.79 KB 901.16 KB
11 Contact Machine Top 2 baseColorTexture 1 image/jpeg 350x90 12.04 KB 167.58 KB
12 Contact Machine Bottom baseColorTexture 1 image/jpeg 512x512 18.67 KB 1.4 MB
13 Skills panel baseColorTexture 1 image/jpeg 512x512 26.48 KB 1.4 MB
14 Skills Cover baseColorTexture 1 image/jpeg 512x512 51.37 KB 1.4 MB
15 Skills Top baseColorTexture 1 image/jpeg 512x128 21.98 KB 349.53 KB
16 Side Sticker baseColorTexture 1 image/jpeg 512x512 44.28 KB 1.4 MB
17 Colors baseColorTexture 2 image/jpeg 512x512 14.87 KB 1.4 MB
18 test2 baseColorTexture 1 image/jpeg 2048x2048 371.56 KB 22.37 MB
19 Projects Outline baseColorTexture 1 image/jpeg 512x512 27.3 KB 1.4 MB
20 blade baseColorTexture 1 image/jpeg 2048x2048 549.46 KB 22.37 MB
21 test space baseColorTexture 1 image/jpeg 1024x1024 279.63 KB 5.59 MB
22 Fan Light baseColorTexture 1 image/jpeg 512x512 20.64 KB 1.4 MB
23 Lamp baseColorTexture 1 image/jpeg 512x512 23.2 KB 1.4 MB
24 Menu baseColorTexture 1 image/jpeg 512x512 31.62 KB 1.4 MB
25 Cover baseColorTexture 1 image/jpeg 512x512 31.11 KB 1.4 MB
26 Cables baseColorTexture 1 image/jpeg 512x512 28.11 KB 1.4 MB
27 basketball tex baseColorTexture 1 image/jpeg 512x512 32.85 KB 1.4 MB
28 cola baseColorTexture 1 image/jpeg 512x512 24.61 KB 1.4 MB
29 Mars baseColorTexture 1 image/jpeg 512x512 52.1 KB 1.4 MB
30 Dart baseColorTexture 1 image/jpeg 512x512 32.94 KB 1.4 MB
31 dart skive baseColorTexture 1 image/jpeg 512x512 28.24 KB 1.4 MB
32 Dart arrow baseColorTexture 1 image/jpeg 512x512 21.62 KB 1.4 MB
33 Texture 1 metallicRoughnessTexture 1 image/png 512x512 191.35 KB 1.4 MB
34 Blue Talbe baseColorTexture 1 image/jpeg 512x512 10.86 KB 1.4 MB
35 Phone baseColorTexture 1 image/jpeg 512x512 21.46 KB 1.4 MB
36 Black Chair baseColorTexture 1 image/jpeg 512x512 21.59 KB 1.4 MB
37 Black Stool baseColorTexture 1 image/jpeg 1024x1024 68.45 KB 5.59 MB
38 carpet tx normalTexture 1 image/jpeg 1024x1024 257.28 KB 5.59 MB
39 cea1da08116d8991d0e76a56d272fdfd baseColorTexture 1 image/png 750x750 297.88 KB 3 MB
40 Blue Wall normalTexture 2 image/png 4096x4096 81.42 MB 89.48 MB
41 wood baseColorTexture 1 image/jpeg 1024x1024 70.29 KB 5.59 MB
42 tag normalTexture 1 image/jpeg 1024x1024 60.97 KB 5.59 MB
43 tag 2 baseColorTexture 1 image/jpeg 1024x1024 56.79 KB 5.59 MB

Animations

ID NAME CHANNELS SAMPLERS DURATION KEYFRAMES SIZE
0 Pac Man Sign 3 3 1 93 1.36 KB
1 Warning sign 3 3 1 93 1.36 KB
2 Pac Man Contols 3 3 1 93 1.36 KB
3 Contact Me Machine 3 3 1 93 1.36 KB
4 My Skills Machine 3 3 1 93 1.36 KB
5 Skills Screen 3 3 1 93 1.36 KB
6 About Me Machine 3 3 1 93 1.36 KB
7 About Me Screen 3 3 1 93 1.36 KB
8 Projects Machine 3 3 1 93 1.36 KB
9 Projects Machine Screen 3 3 1 93 1.36 KB
10 Space Invaders Machine 3 3 1 93 1.36 KB
11 Space Invaders Screen 3 3 1 93 1.36 KB
12 Fan Animation 1 1 1 1 31 620 Bytes
13 About Me Sign 3 3 1 93 1.36 KB
14 Gaming Poster 3 3 1 93 1.36 KB
15 Floor Lamp 3 3 1 93 1.36 KB
16 Skills Menu 3 3 1 93 1.36 KB
17 Name Background 3 3 1 93 1.36 KB
18 Basketball 3 3 1 93 1.36 KB
19 Fridge 3 3 1 93 1.36 KB
20 Trash Can 3 3 1 93 1.36 KB
21 Poster 3 3 1 93 1.36 KB
22 Dart 3 3 1 93 1.36 KB
23 Red Chair 3 3 1 93 1.36 KB
24 Red Chair.001 3 3 1 93 1.36 KB
25 Blue Table 3 3 1 93 1.36 KB
26 Phone 3 3 1 93 1.36 KB
27 Fan Animation 2 1 1 1 31 620 Bytes
28 Black Chairs 3 3 1 93 1.36 KB
29 Contact Me Machine Screen 3 3 1 93 1.36 KB
30 Bar Stool 3 3 1 93 1.36 KB
31 Black Bar Stool 3 3 1 93 1.36 KB
32 Floor.001 3 3 1 93 1.36 KB
33 Painted Wall 3 3 1 93 1.36 KB
34 Roof Stolper 3 3 1 93 1.36 KB
35 Roof 3 3 1 93 1.36 KB
36 About Text 3 3 1 93 1.36 KB
37 G Letter 3 3 1 93 1.36 KB
38 About Me Text 3 3 1 93 1.36 KB
39 About Me Sub-text 3 3 1 93 1.36 KB
40 Projects Text 3 3 1 93 1.36 KB
41 Projects Sub-text 3 3 1 93 1.36 KB
42 Skills Text 3 3 1 93 1.36 KB
43 Skills My Text 3 3 1 93 1.36 KB
44 Skills Sub-text 3 3 1 93 1.36 KB
45 Contact Me Text 3 3 1 93 1.36 KB
46 Contact Text 3 3 1 93 1.36 KB
47 Contact Email Text 3 3 1 93 1.36 KB
48 Alexander Text 3 3 1 93 1.36 KB
49 Pac Man Screen Object 3 3 1 93 1.36 KB

There’s a lot in the file, but in particular you have one texture (“Blue Wall”) that is 80 MB all by itself. That is far too much! If you unpack the file as a .gltf then you can resize and compress that texture alone, making sure not to change its name or file extension.

Something like this would be worth a try, as well:

gltf-transform optimize input.glb output.glb --texture-resize 1024 --texture-compress webp
1 Like

Hello.
It has been 2 months now, and I got my module size down to 4,9 MB. Which was great, until I released the website and got a performance rating of 67.

I am now trying to convert my texture files from .jpg to .webp, but I can’t seem to figure out how you make that command work.

I have seen your tweet: https://twitter.com/donrmccurdy/status/1513482996749197320/photo/3. But I don’t understand where I should write the command.

Of course it is in a Terminal, and I believe that I have installed gltf-transform, using this: npm install --global @gltf-transform/cli

But where do I write this command: gltf-transform optimize input.glb output.glb --texture-resize 1024 --texture-compress webp?

At first I fought I had to enter my .glb file with cd and then write the command, but that just gives the error “cd: not a directory: model”

Disclaimer: I’m very bad at terminal and raw commands like that.

you just execute it like that, only make sure you are in the same folder. you can also do this, then you don’t need to install it:

npx @gltf-transform/cli optimize input.glb output.glb --texture-resize 1024 --texture-compress webp
1 Like

I thought this worked, but it removed all of the textures that are not .jpg, but just normal Blender textures with a color. How do you prevent that from happening?

This command should certainly not be removing textures. Before optimization, does the file appear correctly in a viewer like https://gltf.report/, but not after? If so, could you file a bug report at GitHub - donmccurdy/glTF-Transform: glTF 2.0 SDK for JavaScript and TypeScript, on Web and Node.js. or share the model?