Jump to content

SceneOptimizer instance has empty


klaude
 Share

Recommended Posts

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?

 

Link to comment
Share on other sites

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());
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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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