CubeCamera Class

Extends Object3D
Module: Misc

Reflection probes are used to create CubeTextures dinamically.

These CubeTextures can be attributed to materials programatically.

Methods

clear

()

Clear cube camera render target.

initialize

()

Initialize CubeCamera object.

Gets the attached scene and the renderer in use.

setResolution

(
  • resolution
)

Set the CubeCamera resolution.

Parameters:

  • resolution Number

    CubeCamera resolution (per face). Should be a 2 pot.

update

()

Update CubeCamera object.

If autoUpdate is set to true the CubeCamera updates the CubeTexture automatically.

updateCubeMap

(
  • renderer
  • scene
)

Render new cube faces.

Should be called every time a change in the scene is made.

Parameters:

  • renderer WebGLRenderer

    Renderer to be used.

  • scene Scene

    Scene to be renderer.

Properties

autoUpdate

Boolean

Auto update indicates if the cube camera is updated automatically each frame.

cameras

Array

Array of 6 cameras used to render each face of the cube.

cube

CubeTexture

CubeTexture generated by this CubeCamera.

Can be attached to materials as envMap.

far

Number

CubeCamera far plane.

near

Number

CubeCamera near plane.

resolution

Number

Resolution of each face. Should be a power of 2 (32, 64, 128, ...).

target

WebGLCubeRenderTarget

WebGL cube render target to where the scene is rendered.