Too much load for babylon?

Im working on a warehouse model, and i tried to create around 1,00,000 boxes, the browser started to slow down and eventually it didnt load and the pc hang. Is there any workaround to this issue?

@carolhmj can you shed some light on this?

I would recommend you to look here - Copies, Clones, and Instancing | Babylon.js Documentation :slight_smile:

1 Like

sure, thank you

@RaananW The issue was resolved :), Thank you .

But another doubt i have is - I used SPS for loading these data, i would like to apply material for individual particles. How can i do that?

1 Like

The catch with cloning is usually the visualization of different clones/instances. SPS allows you to change the color of the different instances, but not the material. If you want a whole different material, you are probably better with cloning the meshes. That would, however, introduce more drawcalls (and thus will reduce performance).

what is function to change the color using sps, couldnt find any?

That’s a great example: https://playground.babylonjs.com/#2FPT1A#351

You can find a lot more here - https://doc.babylonjs.com/divingDeeper/particles/solid_particle_system

1 Like

My objective is to create boxes as in for the warehouse, so have to load the data from the csv file. So is it wise to go ahead with the sps or cloning would be better?

reuse as much as you can. if each of them has a different material you will need to clone and not instance. If there are 1000 boxes divided to 4 materials, create an instance for every 250 of them, assigning them this material. That would be an optimized way.

1 Like

I will be using material, just for coloring the boxes

so, instances (or the SPS) will do just fine :slight_smile:

I prefer instancing because it gives you simpler control over the different mesh’s transformation, but that’s a matter of taste.

Whilst this is true it is possible using a texture map, ie one image containing many textures, to assign different regions of the texture to different particles.

SPS and UVs

if it’s just about textures, that is a very helpful tip :slight_smile: