From 3b847c4a34eb30915b0973738a36aff8db89efa2 Mon Sep 17 00:00:00 2001 From: mbredif Date: Fri, 2 Jul 2021 10:05:52 +0200 Subject: [PATCH] deprecate WebGLMRTs --- examples/webgl2_multiple_rendertargets.html | 20 +- examples/webgl_depth_texture.html | 11 +- src/cameras/CubeCamera.js | 15 +- src/renderers/WebGLCubeRenderTarget.js | 21 +- src/renderers/WebGLMultipleRenderTargets.js | 65 +--- src/renderers/WebGLRenderTarget.js | 90 ++++- src/renderers/WebGLRenderer.js | 102 +++--- src/renderers/webgl/WebGLTextures.js | 358 +++++++++----------- src/textures/CubeTexture.js | 2 +- 9 files changed, 333 insertions(+), 351 deletions(-) diff --git a/examples/webgl2_multiple_rendertargets.html b/examples/webgl2_multiple_rendertargets.html index 6c63d0301112e6..0ddba366bc7089 100644 --- a/examples/webgl2_multiple_rendertargets.html +++ b/examples/webgl2_multiple_rendertargets.html @@ -134,24 +134,24 @@ // Create a multi render target with Float buffers - renderTarget = new THREE.WebGLMultipleRenderTargets( + renderTarget = new THREE.WebGLRenderTarget( window.innerWidth * window.devicePixelRatio, window.innerHeight * window.devicePixelRatio, - 2 + { count : 2 } ); - for ( let i = 0, il = renderTarget.texture.length; i < il; i ++ ) { + for ( let i = 0, il = renderTarget.textures.length; i < il; i ++ ) { - renderTarget.texture[ i ].minFilter = THREE.NearestFilter; - renderTarget.texture[ i ].magFilter = THREE.NearestFilter; - renderTarget.texture[ i ].type = THREE.FloatType; + renderTarget.textures[ i ].minFilter = THREE.NearestFilter; + renderTarget.textures[ i ].magFilter = THREE.NearestFilter; + renderTarget.textures[ i ].type = THREE.FloatType; } // Name our G-Buffer attachments for debugging - renderTarget.texture[ 0 ].name = 'diffuse'; - renderTarget.texture[ 1 ].name = 'normal'; + renderTarget.textures[ 0 ].name = 'diffuse'; + renderTarget.textures[ 1 ].name = 'normal'; // Scene setup @@ -199,8 +199,8 @@ vertexShader: document.querySelector( '#render-vert' ).textContent.trim(), fragmentShader: document.querySelector( '#render-frag' ).textContent.trim(), uniforms: { - tDiffuse: { value: renderTarget.texture[ 0 ] }, - tNormal: { value: renderTarget.texture[ 1 ] }, + tDiffuse: { value: renderTarget.textures[ 0 ] }, + tNormal: { value: renderTarget.textures[ 1 ] }, }, glslVersion: THREE.GLSL3 } ) diff --git a/examples/webgl_depth_texture.html b/examples/webgl_depth_texture.html index 52905fbc83c16a..b7914c36ccecd3 100644 --- a/examples/webgl_depth_texture.html +++ b/examples/webgl_depth_texture.html @@ -27,15 +27,16 @@