MCPcopy Create free account
hub / github.com/pmndrs/postprocessing / replaceRenderer

Method replaceRenderer

src/core/EffectComposer.js:269–285  ·  view source on GitHub ↗

* Replaces the current renderer with the given one. * * The auto clear mechanism of the provided renderer will be disabled. If the new render size differs from the * previous one, all passes will be updated. * * By default, the DOM element of the current renderer will automatically be remo

(renderer, updateDOM = true)

Source from the content-addressed store, hash-verified

267 */
268
269 replaceRenderer(renderer, updateDOM = true) {
270
271 const oldRenderer = this.renderer;
272 const parent = oldRenderer.domElement.parentNode;
273
274 this.setRenderer(renderer);
275
276 if(updateDOM && parent !== null) {
277
278 parent.removeChild(oldRenderer.domElement);
279 parent.appendChild(renderer.domElement);
280
281 }
282
283 return oldRenderer;
284
285 }
286
287 /**
288 * Creates a depth texture attachment that will be provided to all passes.

Callers

nothing calls this directly

Calls 1

setRendererMethod · 0.95

Tested by

no test coverage detected