提交 69310ccb 编写于 作者: M Michael Herzog 提交者: Mr.doob

WebGLRenderer: Clean up (#8669)

上级 d7e19630
......@@ -2837,7 +2837,7 @@ THREE.WebGLRenderer = function ( parameters ) {
state.activeTexture( _gl.TEXTURE0 + slot );
state.bindTexture( _gl.TEXTURE_2D, textureProperties.__webglTexture );
};
}
function clampToMaxSize ( image, maxSize ) {
......@@ -3244,7 +3244,7 @@ THREE.WebGLRenderer = function ( parameters ) {
return _currentRenderTarget;
}
};
this.setRenderTarget = function ( renderTarget ) {
......@@ -3337,18 +3337,17 @@ THREE.WebGLRenderer = function ( parameters ) {
var texture = renderTarget.texture;
if ( texture.format !== THREE.RGBAFormat
&& paramThreeToGL( texture.format ) !== _gl.getParameter( _gl.IMPLEMENTATION_COLOR_READ_FORMAT ) ) {
if ( texture.format !== THREE.RGBAFormat && paramThreeToGL( texture.format ) !== _gl.getParameter( _gl.IMPLEMENTATION_COLOR_READ_FORMAT ) ) {
console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.' );
return;
}
if ( texture.type !== THREE.UnsignedByteType
&& paramThreeToGL( texture.type ) !== _gl.getParameter( _gl.IMPLEMENTATION_COLOR_READ_TYPE )
&& ! ( texture.type === THREE.FloatType && extensions.get( 'WEBGL_color_buffer_float' ) )
&& ! ( texture.type === THREE.HalfFloatType && extensions.get( 'EXT_color_buffer_half_float' ) ) ) {
if ( texture.type !== THREE.UnsignedByteType &&
paramThreeToGL( texture.type ) !== _gl.getParameter( _gl.IMPLEMENTATION_COLOR_READ_TYPE ) &&
! ( texture.type === THREE.FloatType && extensions.get( 'WEBGL_color_buffer_float' ) ) &&
! ( texture.type === THREE.HalfFloatType && extensions.get( 'EXT_color_buffer_half_float' ) ) ) {
console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.' );
return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册