Skip to content

Commit

Permalink
Renderer: Add initTexture(). (#29947)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mugen87 authored Nov 23, 2024
1 parent fab2d40 commit 1e01d5f
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/renderers/common/Renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1315,6 +1315,28 @@ class Renderer {

}

async initTextureAsync( texture ) {

if ( this._initialized === false ) await this.init();

this._textures.updateTexture( texture );

}

initTexture( texture ) {

if ( this._initialized === false ) {

console.warn( 'THREE.Renderer: .initTexture() called before the backend is initialized. Try using .initTextureAsync() instead.' );

return false;

}

this._textures.updateTexture( texture );

}

copyFramebufferToTexture( framebufferTexture, rectangle = null ) {

if ( rectangle !== null ) {
Expand Down

0 comments on commit 1e01d5f

Please sign in to comment.