* 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)
| 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. |
nothing calls this directly
no test coverage detected