Browse 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 1 năm trước cách đây
mục cha
commit
c3741d2f5d
1 tập tin đã thay đổi với 10 bổ sung0 xóa
  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 ) {