提交 764e9fa3 编写于 作者: D dubejf

Reset GL state before rendering sprites and lens

上级 1f1d418e
......@@ -1726,6 +1726,7 @@ THREE.WebGLRenderer = function ( parameters ) {
// custom render plugins (post pass)
this.resetGLState();
spritePlugin.render( scene, camera );
lensFlarePlugin.render( scene, camera, _currentWidth, _currentHeight );
......
......@@ -295,8 +295,9 @@ THREE.LensFlarePlugin = function ( renderer, flares ) {
gl.useProgram( program );
gl.enableVertexAttribArray( attributes.vertex );
gl.enableVertexAttribArray( attributes.uv );
renderer.state.disableUnusedAttributes();
renderer.state.enableAttribute( attributes.vertex );
renderer.state.enableAttribute( attributes.uv );
// loop through all lens flares to update their occlusion and positions
// setup gl and common used attribs/unforms
......
......@@ -98,8 +98,9 @@ THREE.SpritePlugin = function ( renderer, sprites ) {
gl.useProgram( program );
gl.enableVertexAttribArray( attributes.position );
gl.enableVertexAttribArray( attributes.uv );
renderer.state.disableUnusedAttributes();
renderer.state.enableAttribute( attributes.position );
renderer.state.enableAttribute( attributes.uv );
gl.disable( gl.CULL_FACE );
gl.enable( gl.BLEND );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册