Explorar o código

Merge pull request #21295 from Mugen87/dev48

WebGLState: Enhance reset().
Mr.doob %!s(int64=4) %!d(string=hai) anos
pai
achega
b6f1fe71ae
Modificáronse 1 ficheiros con 10 adicións e 1 borrados
  1. 10 1
      src/renderers/webgl/WebGLState.js

+ 10 - 1
src/renderers/webgl/WebGLState.js

@@ -898,7 +898,7 @@ function WebGLState( gl, extensions, capabilities ) {
 		gl.clearDepth( 1 );
 
 		gl.stencilMask( 0xffffffff );
-		gl.stencilFunc( gl.ALWAYS, 0, 1 );
+		gl.stencilFunc( gl.ALWAYS, 0, 0xffffffff );
 		gl.stencilOp( gl.KEEP, gl.KEEP, gl.KEEP );
 		gl.clearStencil( 0 );
 
@@ -907,6 +907,15 @@ function WebGLState( gl, extensions, capabilities ) {
 
 		gl.polygonOffset( 0, 0 );
 
+		gl.activeTexture( gl.TEXTURE0 );
+
+		gl.useProgram( null );
+
+		gl.lineWidth( 1 );
+
+		gl.scissor( 0, 0, gl.canvas.width, gl.canvas.height );
+		gl.viewport( 0, 0, gl.canvas.width, gl.canvas.height );
+
 		// reset internals
 
 		enabledCapabilities = {};