Incremental Babylon guide for dummies

Thanks Carol, I’m glad it wasn’t just my blender settings then. How do I go about adding this into my code so I can test?

Once the PR is merged (I’ve already pinged the people who can do it :smiley: ) you just need to update (or redownload) the Exporters repository and build the .exe again :slight_smile:

ok lovely, thank you :slight_smile:

I see the code you placed so I updated the project cs file and ran through the process again. The file now exports perfectly :slight_smile: thank you so much. Looking forward to having a play with incremental loading my rather large file :slight_smile:

1 Like

How does this work with externally hosted files? I use dropbox and I’m not sure whether this would work even if all the files are in the same folder (it’s not currently loading) that way. Is there a better place to host files externally?

Hosting it on Github seems to work for me :smiley: See this example loading the incremental file at: quick-demos/assets/scenes/ball_and_floor at main · carolhmj/quick-demos (github.com)

Example of loading an incremental file | Babylon.js Playground (babylonjs.com)

Thanks Carol I’ll give that a go :slight_smile: I can only see the ball in that example and not the floor but I’m not sure if you’re supposed to see the floor.

I moved the floor a little bit to the left so that it doesn’t load immediately :rofl:

ooo I see it now haha :slight_smile:

Hi,
Some some years ago, I using this an .exe file and a .bat file. It simplifies things.
This converts the babylon file to babylon.incremental

The Babylon team can put this link in the doc if needed. I think it may be useful and easier to find than here

Incremental.zip (248.6 KB)

2 Likes

Hi Carol, I hope you’re well.

So I had the incremental file working but it’s still 60mb and 120 files in total. The file doesn’t seem to load as I had expected it too. From the first camera view. It seems to load things in the background too. Is there a way to instruct or change the way the incremental file loads? As you can imagine with that file size, I’m still only getting a 2-4 fps experience and I’ve pretty much exhausted all optimization methods via blender to as low quality as I can afford. I’ve got an arc rotate camera. Is that right? Is there a certain way to point the camera or reduce the movement speed etc.

Maybe using occlusion requests would improve things too. This allows you not to render objects that you can’t see and to display them when you see them.
Incremental loading only allows the scene to load faster (what the camera sees first, but the rest continues to load)

1 Like

Hey there! I’m all right, hope you’re well too :smiley:

I took a look at how the incremental loading works under the hood, and what I found is this: if a mesh is detected to be in the viewing frustum (which is basically the entire area “seen” by the camera:

then this mesh will be added to the “list of things to be loaded”: Babylon.js/mesh.ts at master · BabylonJS/Babylon.js (github.com) (that’s what this delayCheckState function does here). It doesn’t matter if there are any other objects in front or anything else, if it is inside the frustum then it passes the condition to be loaded. So one option would be to make this frustum as small as it can get without affecting the functionality of your application. One way you can control this in all cameras would be tweaking your minZ and maxZ values ( Camera | Babylon.js Documentation (babylonjs.com)) which are the same as the zNear and zFar on the example image. Another way in the arcRotateCamera would be by reducing the radius, the smaller it is, the smaller the frustum will be.

Do you have some idea of what’s the main cause of your performance issues? I would recommend using your browser’s Performance tab to capture a view of the performance so you have more information on what are the more important bits to optimize. This Optimizing Your Scene | Babylon.js Documentation (babylonjs.com) has a lot of good tips for optimization, but it’s important to know first what are the causes of low FPS in your specific scene, if it’s CPU or GPU bound, etc…

1 Like

I’m good thank you.

That’s good to know, thanks for sharing that. It seems to load more consistently when the camera starts closer in. I haven’t got the fastest of computers in all fairness but if I make it work for mine, I should be able to get it working fine elsewhere. I’m not sure re CPU or GPU but it’s a high spec model I would assume in the grand scheme of models.

I did look into this after you suggested it. I have an arc rotate camera where I can see the entire model but maybe if I restrict views, I can pan across the city like a google map view (on a tilt) rather than give the option to view the whole model at one. This is a model with 10 or so of the 600 buildings on https://playground.babylonjs.com/#9Z476P#69 (this one isn’t incremental)

I think this could be a good idea and would reduce the number of meshes to display at one time. Adding occlusion queries to each mesh could increase performance.

But there are surely other possible optimizations to explore with your scene.

3 Likes

This is most welcomed. Thanks @carolhmj!

1 Like