Capítulo 536 de 859

Chapter 536: DebugEnvironment

Core Idea

This class represents a scene with a very basic room setup that can be used as input for PMREMGenerator#fromScene. The resulting PMREM represents the room's lighting and can be used for Image Based Lighting by assigning it to Scene#environment or directly as an environment map to PBR materials.

This class uses a simple room setup and should only be used for development purposes. A more appropriate setup for production is RoomEnvironment.

Code Examples

const environment = new DebugEnvironment();
const pmremGenerator = new THREE.PMREMGenerator( renderer );
const envMap = pmremGenerator.fromScene( environment ).texture;
scene.environment = envMap;
  • What it demonstrates: Typical usage of DebugEnvironment.

Reference Tables

Constructor

Signature
new DebugEnvironment()

Methods

MethodDescription
.dispose()Frees internal resources. This method should be called when the environment is no longer required.

Key Takeaways

  1. DebugEnvironment extends: EventDispatcher → Object3D → Scene
  2. Key methods: dispose.

Connects To