Weekly Video: Faster Scenes and Smaller Scene Graphs with Thin Instances

Hey Everyone!

@Deltakosh is back with yet ANOTHER awesome video this week! If you’ve ever been curious about just how powerful Babylon.js can be, then you have to check out this video. Dive in to learn how you can render thousands upon thousands of copies of static objects while maintaining amazing framerates!

Playground from this video:

Other playground referenced:

12 Likes

Wow!!

2 Likes

Woaaw, I need to redo this demo with thin instances instead of instances with custom attributes
http://jerome.bousquie.fr/BJS/test/terrainInstances.html

Don’t have the time for now, but maybe someone could quickly change this demo from the instance custom buffers doc into the same demo for ThinInstances : Babylon.js Playground

1 Like

I understand that his instances do not take into account collisions. Is it true? And why ?
But I think that to create a lot of herbs it can be very useful. They don’t need collisions.

The second PG is on the other hand with normal instances and not Thin Instance.

Documentation here:
https://doc.babylonjs.com/how_to/how_to_use_thininstances

This is awesome! :slight_smile:
Even still getting 60fps when lighting / shading is enabled!
https://playground.babylonjs.com/#PYL7JG#8

Actually, This is mental :laughing:
Reaching 25-30 fps with 1.953.125 (125 * 125 * 125) shaded Thin Instances.
And this is on a old high/mid-range gaming pc from 2014!
https://playground.babylonjs.com/#PYL7JG#10

I love it :slight_smile:

2 Likes

Congrats !! So, I’m late to the party. Minor stuff I found: renderOverlay is not supported when thinInstances are present. Perhaps this can be reflected in the limitations part of the doc?

Perf is great, I’m not picking up ANY overhead on scene.meshes / drawcalls / fps. Do I have to do anything with regard to disposing the mesh / garbage collection ?

outline & overlay rendering will work for thin instances after this PR is merged:

No, nothing specific to do for thin instances. The thin instance specific data will be disposed when you dispose the mesh.

3 Likes

@Evgeni_Popov Awesome work ! Tested, works. Thank you very much !!!

erm, is CSM supposed to work with thin instances yet ? I’m not seeing any shadows when thininstances are called. Repro: https://playground.babylonjs.com/#QY1WYT#244 Comment out the lines to do with thin instances to see the diff.

It does work with a simple PG: Babylon.js Playground

Having a look at your PG.

Did not see you were speaking of CSM! There was also a problem with the non CSM shadows because of bounding box computation.

Here’s the fix:

2 Likes

Tested, works. Thank you very much !!!