Capítulo 592 de 859

Chapter 592: SceneOptimizer

Core Idea

This class can be used to optimized scenes by converting individual meshes into BatchedMesh. This component is an experimental attempt to implement auto-batching in three.js.

Code Examples

import { SceneOptimizer } from 'three/addons/utils/SceneOptimizer.js';
  • What it demonstrates: Typical usage of SceneOptimizer.

Reference Tables

Constructor

Signature
new SceneOptimizer( scene : Scene, options : SceneOptimizer~Options )

Methods

MethodDescription
.disposeMeshes( meshesToRemove : Set.<Mesh> )Removes the given array of meshes from the scene.
.removeEmptyNodes( object : Object3D )Removes empty nodes from all descendants of the given 3D object.
.toBatchedMesh() : ScenePerforms the auto-baching by identifying groups of meshes in the scene that can be represented as a single BatchedMesh. The method modifies the scene by adding instances of `Batch…
.toInstancingMesh() : Scene (abstract)Performs the auto-instancing by identifying groups of meshes in the scene that can be represented as a single InstancedMesh. The method modifies the scene by adding instances of…

Key Takeaways

  1. Key methods: disposeMeshes, removeEmptyNodes, toBatchedMesh, toInstancingMesh.

Connects To