Browse Source

fixed multi sample render targets

Marc-Sefan Cassola 6 years ago
parent
commit
22142f236f
1 changed files with 4 additions and 4 deletions
  1. 4 4
      src/renderers/WebGLRenderer.js

+ 4 - 4
src/renderers/WebGLRenderer.js

@@ -1089,7 +1089,7 @@ function WebGLRenderer( parameters ) {
 		currentRenderState = renderStates.get( scene, camera );
 		currentRenderState = renderStates.get( scene, camera );
 		currentRenderState.init();
 		currentRenderState.init();
 
 
-		scene.onBeforeRender( _this, scene, camera, renderTarget );
+		scene.onBeforeRender( _this, scene, camera, _currentRenderTarget );
 
 
 		_projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );
 		_projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );
 		_frustum.setFromMatrix( _projScreenMatrix );
 		_frustum.setFromMatrix( _projScreenMatrix );
@@ -1160,15 +1160,15 @@ function WebGLRenderer( parameters ) {
 
 
 		//
 		//
 
 
-		if ( renderTarget !== undefined ) {
+		if ( _currentRenderTarget ) {
 
 
 			// Generate mipmap if we're using any kind of mipmap filtering
 			// Generate mipmap if we're using any kind of mipmap filtering
 
 
-			textures.updateRenderTargetMipmap( renderTarget );
+			textures.updateRenderTargetMipmap( _currentRenderTarget );
 
 
 			// resolve multisample renderbuffers to a single-sample texture if necessary
 			// resolve multisample renderbuffers to a single-sample texture if necessary
 
 
-			textures.updateMultisampleRenderTarget( renderTarget );
+			textures.updateMultisampleRenderTarget( _currentRenderTarget );
 
 
 		}
 		}