0

When I am changing the texture of my mesh, on some computers, the application freeze for like half a second. I do that on 100 different mesh. On the Chrome profiler I see that the Three.js method setTexture is on top of the CPU usage.

The method I use to apply the next texture is the simplest:

this.materials.map = this.nextTexture;

This is working but I have no idea how to optimize this. If use a particle system instead, would it improve something?

Thanks a lot

Alex Wayne
  • 178,991
  • 47
  • 309
  • 337
BaptisteB
  • 1,168
  • 2
  • 9
  • 16

1 Answers1

0

Are you really using 100 different textures?

Try sorting your objects according to texture, to minimize texture swapping.

Texture-change is one of the more expensive GPU operations.

bjorke
  • 3,295
  • 1
  • 16
  • 20