浏览代码

Updated builds.

Mr.doob 3 年之前
父节点
当前提交
71cb26b50a
共有 4 个文件被更改,包括 34 次插入8 次删除
  1. 10 3
      build/three.cjs
  2. 10 3
      build/three.js
  3. 0 0
      build/three.min.js
  4. 14 2
      build/three.module.js

+ 10 - 3
build/three.cjs

@@ -10864,6 +10864,7 @@ function WebGLBindingStates(gl, extensions, attributes, capabilities) {
 	const bindingStates = {};
 	const defaultState = createBindingState(null);
 	let currentState = defaultState;
+	let forceUpdate = false;
 
 	function setup(object, material, program, geometry, index) {
 		let updateBuffers = false;
@@ -10897,7 +10898,8 @@ function WebGLBindingStates(gl, extensions, attributes, capabilities) {
 			attributes.update(index, gl.ELEMENT_ARRAY_BUFFER);
 		}
 
-		if (updateBuffers) {
+		if (updateBuffers || forceUpdate) {
+			forceUpdate = false;
 			setupVertexAttributes(object, material, program, geometry);
 
 			if (index !== null) {
@@ -11224,6 +11226,7 @@ function WebGLBindingStates(gl, extensions, attributes, capabilities) {
 
 	function reset() {
 		resetDefaultState();
+		forceUpdate = true;
 		if (currentState === defaultState) return;
 		currentState = defaultState;
 		bindVertexArrayObject(currentState.object);
@@ -11788,8 +11791,7 @@ class PMREMGenerator {
 	}
 
 	_dispose() {
-		this._blurMaterial.dispose();
-
+		if (this._blurMaterial !== null) this._blurMaterial.dispose();
 		if (this._pingPongRenderTarget !== null) this._pingPongRenderTarget.dispose();
 
 		for (let i = 0; i < this._lodPlanes.length; i++) {
@@ -31211,6 +31213,11 @@ class PositionalAudio extends Audio {
 		this.panner.connect(this.gain);
 	}
 
+	disconnect() {
+		super.disconnect();
+		this.panner.disconnect(this.gain);
+	}
+
 	getOutput() {
 		return this.panner;
 	}

+ 10 - 3
build/three.js

@@ -10866,6 +10866,7 @@
 		const bindingStates = {};
 		const defaultState = createBindingState(null);
 		let currentState = defaultState;
+		let forceUpdate = false;
 
 		function setup(object, material, program, geometry, index) {
 			let updateBuffers = false;
@@ -10899,7 +10900,8 @@
 				attributes.update(index, gl.ELEMENT_ARRAY_BUFFER);
 			}
 
-			if (updateBuffers) {
+			if (updateBuffers || forceUpdate) {
+				forceUpdate = false;
 				setupVertexAttributes(object, material, program, geometry);
 
 				if (index !== null) {
@@ -11226,6 +11228,7 @@
 
 		function reset() {
 			resetDefaultState();
+			forceUpdate = true;
 			if (currentState === defaultState) return;
 			currentState = defaultState;
 			bindVertexArrayObject(currentState.object);
@@ -11790,8 +11793,7 @@
 		}
 
 		_dispose() {
-			this._blurMaterial.dispose();
-
+			if (this._blurMaterial !== null) this._blurMaterial.dispose();
 			if (this._pingPongRenderTarget !== null) this._pingPongRenderTarget.dispose();
 
 			for (let i = 0; i < this._lodPlanes.length; i++) {
@@ -31213,6 +31215,11 @@
 			this.panner.connect(this.gain);
 		}
 
+		disconnect() {
+			super.disconnect();
+			this.panner.disconnect(this.gain);
+		}
+
 		getOutput() {
 			return this.panner;
 		}

文件差异内容过多而无法显示
+ 0 - 0
build/three.min.js


+ 14 - 2
build/three.module.js

@@ -14089,6 +14089,7 @@ function WebGLBindingStates( gl, extensions, attributes, capabilities ) {
 
 	const defaultState = createBindingState( null );
 	let currentState = defaultState;
+	let forceUpdate = false;
 
 	function setup( object, material, program, geometry, index ) {
 
@@ -14139,7 +14140,9 @@ function WebGLBindingStates( gl, extensions, attributes, capabilities ) {
 
 		}
 
-		if ( updateBuffers ) {
+		if ( updateBuffers || forceUpdate ) {
+
+			forceUpdate = false;
 
 			setupVertexAttributes( object, material, program, geometry );
 
@@ -14636,6 +14639,7 @@ function WebGLBindingStates( gl, extensions, attributes, capabilities ) {
 	function reset() {
 
 		resetDefaultState();
+		forceUpdate = true;
 
 		if ( currentState === defaultState ) return;
 
@@ -15417,7 +15421,7 @@ class PMREMGenerator {
 
 	_dispose() {
 
-		this._blurMaterial.dispose();
+		if ( this._blurMaterial !== null ) this._blurMaterial.dispose();
 
 		if ( this._pingPongRenderTarget !== null ) this._pingPongRenderTarget.dispose();
 
@@ -43425,6 +43429,14 @@ class PositionalAudio extends Audio {
 
 	}
 
+	disconnect() {
+
+		super.disconnect();
+
+		this.panner.disconnect( this.gain );
+
+	}
+
 	getOutput() {
 
 		return this.panner;

部分文件因为文件数量过多而无法显示