Babylon.js loading bunch of weird and unused pngs

Hello,

I am using babylonjs with a gatsbyjs framework on my personal website project. Now I am doing a little bit of optimisation and the problem I found is that babylonjs initiates a looot of small .png file downloads and i dont know how to stop it or even where it came from because i dont use any .png assets in babylonjs.

Whats more, on further inspection, these images are small and really weird, like photos of some building entrances or whatsoever.

My dev console with bunch of png downloads:

You can find post about my project in demos and projects category if need be: https://forum.babylonjs.com/t/personal-website-with-3d-environment/6753

Please help :slight_smile:

Those are textures created internally by the engine: as you can see, there is a “blob:” in front of the url, meaning those are created by code and not downloaded.

They are most probably the textures created when loading the environment texture: try to comment the creation of the environment texture, they should disappear.

1 Like

For anyone else having this problem, following @Evgeni_Popov advice, I resolved the problem like this:

 const helper = scene.createDefaultEnvironment({
    skyboxSize: 1500,
    groundShadowLevel: 0.5,
    enableGroundMirror: true,
    environmentTexture: undefined,
  });

The environmentTexture option set to undefined removed unecessary creation of textures. Cheers!

A few things -

  1. environment texture is needed when you use different types of materials (like PBR). If you remove it, it will not load, but will also not work when needed :slight_smile:
  2. those files are not downloaded. they are created and used internally as textures to create the different aspects of the environment. So, in general, no harm is done when keeping them (apart from a bit of RAM used)

Having said that - if you dont rely on the environment texture at all, it really does make sense to remove it.