Jump to content

Scene optm


hunts
 Share

Recommended Posts

Hello :), pls I need help on how to use this optimising code from BJS doc..something like a playground. Thanks:):)

var result = new BABYLON.SceneOptimizerOptions(60, 2000); var priority = 0; result.optimizations.push(new BABYLON.ShadowsOptimization(priority)); result.optimizations.push(new BABYLON.LensFlaresOptimization(priority)); // Next priority priority++; result.optimizations.push(new BABYLON.PostProcessesOptimization(priority)); result.optimizations.push(new BABYLON.ParticlesOptimization(priority)); // Next priority priority++; result.optimizations.push(new BABYLON.TextureOptimization(priority, 256)); // Next priority priority++; result.optimizations.push(new BABYLON.RenderTargetsOptimization(priority)); // Next priority priority++; result.optimizations.push(new BABYLON.HardwareScalingOptimization(priority, 4)); return result;

Link to comment
Share on other sites

This :

var EngineOptimizer = function() {
    var result = new BABYLON.SceneOptimizerOptions(60, 2000);
    var priority = 0; 
    result.optimizations.push(new BABYLON.ShadowsOptimization(priority));
    result.optimizations.push(new BABYLON.LensFlaresOptimization(priority)); // Next priority 
    priority++;
    result.optimizations.push(new BABYLON.PostProcessesOptimization(priority));
    result.optimizations.push(new BABYLON.ParticlesOptimization(priority)); // Next priority
    priority++;
    result.optimizations.push(new BABYLON.TextureOptimization(priority, 256));// Next priority
    priority++;
    result.optimizations.push(new BABYLON.RenderTargetsOptimization(priority)); // Next priority
    priority++;
    result.optimizations.push(new BABYLON.HardwareScalingOptimization(priority, 4));
    return result;
};

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

 

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