Parcourir la source

WebGLRenderer: Add initRenderTarget function (#28285)

* align WebGLRenderer.copyTextureToTexture with copyTextureToTexture3D

* Make the function backwards compatible

* Add import statement

* Fix example

* Update init texture to support render target, support copy to render target

* Add initRenderTarget
Garrett Johnson il y a 1 an
Parent
commit
c3741d2f5d
1 fichiers modifiés avec 10 ajouts et 0 suppressions
  1. 10 0
      src/renderers/WebGLRenderer.js

+ 10 - 0
src/renderers/WebGLRenderer.js

@@ -2672,6 +2672,16 @@ class WebGLRenderer {
 
 		};
 
+		this.initRenderTarget = function ( target ) {
+
+			if ( properties.get( target ).__webglFramebuffer === undefined ) {
+
+				textures.setupRenderTarget( target );
+
+			}
+
+		};
+
 		this.initTexture = function ( texture ) {
 
 			if ( texture.isCubeTexture ) {