ua4192 Posted May 17, 2017 Share Posted May 17, 2017 Hi all. I am trying to apply different optimizations on my big complex scene with 4000 meshes and 40000 instances. The scene is very complex (12.5M vertices ) My idea is to combine diferent optimization methods probided by babylon. AUTOLOD+MESHSUBDIVIDE+OCTREES+SCENEOPTIMIZATION. My main problem is that when I try to apply the scene optimization method SceneOptimizerOptions.HighDegradationAllowed I always get the message that the optimization has been successfully but many times the scene is cleaned and the number of scene total vertices decrease until 0. I think there is something wrong. Here the code: BABYLON.SceneOptimizer.OptimizeAsync(scene, BABYLON.SceneOptimizerOptions.HighDegradationAllowed(15, 5000), function(){ if ( mydebug ) { console.log("Optimization successful"); } }, function(){ console.log("Optimization failed"); }); I have also realize that the function provides the mesage only one time. I thought that the function was executed each 5 seconds (5000ms) if the target of FPS of 15 was not possible. I am thing in serializing big scenes, but I have never tried and don't know if this will help. Many many thanks in advanced. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted May 17, 2017 Share Posted May 17, 2017 I think it is because you use a strong optimization by default: SceneOptimizerOptions.HighDegradationAllowed Try custom optimization : var EngineOptimizer = function() { let result = new BABYLON.SceneOptimizerOptions(60, 5000); result.optimizations.push(new BABYLON.ShadowsOptimization(0)); // Priority 0 result.optimizations.push(new BABYLON.LensFlaresOptimization(1)); // Priority 1 result.optimizations.push(new BABYLON.PostProcessesOptimization(2)); // Priority 2 result.optimizations.push(new BABYLON.TextureOptimization(3, 512)); // Priority 3, texture size 512 sur les textures superieur à 512, 1024 ... result.optimizations.push(new BABYLON.TextureOptimization(4, 256)); // Priority 4, texture size 256 sur les textures superieur 256 ... result.optimizations.push(new BABYLON.ParticlesOptimization(5)); // Priority 5 result.optimizations.push(new BABYLON.RenderTargetsOptimization(6)); // Priority 6 result.optimizations.push(new BABYLON.HardwareScalingOptimization(7, 2)); // Priority 7, HardwareScaling 2 result.optimizations.push(new BABYLON.HardwareScalingOptimization(8, 4)); // Priority 8, HardwareScaling 4 return result; } And BABYLON.SceneOptimizer.OptimizeAsync(scene, EngineOptimizer(), function(){ if ( mydebug ) { console.log("Optimization successful"); } }, function(){ console.log("Optimization failed"); }); Quote Link to comment Share on other sites More sharing options...
ua4192 Posted May 17, 2017 Author Share Posted May 17, 2017 Many thanks. : ) I will try and give you feedback Quote Link to comment Share on other sites More sharing options...
ua4192 Posted May 17, 2017 Author Share Posted May 17, 2017 Afrter many tries The scene is still too big to be managed. Could I do anything else? Best regards Quote Link to comment Share on other sites More sharing options...
Dad72 Posted May 17, 2017 Share Posted May 17, 2017 You will have in this case to create objects lowpoly to your scene. Maybe try adding SIMD too. Quote Link to comment Share on other sites More sharing options...
ua4192 Posted May 18, 2017 Author Share Posted May 18, 2017 It seems very interesting, despites it seems not to be compatible with all browsers. I have tried to load an example: https://www.babylonjs.com/demos/simd/ But it doesn't work. It gets hang while loading, no progress. Do you have any other example? I have not found too much documentation. Many thanks in advanced. You are the master Quote Link to comment Share on other sites More sharing options...
Dad72 Posted May 18, 2017 Share Posted May 18, 2017 You'll have to create lowpoly objects. I do not see any other solution. Quote Link to comment Share on other sites More sharing options...
ua4192 Posted May 18, 2017 Author Share Posted May 18, 2017 Do you mean to use LOD? I am already using 4 levels of detail. My problem with this approach is that LOD cannot be used with closes and with instances now I have the same problem than before about inherited transformations. Anothe problem is that I am using an arcrotatecamera and the LOD distance seems not to be working properly. Sometimes I have to be very near from the object to make it visible. Best regards Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted May 18, 2017 Share Posted May 18, 2017 I cannot comment on the screen optimizer per say, but having 8000 meshes is a LOT of render loop CPU overhead. This CPU takes away time that could be spent at the GPU. Even though instances only have the single draw call of the regular mesh, they each must be accounted for in Javascript. If an mesh / instance never moves, then you could: mesh.freezeWorldMatrix(); If multiple instances, or meshes sharing the same material, do not move independently, you could merge them into one mesh. This reduces the Javascript overhead and draw calls. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.