# Render large Babylon files

**URL:** <https://forum.babylonjs.com/t/render-large-babylon-files/51225>\
**Category:** Questions\
**Created:** [June 11, 2024, 9:37am UTC](https://forum.babylonjs.com/t/render-large-babylon-files/51225 "2024-06-11T09:37:08Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rohith\_K](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/rohith_k/32/40623_2.png) [@Rohith\_K](https://forum.babylonjs.com/u/Rohith_K)\
**Post date:** [June 11, 2024, 9:37am UTC](https://forum.babylonjs.com/t/render-large-babylon-files/51225/1 "2024-06-11T09:37:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![CrashMaster](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/crashmaster/32/23662_2.png) [@CrashMaster](https://forum.babylonjs.com/u/CrashMaster)\
**Post date:** [June 11, 2024, 9:56am UTC](https://forum.babylonjs.com/t/render-large-babylon-files/51225/2 "2024-06-11T09:56:59Z")

</div>

here are some leads you can follow to boost your performance: [Babylon.js docs](https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene)

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

---

<div class="post-metadata">

**Author:** ![Tricotou](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/tricotou/32/5844_2.png) [@Tricotou](https://forum.babylonjs.com/u/Tricotou)\
**Post date:** [June 11, 2024, 10:15am UTC](https://forum.babylonjs.com/t/render-large-babylon-files/51225/3 "2024-06-11T10:15:02Z")

</div>

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 🙂

++  
Tricotou

---

<div class="post-metadata">

**Author:** ![Rohith\_K](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/rohith_k/32/40623_2.png) [@Rohith\_K](https://forum.babylonjs.com/u/Rohith_K)\
**Post date:** [June 11, 2024, 10:24am UTC](https://forum.babylonjs.com/t/render-large-babylon-files/51225/4 "2024-06-11T10:24:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![CrashMaster](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/crashmaster/32/23662_2.png) [@CrashMaster](https://forum.babylonjs.com/u/CrashMaster)\
**Post date:** [June 11, 2024, 11:00am UTC](https://forum.babylonjs.com/t/render-large-babylon-files/51225/5 "2024-06-11T11:00:11Z")

</div>

We have some doc on octrees: [Babylon.js docs](https://doc.babylonjs.com/features/featuresDeepDive/scene/optimizeOctrees). I would say it works better when you can split your scene into chunks. One large mesh will not be optimized with octrees.

---

<div class="post-metadata">

**Author:** ![Rohith\_K](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/rohith_k/32/40623_2.png) [@Rohith\_K](https://forum.babylonjs.com/u/Rohith_K)\
**Post date:** [June 12, 2024, 3:58am UTC](https://forum.babylonjs.com/t/render-large-babylon-files/51225/6 "2024-06-12T03:58:42Z")

</div>

@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

 ![Screenshot 2024-06-12 092714](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/3/a/3a90b77679c5e6ae68b44af00f80a82dc9dd6a80.png)  
i want to load this pipe files upto 5gb without lagging

---

<div class="post-metadata">

**Author:** ![inteja](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/inteja/32/22553_2.png) [@inteja](https://forum.babylonjs.com/u/inteja)\
**Post date:** [June 12, 2024, 4:52am UTC](https://forum.babylonjs.com/t/render-large-babylon-files/51225/7 "2024-06-12T04:52:55Z")

</div>

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/](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](https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param/greased_line)

---

<div class="post-metadata">

**Author:** ![Rohith\_K](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/rohith_k/32/40623_2.png) [@Rohith\_K](https://forum.babylonjs.com/u/Rohith_K)\
**Post date:** [June 12, 2024, 5:18am UTC](https://forum.babylonjs.com/t/render-large-babylon-files/51225/8 "2024-06-12T05:18:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![inteja](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/inteja/32/22553_2.png) [@inteja](https://forum.babylonjs.com/u/inteja)\
**Post date:** [June 12, 2024, 5:30am UTC](https://forum.babylonjs.com/t/render-large-babylon-files/51225/9 "2024-06-12T05:30:37Z")

</div>

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 …

---

<div class="post-metadata">

**Author:** ![inteja](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/inteja/32/22553_2.png) [@inteja](https://forum.babylonjs.com/u/inteja)\
**Post date:** [June 12, 2024, 5:34am UTC](https://forum.babylonjs.com/t/render-large-babylon-files/51225/10 "2024-06-12T05:34:24Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![inteja](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/inteja/32/22553_2.png) [@inteja](https://forum.babylonjs.com/u/inteja)\
**Post date:** [June 12, 2024, 5:39am UTC](https://forum.babylonjs.com/t/render-large-babylon-files/51225/11 "2024-06-12T05:39:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Rohith\_K](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/rohith_k/32/40623_2.png) [@Rohith\_K](https://forum.babylonjs.com/u/Rohith_K)\
**Post date:** [June 13, 2024, 3:42am UTC](https://forum.babylonjs.com/t/render-large-babylon-files/51225/12 "2024-06-13T03:42:01Z")

</div>

so do you have any optimisation idea

---

<div class="post-metadata">

**Author:** ![Rohith\_K](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/rohith_k/32/40623_2.png) [@Rohith\_K](https://forum.babylonjs.com/u/Rohith_K)\
**Post date:** [June 13, 2024, 4:25am UTC](https://forum.babylonjs.com/t/render-large-babylon-files/51225/13 "2024-06-13T04:25:20Z")

</div>

@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

> **[GitHub - ROH-745/PROJECT-1: LOADING LARGE BABYLON FILES](https://github.com/ROH-745/PROJECT-1)**
>
> LOADING LARGE BABYLON FILES. Contribute to ROH-745/PROJECT-1 development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![Tricotou](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/tricotou/32/5844_2.png) [@Tricotou](https://forum.babylonjs.com/u/Tricotou)\
**Post date:** [June 13, 2024, 5:51am UTC](https://forum.babylonjs.com/t/render-large-babylon-files/51225/14 "2024-06-13T05:51:37Z")

</div>

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 😉 )

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 🙂

++  
Tricotou

---

<div class="post-metadata">

**Author:** ![Rohith\_K](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/rohith_k/32/40623_2.png) [@Rohith\_K](https://forum.babylonjs.com/u/Rohith_K)\
**Post date:** [June 13, 2024, 6:08am UTC](https://forum.babylonjs.com/t/render-large-babylon-files/51225/15 "2024-06-13T06:08:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Tricotou](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/tricotou/32/5844_2.png) [@Tricotou](https://forum.babylonjs.com/u/Tricotou)\
**Post date:** [June 13, 2024, 6:15am UTC](https://forum.babylonjs.com/t/render-large-babylon-files/51225/16 "2024-06-13T06:15:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Rohith\_K](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/rohith_k/32/40623_2.png) [@Rohith\_K](https://forum.babylonjs.com/u/Rohith_K)\
**Post date:** [June 13, 2024, 6:29am UTC](https://forum.babylonjs.com/t/render-large-babylon-files/51225/17 "2024-06-13T06:29:46Z")

</div>

here it is [https://drive.google.com/file/d/1rNFq0F7YoornaG549UAw3dCb4R-t8vF4/view?usp=drive\_link](https://drive.google.com/file/d/1rNFq0F7YoornaG549UAw3dCb4R-t8vF4/view?usp=drive_link)

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

---

<div class="post-metadata">

**Author:** ![Tricotou](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/tricotou/32/5844_2.png) [@Tricotou](https://forum.babylonjs.com/u/Tricotou)\
**Post date:** [June 13, 2024, 6:35am UTC](https://forum.babylonjs.com/t/render-large-babylon-files/51225/18 "2024-06-13T06:35:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Rohith\_K](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/rohith_k/32/40623_2.png) [@Rohith\_K](https://forum.babylonjs.com/u/Rohith_K)\
**Post date:** [June 13, 2024, 6:51am UTC](https://forum.babylonjs.com/t/render-large-babylon-files/51225/19 "2024-06-13T06:51:41Z")

</div>

ok now check [PIPES-Babylon.zip - Google Drive](https://drive.google.com/file/d/1rNFq0F7YoornaG549UAw3dCb4R-t8vF4/view?usp=sharing)

---

<div class="post-metadata">

**Author:** ![Tricotou](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/tricotou/32/5844_2.png) [@Tricotou](https://forum.babylonjs.com/u/Tricotou)\
**Post date:** [June 13, 2024, 6:54am UTC](https://forum.babylonjs.com/t/render-large-babylon-files/51225/20 "2024-06-13T06:54:31Z")

</div>

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”

[Next page](https://forum.babylonjs.com/t/render-large-babylon-files/51225.md?page=2)
