Render large Babylon files

Hi guys,
I have a project to render large sized Babylon files Max 5gb ,so which technologies can I use to render the files without lagging the system
Max 30fs needed

here are some leads you can follow to boost your performance: Babylon.js docs

It really depends on the models you want to render, maybe you can share them with us to take a look?

Hello @Rohith_K , like @CrashMaster said, maybe sharing more details about your file will help

  • Multiple identical meshes → Could be instanced
  • Heavy textures (.EXR, etc…) → Could be converted + resized
  • Very dense polygon (Scan, etc…) → Could be remeshed
  • Far meshes → LOD
  • Etc, etc…

There are few chances that the whole 5GB are actually necessary, there is always room for optimisation :slight_smile:

++
Tricotou

1 Like

I’ll share it when I reached home
Somebody said to me like use octree da, occlusion culling,ray tracing etc,but I don’t know about that,
Is it really works

1 Like

We have some doc on octrees: Babylon.js docs. I would say it works better when you can split your scene into chunks. One large mesh will not be optimized with octrees.

@Tricotou @CrashMaster sorry i forgot to send it yesterday,i cant send the file,it says it is not authorized,it is a .babylon file
here is the screenshot


i want to load this pipe files upto 5gb without lagging

If it’s just pipes, then chances are you don’t need anywhere near the amount of detail in a typical CAD export that would result in a 5Gb file. For instance, if each pipe section is a cylinder you can easily get away with 12 or 8 sided cylinders. If you can re-export the CAD with less detail or run the exported CAD through a mesh optimization step, it should be much smaller and run faster.

The best option, provided you have the time and skills, would be to export the optimised/simplified pipe paths only then generate (in code) the pipe extrusions with 8-12 sides.

Here’s a path simplification algorithm which works really well
https://mourner.github.io/simplify-js/

If you don’t need to get close to the pipes and light and shadows aren’t that important, you could also consider greased lines.
https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param/greased_line

But my aim(task) is to build a app/web to render large files (5gb) without lagging ,so i have so many large pipe files to test the code ,i addded 1gb files yesterday and it lag like hell
you know iam just a begginer in babylonjs.my project just started monday ,and i have written.
1)code for adding (.babylon) files from my computer using input tag and loaded in to the web
2)Added indexed db in the code
to-do(methods to optimise the rendering,min 30fps)
1)implement octree
2implement oclussion culling ,ray castin/tracing
3)BVH etc…
if anyone can help pls do it

In my personal opinion, you’re going to struggle loading and displaying such a large file. It’s not just a Babylon.js or WebGL issue - there are limits to what web browsers (and the various devices they run on) can handle, not to mention the bandwidth required to download such files. I would expect many devices or web browsers would crash or be crippled by such a file …

At the very least you should be doing some pre-processing of files, say on a fast server, before the optimised versions are sent or streamed to the client’s browser for display.

Trying to download, optimise and display a 5gb file on a variety of unknown clients is simply not feasible. Do the optimisation BEFORE it gets to the client.

1 Like

Also, if you use .glb draco compressed files rather than .babylon format, the file size will be a lot smaller, but that doesn’t solve the performance issue.

so do you have any optimisation idea

@inteja @Tricotou @CrashMaster
Guys,Can anyone help me to write your on mesh optimization code in my project,ill attach the git link code of mine here and send back to me

Hello,

I think we are all ready to help, but as suggested previously, the optimisation process is deeply linked to the scene, and the use case (otherwise it would be implemented by default in Babylon :wink: )

That’s why we where advising to share the file (Google Drive, WeTransfer, SwissTranfer, etc…) so that we can have a look. Also I guess if you have babylon file it’s because you exported it, so it would be interesting to know more about how you generate it, some optimisations can be done before export of course.

  • Among the 5 GB how much is from textures and how much is from geometry
  • For textures does it come from size in pixels, or format (EXR … etc)
  • Is it modelled by hand or is it a scan
  • How many meshes are same topology and could be instanced
  • Etc, etc

These questions are to be answered to help, but sharing the file will be the simplest :slight_smile:

++
Tricotou

@Tricotou so you want the babylon files right?..I will share wait

Or .glb, to be able to easily open in Blender and have a look :slight_smile:

1 Like

here it is https://drive.google.com/file/d/1rNFq0F7YoornaG549UAw3dCb4R-t8vF4/view?usp=drive_link

i hope you will help, you are the last option for me

I’ve asked access but it would be better if you set the file share in “any one with the link” mode

ok now check PIPES-Babylon.zip - Google Drive

Access if forbidden with your link, after clicking share, there is a dropdown menu where you need to select “anyone with the link can access”