提交 24e0ec47 编写于 作者: T Takahiro

Update setupFrameBufferTexture()

上级 b17356ff
......@@ -637,7 +637,9 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
var glFormat = utils.convert( renderTarget.texture.format );
var glType = utils.convert( renderTarget.texture.type );
state.texImage2D( textureTarget, 0, glFormat, renderTarget.width, renderTarget.height, 0, glFormat, glType, null );
var glInternalFormat = getInternalFormat( glFormat, glType );
var array = ( _isWebGL2 ) ? new Uint8Array( renderTarget.width * renderTarget.height * 4 ) : null;
state.texImage2D( textureTarget, 0, glInternalFormat, renderTarget.width, renderTarget.height, 0, glFormat, glType, array );
_gl.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer );
_gl.framebufferTexture2D( _gl.FRAMEBUFFER, attachment, textureTarget, properties.get( renderTarget.texture ).__webglTexture, 0 );
_gl.bindFramebuffer( _gl.FRAMEBUFFER, null );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册