# Browser freeze with model

**URL:** <https://discourse.threejs.org/t/browser-freeze-with-model/57700>\
**Category:** Questions\
**Tags:** optimization\
**Created:** [November 2, 2023, 8:46pm UTC](https://discourse.threejs.org/t/browser-freeze-with-model/57700 "2023-11-02T20:46:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tibi](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/tibi/32/61300_2.png) [@Tibi](https://discourse.threejs.org/u/Tibi)\
**Post date:** [November 2, 2023, 8:46pm UTC](https://discourse.threejs.org/t/browser-freeze-with-model/57700/1 "2023-11-02T20:46:58Z")

</div>

I am loading a GLTF model this one [Sony A9 II with Lens - Buy Royalty Free 3D model by CG Asura (@CG.Asura) [a83807c] - Sketchfab Store](https://sketchfab.com/3d-models/sony-a9-ii-with-lens-a83807cb7ec64568a8bc7712b5294760)

For some reason I don’t understand why the browser freezes for a few seconds, can I do something about this, what exactly is going on?

Thank you!

---

<div class="post-metadata">

**Author:** ![lafis](https://avatars.discourse-cdn.com/v4/letter/l/94ad74/32.png) [@lafis](https://discourse.threejs.org/u/lafis)\
**Post date:** [November 2, 2023, 10:02pm UTC](https://discourse.threejs.org/t/browser-freeze-with-model/57700/2 "2023-11-02T22:02:52Z")

</div>

I wouldn’t be surprised if it’s down to the texture count and resolutions - 24 4k textures is a lot of data to transfer to the GPU! I think that’s around 1.5GB of GPU memory.

If that is the issue, you could try and downscale some of these textures to smaller resolutions and see if that helps alleviate it.

---

<div class="post-metadata">

**Author:** ![donmccurdy](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/donmccurdy/32/33209_2.png) [@donmccurdy](https://discourse.threejs.org/u/donmccurdy)\
**Post date:** [November 2, 2023, 10:05pm UTC](https://discourse.threejs.org/t/browser-freeze-with-model/57700/3 "2023-11-02T22:05:23Z")

</div>

In most cases the problem is textures, yeah. It takes a long time to decompress and upload large textures – this cost is entirely based on their _resolution_, not file size.

I can’t see any information about the model without buying it, but you can try:

```bash
npm install --global @gltf-transform/cli

gltf-transform inspect scene.glb 

```

To just resize textures to 1K or so, try:

```bash
gltf-transform resize input.glb output.glb --width 1024 --height 1024

```

Or to optimize and compress the whole model more aggressively

```bash
gltf-transform optimize input.glb output.glb --texture-size 1024 --texture-compress ktx2 --compress meshopt

```

There are a lot more options, run things with `--help` to see what’s available and what works for your model. KTX2 textures do not require decompression and upload to the GPU much faster, which helps if you can’t reduce resolution any further. But 24 x 4K textures is too much for this model, artists do not usually optimize models for the web, you’ll have to plan on doing that after buying models.

---

<div class="post-metadata">

**Author:** ![Tibi](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/tibi/32/61300_2.png) [@Tibi](https://discourse.threejs.org/u/Tibi)\
**Post date:** [November 3, 2023, 8:44am UTC](https://discourse.threejs.org/t/browser-freeze-with-model/57700/4 "2023-11-03T08:44:45Z")

</div>

Thank you guys for the info, I modified the textures using photoshop to 1k, and is good now. I also reduced a bit the vertices of the model with blender but I think the issue was the texture size (width/height) as you guys suggested.

Thank you!
