Capítulo 249 de 859

Chapter 249: CubeTexturePass

Core Idea

This pass can be used to render a cube texture over the entire screen.

Key Concepts

  • camera : PerspectiveCamera: The camera.
  • needsSwap : boolean: Overwritten to disable the swap.
  • opacity : number: The opacity.
  • tCube : CubeTexture: The cube texture to render.

Code Examples

const cubeMap = new THREE.CubeTextureLoader().load( urls );
const cubeTexturePass = new CubeTexturePass( camera, cubemap );
composer.addPass( cubeTexturePass );
  • What it demonstrates: Typical usage of CubeTexturePass.

Reference Tables

Constructor

Signature
new CubeTexturePass( camera : PerspectiveCamera, tCube : CubeTexture, opacity : number )

Properties

PropertyDescription
.camera : PerspectiveCameraThe camera.
.needsSwap : booleanOverwritten to disable the swap.
.opacity : numberThe opacity.
.tCube : CubeTextureThe cube texture to render.

Methods

MethodDescription
.dispose()Frees the GPU-related resources allocated by this instance. Call this method whenever the pass is no longer used in your app.
.render( renderer : WebGLRenderer, writeBuffer : WebGLRenderTarget, readBuffer : WebGLRenderTarget, deltaTime : number, maskActive : boolean )Performs the cube texture pass.

Key Takeaways

  1. CubeTexturePass extends: Pass
  2. Most relevant properties: camera, needsSwap, opacity, tCube.
  3. Key methods: dispose, render.

Connects To