* Creates new textures and renderbuffers given the current size of the * framebuffer. * * @private
()
| 450 | * @private |
| 451 | */ |
| 452 | _recreateTextures() { |
| 453 | this._updateSize(); |
| 454 | |
| 455 | // Let renderer handle texture creation and framebuffer setup |
| 456 | this.renderer.recreateFramebufferTextures(this); |
| 457 | |
| 458 | if (this.useDepth) { |
| 459 | this.depth = new FramebufferTexture(this, 'depthTexture'); |
| 460 | const depthFilter = constants.NEAREST; |
| 461 | this.depthP5Texture = new Texture( |
| 462 | this.renderer, |
| 463 | this.depth, |
| 464 | { |
| 465 | minFilter: depthFilter, |
| 466 | magFilter: depthFilter |
| 467 | } |
| 468 | ); |
| 469 | this.renderer.textures.set(this.depth, this.depthP5Texture); |
| 470 | } |
| 471 | |
| 472 | this.color = new FramebufferTexture(this, 'colorTexture'); |
| 473 | const filter = this.textureFiltering === constants.LINEAR |
| 474 | ? constants.LINEAR |
| 475 | : constants.NEAREST; |
| 476 | this.colorP5Texture = new Texture( |
| 477 | this.renderer, |
| 478 | this.color, |
| 479 | { |
| 480 | minFilter: filter, |
| 481 | magFilter: filter |
| 482 | } |
| 483 | ); |
| 484 | this.renderer.textures.set(this.color, this.colorP5Texture); |
| 485 | } |
| 486 | |
| 487 | /** |
| 488 | * A method that will be called when recreating textures. If the framebuffer |
no test coverage detected