CubeCamera Class

Extends Object3D
Module: Misc

Reflection probes are used to create CubeTextures dinamically.

These CubeTextures can be attributed to materials programatically.

Constructor

CubeCamera

()

Methods

dispose

()

Disposes the CubeCamera.

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.

toJSON

(
  • meta
)
Object

Serialize object to JSON.

Parameters:

  • meta Object

    Meta data.

Returns:

Object:

JSON description.

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

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

WebGLRenderTargetCube

WebGL cube render target to where the scene is rendered.