update method

void update(
  1. WebGLRenderer renderer,
  2. Object3D scene
)

renderer: The current WebGL renderer

scene: The current scene

Call this to update the renderTarget.

Implementation

/// [scene]: The current scene
///
/// Call this to update the [renderTarget].
void update(WebGLRenderer renderer, Object3D scene) {
  if (parent == null) updateMatrixWorld(false);

  final currentRenderTarget = renderer.getRenderTarget();
		final currentToneMapping = renderer.toneMapping;
		final currentXrEnabled = renderer.xr.enabled;

		renderer.toneMapping = NoToneMapping;
  renderer.xr.enabled = false;

  final generateMipmaps = renderTarget.texture.generateMipmaps;

  renderTarget.texture.generateMipmaps = false;

  renderer.setRenderTarget(renderTarget, 0);
  renderer.render(scene, cameraPX);

  renderer.setRenderTarget(renderTarget, 1);
  renderer.render(scene, cameraNX);

  renderer.setRenderTarget(renderTarget, 2);
  renderer.render(scene, cameraPY);

  renderer.setRenderTarget(renderTarget, 3);
  renderer.render(scene, cameraNY);

  renderer.setRenderTarget(renderTarget, 4);
  renderer.render(scene, cameraPZ);

  renderTarget.texture.generateMipmaps = generateMipmaps;

  renderer.setRenderTarget(renderTarget, 5);
  renderer.render(scene, cameraNZ);

  renderer.setRenderTarget(currentRenderTarget);

		renderer.toneMapping = currentToneMapping;
  renderer.xr.enabled = currentXrEnabled;

  renderTarget.texture.needsPMREMUpdate = true;
}