klaude Posted June 14, 2018 Share Posted June 14, 2018 Hello, I'm trying to use SceneOptimizer wity babylonjs v3.1.1. var options = new BABYLON.SceneOptimizerOptions(30, 1000); options.optimizations.push(new BABYLON.RenderTargetsOptimization(0)); options.optimizations.push(new BABYLON.ParticlesOptimization(1)); options.optimizations.push(new BABYLON.TextureOptimization(1, 1024)); // options.optimizations.push(new BABYLON.HardwareScalingOptimization(2, 4)); // Optimizer var optimizer = new BABYLON.SceneOptimizer(scene, options); optimizer.start(); but optimizer object has nothing. this is console log. e {} __proto__: Object what am i missing? Quote Link to comment Share on other sites More sharing options...
Arte Posted June 14, 2018 Share Posted June 14, 2018 Hi @klaude Try: function optimizerOptions() { let options = new BABYLON.SceneOptimizerOptions(30, 1000); options.optimizations.push(new BABYLON.RenderTargetsOptimization(0)); options.optimizations.push(new BABYLON.ParticlesOptimization(1)); options.optimizations.push(new BABYLON.TextureOptimization(1, 1024)); return options; } BABYLON.SceneOptimizer.OptimizeAsync(scene, optimizerOptions()); klaude 1 Quote Link to comment Share on other sites More sharing options...
klaude Posted June 14, 2018 Author Share Posted June 14, 2018 It has no error. Maybe it works for now. It shows 'success'. BABYLON.SceneOptimizer.OptimizeAsync(scene, optimizerOptions(), function() { console.log('success'); }, function() { console.log('failed'); }); Thanks! @Arte Arte 1 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.