Improve rendering speed

Hello everyone

This is my PG for 10 cube: https://www.babylonjs-playground.com/#ZEZLAT#39

In Final Project I have 4000 cubes, and the rendering speed is somehow slow, I tried instances and SPS,
I couldn’t use instances because of colorLerp and also I couldn’t use SPS because I need getBoundingInfo() of each cube, is there another way to use to optimize the speed of my Block Model?

wait did you check with @jerome for the bounding info?

Also why colorlerp is not possible? can you elaborate on that?

Hi @Deltakosh
I don’t know how can I access to @jerome. Should I message him directly? @JohnK said that I cannot access to bounding info of cubes with SPS.
is it possible to colorlerp with instances?

Well for colorlerp, you have access to the buffer data so eventually you can do what you want with it

this is my PG with instances: https://www.babylonjs-playground.com/#ZEZLAT#18
how can I access to the buffer data?

Well you should start from the video I did. I create specific buffer for instances to host their color:
https://doc.babylonjs.com/how_to/how_to_use_instances#custom-buffers

@aWeirdo said that

This is what I actually said How to use SPS correctly? - #16 by JohnK

Sorry for my mistake, Yes @aWeirdo said that.
I’m so sorry for my mistake.
@JohnK and @aWeirdo , thank you so much for your helping, maybe I didn’t understand clearly your recommends.

1 Like

Thank you so much, I have done it. Thank you a lot.
is it possible to ask another question?

https://www.babylonjs-playground.com/#ZEZLAT#40

why when I selected each cube didn’t display bounding box?

you have error on the console :wink:

For me there is no error:

https://www.babylonjs-playground.com/#ZEZLAT#42

I can get the location of each cube but I don’t know why didn’t show boundingbox

Please read the doc : Solid Particle System - Babylon.js Documentation
You can access each cube bounding box in the SPS when enabling the intersections.


Maybe should you turn this property to un-hidden in the code comment …?
1 Like

Thank you so much. :pray: