Hi everyone,
I am using createDefaultEnvironment method and AssetManager in my scene.
I start with scene creation like this:
scene.createDefaultLight()
scene.lights[0].intensity = 1
const helper = scene.createDefaultEnvironment({
skyboxSize: 1500,
groundShadowLevel: 0.5,
enableGroundMirror: true,
});
helper.setMainColor(new Color3(2.8, 2.8, 2.8));
engine.runRenderLoop(() => {
scene.render();
});
Only after this i create AssetManager, add some tasks and load them:
const assetsManager = new AssetsManager(scene);
assetsManager.useDefaultLoadingScreen = false;
this.meshesConfig.forEach(config => assetsManager.addMeshTask( ... )
assetsManager.onProgress = (remainingCount, totalCount) => this.props.onProgress(remainingCount, totalCount)
assetsManager.onFinish = () => this.props.onLoaded()
assetsManager.load()
This is on purpose and I also use assetsManager.useDefaultLoadingScreen = false; because I want scene to start rendering and meshes to show up incrementally as they load.
The problem is, it seems that enviroment helper is loaded only after all meshes are loaded. Rendering starts because I can see the default bluish/purple color of babylon scene, but ground, skybox and mainColor that I set before are shown only after all meshes are in the scene.
Does anybody know why is that and how to fix it? I’ve been trying for some time…