code: function setupDepthTexture ( framebuffer, renderTarget ) {
  
  		var isCube = ( renderTarget instanceof THREE.WebGLRenderTargetCube );
  		if ( isCube ) throw new Error('Depth Texture with cube render targets is not supported!');
  
  		_gl.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer );
  
  		if ( !( renderTarget.depthTexture instanceof THREE.DepthTexture ) ) {
  
  			throw new Error('renderTarget.depthTexture must be an instance of THREE.DepthTexture');
  
  		}
  
  		// upload an empty depth texture with framebuffer size
  		if ( !properties.get( renderTarget.depthTexture ).__webglTexture ||
  				renderTarget.depthTexture.image.width !== renderTarget.width ||
  				renderTarget.depthTexture.image.height !== renderTarget.height ) {
  			renderTarget.depthTexture.image.width = renderTarget.width;
  			renderTarget.depthTexture.image.height = renderTarget.height;
  			renderTarget.depthTexture.needsUpdate = true;
  		}
  
  		setTexture2D( renderTarget.depthTexture, 0 );
  
  		var webglDepthTexture = properties.get( renderTarget.depthTexture ).__webglTexture;
  		_gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0 );
  
  	}
docs: Setup resources for a Depth Texture for a FBO (needs an extension)