Jump to content

sound and Artefact shadow because of SceneOptimizer


Recommended Posts


When I activate the music on my scene (with a lot of object)  and if use SceneOptimizer, I get the ripples of the music on the ground in the form of a shadow.

It happens when I use:  mesh.material.freeze();  or the subdivision of the land ...

See screenshot.


The code is :

this.music = new BABYLON.Sound("musicZone", "myMP3.mp3", this.scene, null, { volume: 1.0, loop: true, autoplay: true, streaming: true, spatialSound: false }); 


BABYLON.SceneOptimizer.OptimizeAsync(scene, optionOptimizer());	

    function optionOptimizer()
		var result = new BABYLON.SceneOptimizerOptions(60, 1000);
		result.optimizations.push(new BABYLON.ShadowsOptimization(0));
		result.optimizations.push(new BABYLON.LensFlaresOptimization(1));
		result.optimizations.push(new BABYLON.TextureOptimization(2, 256));
		result.optimizations.push(new BABYLON.PostProcessesOptimization(3));
		result.optimizations.push(new BABYLON.ParticlesOptimization(4));
		result.optimizations.push(new BABYLON.RenderTargetsOptimization(5));
		result.optimizations.push(new BABYLON.HardwareScalingOptimization(6, 4));
		return result;

I can not reproduce it on the PG, I do not know what is causing the problem and I use a lot of things on my project.

I know that if I disable freeze on the material, it does not make this problem any more.


Link to comment
Share on other sites

I don't see the direct relationship between music and sceneoptimizer :D This is freaking weird.


But here is one explanation: The music consumes a bit of CPU and enough to trigger an optimization. So when there is no music the optimizer does not activate the same options

Then freezing materials is no more a big deal with latest optimization from 3.2 so you should try without it

Link to comment
Share on other sites

Yes it's strange. I had a hard time finding the relationship too, but the shadow is moving in relation to the music.

I will try the last of the optimizer and would keep informing if it works better.

Link to comment
Share on other sites

It's perfect with the new sceneOptimizer, it works much better, more artifact. I can even increase parameters for the optimization of the terrain without the problems that I had.

I even feel that my scene is more fluid with the new optimizer.  and yet the scene a lot of unique mesh (low poly) 

I'm at 60 fps with this scene: (Pictures in preview of my next project)



Thanks DK for the new optimizer.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...