Explorar el Código

Updated builds.

Mr.doob hace 4 años
padre
commit
cf8fba851c
Se han modificado 3 ficheros con 53 adiciones y 33 borrados
  1. 26 16
      build/three.js
  2. 0 0
      build/three.min.js
  3. 27 17
      build/three.module.js

+ 26 - 16
build/three.js

@@ -1849,7 +1849,7 @@
 	*/
 	*/
 
 
 	class WebGLRenderTarget extends EventDispatcher {
 	class WebGLRenderTarget extends EventDispatcher {
-		constructor(width, height, options) {
+		constructor(width, height, options = {}) {
 			super();
 			super();
 			this.width = width;
 			this.width = width;
 			this.height = height;
 			this.height = height;
@@ -1857,7 +1857,6 @@
 			this.scissor = new Vector4(0, 0, width, height);
 			this.scissor = new Vector4(0, 0, width, height);
 			this.scissorTest = false;
 			this.scissorTest = false;
 			this.viewport = new Vector4(0, 0, width, height);
 			this.viewport = new Vector4(0, 0, width, height);
-			options = options || {};
 			this.texture = new Texture(undefined, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.encoding);
 			this.texture = new Texture(undefined, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.encoding);
 			this.texture.image = {
 			this.texture.image = {
 				width: width,
 				width: width,
@@ -17359,9 +17358,7 @@
 		return canvas;
 		return canvas;
 	}
 	}
 
 
-	function WebGLRenderer(parameters) {
-		parameters = parameters || {};
-
+	function WebGLRenderer(parameters = {}) {
 		const _canvas = parameters.canvas !== undefined ? parameters.canvas : createCanvasElement(),
 		const _canvas = parameters.canvas !== undefined ? parameters.canvas : createCanvasElement(),
 					_context = parameters.context !== undefined ? parameters.context : null,
 					_context = parameters.context !== undefined ? parameters.context : null,
 					_alpha = parameters.alpha !== undefined ? parameters.alpha : false,
 					_alpha = parameters.alpha !== undefined ? parameters.alpha : false,
@@ -18259,7 +18256,21 @@
 				bindingStates.reset();
 				bindingStates.reset();
 				renderObjectImmediate(object, program);
 				renderObjectImmediate(object, program);
 			} else {
 			} else {
-				_this.renderBufferDirect(camera, scene, geometry, material, object, group);
+				if (material.transparent === true && material.side === DoubleSide) {
+					material.side = BackSide;
+					material.needsUpdate = true;
+
+					_this.renderBufferDirect(camera, scene, geometry, material, object, group);
+
+					material.side = FrontSide;
+					material.needsUpdate = true;
+
+					_this.renderBufferDirect(camera, scene, geometry, material, object, group);
+
+					material.side = DoubleSide;
+				} else {
+					_this.renderBufferDirect(camera, scene, geometry, material, object, group);
+				}
 			}
 			}
 
 
 			object.onAfterRender(_this, scene, camera, geometry, material, group);
 			object.onAfterRender(_this, scene, camera, geometry, material, group);
@@ -19673,15 +19684,15 @@
 	Bone.prototype.isBone = true;
 	Bone.prototype.isBone = true;
 
 
 	class DataTexture extends Texture {
 	class DataTexture extends Texture {
-		constructor(data, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, encoding) {
+		constructor(data = null, width = 1, height = 1, format, type, mapping, wrapS, wrapT, magFilter = NearestFilter, minFilter = NearestFilter, anisotropy, encoding) {
 			super(null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding);
 			super(null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding);
 			this.image = {
 			this.image = {
-				data: data || null,
-				width: width || 1,
-				height: height || 1
+				data: data,
+				width: width,
+				height: height
 			};
 			};
-			this.magFilter = magFilter !== undefined ? magFilter : NearestFilter;
-			this.minFilter = minFilter !== undefined ? minFilter : NearestFilter;
+			this.magFilter = magFilter;
+			this.minFilter = minFilter;
 			this.generateMipmaps = false;
 			this.generateMipmaps = false;
 			this.flipY = false;
 			this.flipY = false;
 			this.unpackAlignment = 1;
 			this.unpackAlignment = 1;
@@ -21074,8 +21085,7 @@
 	 * Port from https://github.com/mapbox/earcut (v2.2.2)
 	 * Port from https://github.com/mapbox/earcut (v2.2.2)
 	 */
 	 */
 	const Earcut = {
 	const Earcut = {
-		triangulate: function (data, holeIndices, dim) {
-			dim = dim || 2;
+		triangulate: function (data, holeIndices, dim = 2) {
 			const hasHoles = holeIndices && holeIndices.length;
 			const hasHoles = holeIndices && holeIndices.length;
 			const outerLen = hasHoles ? holeIndices[0] * dim : data.length;
 			const outerLen = hasHoles ? holeIndices[0] * dim : data.length;
 			let outerNode = linkedList(data, 0, outerLen, dim, true);
 			let outerNode = linkedList(data, 0, outerLen, dim, true);
@@ -28254,7 +28264,7 @@
 	InstancedBufferGeometry.prototype.isInstancedBufferGeometry = true;
 	InstancedBufferGeometry.prototype.isInstancedBufferGeometry = true;
 
 
 	class InstancedBufferAttribute extends BufferAttribute {
 	class InstancedBufferAttribute extends BufferAttribute {
-		constructor(array, itemSize, normalized, meshPerAttribute) {
+		constructor(array, itemSize, normalized, meshPerAttribute = 1) {
 			if (typeof normalized === 'number') {
 			if (typeof normalized === 'number') {
 				meshPerAttribute = normalized;
 				meshPerAttribute = normalized;
 				normalized = false;
 				normalized = false;
@@ -28262,7 +28272,7 @@
 			}
 			}
 
 
 			super(array, itemSize, normalized);
 			super(array, itemSize, normalized);
-			this.meshPerAttribute = meshPerAttribute || 1;
+			this.meshPerAttribute = meshPerAttribute;
 		}
 		}
 
 
 		copy(source) {
 		copy(source) {

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
build/three.min.js


+ 27 - 17
build/three.module.js

@@ -2435,7 +2435,7 @@ Vector4.prototype.isVector4 = true;
 */
 */
 class WebGLRenderTarget extends EventDispatcher {
 class WebGLRenderTarget extends EventDispatcher {
 
 
-	constructor( width, height, options ) {
+	constructor( width, height, options = {} ) {
 
 
 		super();
 		super();
 
 
@@ -2448,8 +2448,6 @@ class WebGLRenderTarget extends EventDispatcher {
 
 
 		this.viewport = new Vector4( 0, 0, width, height );
 		this.viewport = new Vector4( 0, 0, width, height );
 
 
-		options = options || {};
-
 		this.texture = new Texture( undefined, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.encoding );
 		this.texture = new Texture( undefined, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.encoding );
 
 
 		this.texture.image = { width: width, height: height, depth: 1 };
 		this.texture.image = { width: width, height: height, depth: 1 };
@@ -23516,9 +23514,7 @@ function createCanvasElement() {
 
 
 }
 }
 
 
-function WebGLRenderer( parameters ) {
-
-	parameters = parameters || {};
+function WebGLRenderer( parameters = {} ) {
 
 
 	const _canvas = parameters.canvas !== undefined ? parameters.canvas : createCanvasElement(),
 	const _canvas = parameters.canvas !== undefined ? parameters.canvas : createCanvasElement(),
 		_context = parameters.context !== undefined ? parameters.context : null,
 		_context = parameters.context !== undefined ? parameters.context : null,
@@ -24823,7 +24819,23 @@ function WebGLRenderer( parameters ) {
 
 
 		} else {
 		} else {
 
 
-			_this.renderBufferDirect( camera, scene, geometry, material, object, group );
+			if ( material.transparent === true && material.side === DoubleSide ) {
+
+				material.side = BackSide;
+				material.needsUpdate = true;
+				_this.renderBufferDirect( camera, scene, geometry, material, object, group );
+
+				material.side = FrontSide;
+				material.needsUpdate = true;
+				_this.renderBufferDirect( camera, scene, geometry, material, object, group );
+
+				material.side = DoubleSide;
+
+			} else {
+
+				_this.renderBufferDirect( camera, scene, geometry, material, object, group );
+
+			}
 
 
 		}
 		}
 
 
@@ -26799,14 +26811,14 @@ Bone.prototype.isBone = true;
 
 
 class DataTexture extends Texture {
 class DataTexture extends Texture {
 
 
-	constructor( data, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, encoding ) {
+	constructor( data = null, width = 1, height = 1, format, type, mapping, wrapS, wrapT, magFilter = NearestFilter, minFilter = NearestFilter, anisotropy, encoding ) {
 
 
 		super( null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding );
 		super( null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding );
 
 
-		this.image = { data: data || null, width: width || 1, height: height || 1 };
+		this.image = { data: data, width: width, height: height };
 
 
-		this.magFilter = magFilter !== undefined ? magFilter : NearestFilter;
-		this.minFilter = minFilter !== undefined ? minFilter : NearestFilter;
+		this.magFilter = magFilter;
+		this.minFilter = minFilter;
 
 
 		this.generateMipmaps = false;
 		this.generateMipmaps = false;
 		this.flipY = false;
 		this.flipY = false;
@@ -28800,9 +28812,7 @@ class EdgesGeometry extends BufferGeometry {
 
 
 const Earcut = {
 const Earcut = {
 
 
-	triangulate: function ( data, holeIndices, dim ) {
-
-		dim = dim || 2;
+	triangulate: function ( data, holeIndices, dim = 2 ) {
 
 
 		const hasHoles = holeIndices && holeIndices.length;
 		const hasHoles = holeIndices && holeIndices.length;
 		const outerLen = hasHoles ? holeIndices[ 0 ] * dim : data.length;
 		const outerLen = hasHoles ? holeIndices[ 0 ] * dim : data.length;
@@ -39013,7 +39023,7 @@ InstancedBufferGeometry.prototype.isInstancedBufferGeometry = true;
 
 
 class InstancedBufferAttribute extends BufferAttribute {
 class InstancedBufferAttribute extends BufferAttribute {
 
 
-	constructor( array, itemSize, normalized, meshPerAttribute ) {
+	constructor( array, itemSize, normalized, meshPerAttribute = 1 ) {
 
 
 		if ( typeof normalized === 'number' ) {
 		if ( typeof normalized === 'number' ) {
 
 
@@ -39027,7 +39037,7 @@ class InstancedBufferAttribute extends BufferAttribute {
 
 
 		super( array, itemSize, normalized );
 		super( array, itemSize, normalized );
 
 
-		this.meshPerAttribute = meshPerAttribute || 1;
+		this.meshPerAttribute = meshPerAttribute;
 
 
 	}
 	}
 
 
@@ -39041,7 +39051,7 @@ class InstancedBufferAttribute extends BufferAttribute {
 
 
 	}
 	}
 
 
-	toJSON()	{
+	toJSON() {
 
 
 		const data = super.toJSON();
 		const data = super.toJSON();
 
 

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio