|
@@ -63,7 +63,7 @@
|
|
};
|
|
};
|
|
}
|
|
}
|
|
|
|
|
|
- var REVISION = '121';
|
|
|
|
|
|
+ var REVISION = '122';
|
|
var MOUSE = {
|
|
var MOUSE = {
|
|
LEFT: 0,
|
|
LEFT: 0,
|
|
MIDDLE: 1,
|
|
MIDDLE: 1,
|
|
@@ -772,15 +772,24 @@
|
|
};
|
|
};
|
|
|
|
|
|
_proto.fromArray = function fromArray(array, offset) {
|
|
_proto.fromArray = function fromArray(array, offset) {
|
|
- if (offset === undefined) offset = 0;
|
|
|
|
|
|
+ if (offset === void 0) {
|
|
|
|
+ offset = 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
this.x = array[offset];
|
|
this.x = array[offset];
|
|
this.y = array[offset + 1];
|
|
this.y = array[offset + 1];
|
|
return this;
|
|
return this;
|
|
};
|
|
};
|
|
|
|
|
|
_proto.toArray = function toArray(array, offset) {
|
|
_proto.toArray = function toArray(array, offset) {
|
|
- if (array === undefined) array = [];
|
|
|
|
- if (offset === undefined) offset = 0;
|
|
|
|
|
|
+ if (array === void 0) {
|
|
|
|
+ array = [];
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (offset === void 0) {
|
|
|
|
+ offset = 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
array[offset] = this.x;
|
|
array[offset] = this.x;
|
|
array[offset + 1] = this.y;
|
|
array[offset + 1] = this.y;
|
|
return array;
|
|
return array;
|
|
@@ -1094,7 +1103,9 @@
|
|
};
|
|
};
|
|
|
|
|
|
_proto.fromArray = function fromArray(array, offset) {
|
|
_proto.fromArray = function fromArray(array, offset) {
|
|
- if (offset === undefined) offset = 0;
|
|
|
|
|
|
+ if (offset === void 0) {
|
|
|
|
+ offset = 0;
|
|
|
|
+ }
|
|
|
|
|
|
for (var i = 0; i < 9; i++) {
|
|
for (var i = 0; i < 9; i++) {
|
|
this.elements[i] = array[i + offset];
|
|
this.elements[i] = array[i + offset];
|
|
@@ -1104,8 +1115,14 @@
|
|
};
|
|
};
|
|
|
|
|
|
_proto.toArray = function toArray(array, offset) {
|
|
_proto.toArray = function toArray(array, offset) {
|
|
- if (array === undefined) array = [];
|
|
|
|
- if (offset === undefined) offset = 0;
|
|
|
|
|
|
+ if (array === void 0) {
|
|
|
|
+ array = [];
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (offset === void 0) {
|
|
|
|
+ offset = 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
var te = this.elements;
|
|
var te = this.elements;
|
|
array[offset] = te[0];
|
|
array[offset] = te[0];
|
|
array[offset + 1] = te[1];
|
|
array[offset + 1] = te[1];
|
|
@@ -1817,7 +1834,10 @@
|
|
};
|
|
};
|
|
|
|
|
|
_proto.fromArray = function fromArray(array, offset) {
|
|
_proto.fromArray = function fromArray(array, offset) {
|
|
- if (offset === undefined) offset = 0;
|
|
|
|
|
|
+ if (offset === void 0) {
|
|
|
|
+ offset = 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
this.x = array[offset];
|
|
this.x = array[offset];
|
|
this.y = array[offset + 1];
|
|
this.y = array[offset + 1];
|
|
this.z = array[offset + 2];
|
|
this.z = array[offset + 2];
|
|
@@ -1826,8 +1846,14 @@
|
|
};
|
|
};
|
|
|
|
|
|
_proto.toArray = function toArray(array, offset) {
|
|
_proto.toArray = function toArray(array, offset) {
|
|
- if (array === undefined) array = [];
|
|
|
|
- if (offset === undefined) offset = 0;
|
|
|
|
|
|
+ if (array === void 0) {
|
|
|
|
+ array = [];
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (offset === void 0) {
|
|
|
|
+ offset = 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
array[offset] = this.x;
|
|
array[offset] = this.x;
|
|
array[offset + 1] = this.y;
|
|
array[offset + 1] = this.y;
|
|
array[offset + 2] = this.z;
|
|
array[offset + 2] = this.z;
|
|
@@ -2395,7 +2421,10 @@
|
|
};
|
|
};
|
|
|
|
|
|
_proto.fromArray = function fromArray(array, offset) {
|
|
_proto.fromArray = function fromArray(array, offset) {
|
|
- if (offset === undefined) offset = 0;
|
|
|
|
|
|
+ if (offset === void 0) {
|
|
|
|
+ offset = 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
this._x = array[offset];
|
|
this._x = array[offset];
|
|
this._y = array[offset + 1];
|
|
this._y = array[offset + 1];
|
|
this._z = array[offset + 2];
|
|
this._z = array[offset + 2];
|
|
@@ -2407,8 +2436,14 @@
|
|
};
|
|
};
|
|
|
|
|
|
_proto.toArray = function toArray(array, offset) {
|
|
_proto.toArray = function toArray(array, offset) {
|
|
- if (array === undefined) array = [];
|
|
|
|
- if (offset === undefined) offset = 0;
|
|
|
|
|
|
+ if (array === void 0) {
|
|
|
|
+ array = [];
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (offset === void 0) {
|
|
|
|
+ offset = 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
array[offset] = this._x;
|
|
array[offset] = this._x;
|
|
array[offset + 1] = this._y;
|
|
array[offset + 1] = this._y;
|
|
array[offset + 2] = this._z;
|
|
array[offset + 2] = this._z;
|
|
@@ -2981,7 +3016,10 @@
|
|
};
|
|
};
|
|
|
|
|
|
_proto.fromArray = function fromArray(array, offset) {
|
|
_proto.fromArray = function fromArray(array, offset) {
|
|
- if (offset === undefined) offset = 0;
|
|
|
|
|
|
+ if (offset === void 0) {
|
|
|
|
+ offset = 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
this.x = array[offset];
|
|
this.x = array[offset];
|
|
this.y = array[offset + 1];
|
|
this.y = array[offset + 1];
|
|
this.z = array[offset + 2];
|
|
this.z = array[offset + 2];
|
|
@@ -2989,8 +3027,14 @@
|
|
};
|
|
};
|
|
|
|
|
|
_proto.toArray = function toArray(array, offset) {
|
|
_proto.toArray = function toArray(array, offset) {
|
|
- if (array === undefined) array = [];
|
|
|
|
- if (offset === undefined) offset = 0;
|
|
|
|
|
|
+ if (array === void 0) {
|
|
|
|
+ array = [];
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (offset === void 0) {
|
|
|
|
+ offset = 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
array[offset] = this.x;
|
|
array[offset] = this.x;
|
|
array[offset + 1] = this.y;
|
|
array[offset + 1] = this.y;
|
|
array[offset + 2] = this.z;
|
|
array[offset + 2] = this.z;
|
|
@@ -4648,7 +4692,9 @@
|
|
};
|
|
};
|
|
|
|
|
|
_proto.fromArray = function fromArray(array, offset) {
|
|
_proto.fromArray = function fromArray(array, offset) {
|
|
- if (offset === undefined) offset = 0;
|
|
|
|
|
|
+ if (offset === void 0) {
|
|
|
|
+ offset = 0;
|
|
|
|
+ }
|
|
|
|
|
|
for (var i = 0; i < 16; i++) {
|
|
for (var i = 0; i < 16; i++) {
|
|
this.elements[i] = array[i + offset];
|
|
this.elements[i] = array[i + offset];
|
|
@@ -4658,8 +4704,14 @@
|
|
};
|
|
};
|
|
|
|
|
|
_proto.toArray = function toArray(array, offset) {
|
|
_proto.toArray = function toArray(array, offset) {
|
|
- if (array === undefined) array = [];
|
|
|
|
- if (offset === undefined) offset = 0;
|
|
|
|
|
|
+ if (array === void 0) {
|
|
|
|
+ array = [];
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (offset === void 0) {
|
|
|
|
+ offset = 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
var te = this.elements;
|
|
var te = this.elements;
|
|
array[offset] = te[0];
|
|
array[offset] = te[0];
|
|
array[offset + 1] = te[1];
|
|
array[offset + 1] = te[1];
|
|
@@ -4888,8 +4940,14 @@
|
|
};
|
|
};
|
|
|
|
|
|
_proto.toArray = function toArray(array, offset) {
|
|
_proto.toArray = function toArray(array, offset) {
|
|
- if (array === undefined) array = [];
|
|
|
|
- if (offset === undefined) offset = 0;
|
|
|
|
|
|
+ if (array === void 0) {
|
|
|
|
+ array = [];
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (offset === void 0) {
|
|
|
|
+ offset = 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
array[offset] = this._x;
|
|
array[offset] = this._x;
|
|
array[offset + 1] = this._y;
|
|
array[offset + 1] = this._y;
|
|
array[offset + 2] = this._z;
|
|
array[offset + 2] = this._z;
|
|
@@ -5255,6 +5313,16 @@
|
|
|
|
|
|
return this;
|
|
return this;
|
|
},
|
|
},
|
|
|
|
+ clear: function clear() {
|
|
|
|
+ for (var i = 0; i < this.children.length; i++) {
|
|
|
|
+ var object = this.children[i];
|
|
|
|
+ object.parent = null;
|
|
|
|
+ object.dispatchEvent(_removedEvent);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.children.length = 0;
|
|
|
|
+ return this;
|
|
|
|
+ },
|
|
attach: function attach(object) {
|
|
attach: function attach(object) {
|
|
// adds object as a child of this, while maintaining the object's world transform
|
|
// adds object as a child of this, while maintaining the object's world transform
|
|
this.updateWorldMatrix(true, false);
|
|
this.updateWorldMatrix(true, false);
|
|
@@ -6542,7 +6610,10 @@
|
|
};
|
|
};
|
|
|
|
|
|
_proto.fromArray = function fromArray(array, offset) {
|
|
_proto.fromArray = function fromArray(array, offset) {
|
|
- if (offset === undefined) offset = 0;
|
|
|
|
|
|
+ if (offset === void 0) {
|
|
|
|
+ offset = 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
this.r = array[offset];
|
|
this.r = array[offset];
|
|
this.g = array[offset + 1];
|
|
this.g = array[offset + 1];
|
|
this.b = array[offset + 2];
|
|
this.b = array[offset + 2];
|
|
@@ -6550,8 +6621,14 @@
|
|
};
|
|
};
|
|
|
|
|
|
_proto.toArray = function toArray(array, offset) {
|
|
_proto.toArray = function toArray(array, offset) {
|
|
- if (array === undefined) array = [];
|
|
|
|
- if (offset === undefined) offset = 0;
|
|
|
|
|
|
+ if (array === void 0) {
|
|
|
|
+ array = [];
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (offset === void 0) {
|
|
|
|
+ offset = 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
array[offset] = this.r;
|
|
array[offset] = this.r;
|
|
array[offset + 1] = this.g;
|
|
array[offset + 1] = this.g;
|
|
array[offset + 2] = this.b;
|
|
array[offset + 2] = this.b;
|
|
@@ -9143,7 +9220,7 @@
|
|
target = new Vector3();
|
|
target = new Vector3();
|
|
}
|
|
}
|
|
|
|
|
|
- this.updateMatrixWorld(true);
|
|
|
|
|
|
+ this.updateWorldMatrix(true, false);
|
|
var e = this.matrixWorld.elements;
|
|
var e = this.matrixWorld.elements;
|
|
return target.set(-e[8], -e[9], -e[10]).normalize();
|
|
return target.set(-e[8], -e[9], -e[10]).normalize();
|
|
},
|
|
},
|
|
@@ -9398,17 +9475,6 @@
|
|
renderer.setRenderTarget(currentRenderTarget);
|
|
renderer.setRenderTarget(currentRenderTarget);
|
|
renderer.xr.enabled = currentXrEnabled;
|
|
renderer.xr.enabled = currentXrEnabled;
|
|
};
|
|
};
|
|
-
|
|
|
|
- this.clear = function (renderer, color, depth, stencil) {
|
|
|
|
- var currentRenderTarget = renderer.getRenderTarget();
|
|
|
|
-
|
|
|
|
- for (var i = 0; i < 6; i++) {
|
|
|
|
- renderer.setRenderTarget(renderTarget, i);
|
|
|
|
- renderer.clear(color, depth, stencil);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- renderer.setRenderTarget(currentRenderTarget);
|
|
|
|
- };
|
|
|
|
}
|
|
}
|
|
|
|
|
|
CubeCamera.prototype = Object.create(Object3D.prototype);
|
|
CubeCamera.prototype = Object.create(Object3D.prototype);
|
|
@@ -9419,7 +9485,15 @@
|
|
mapping = mapping !== undefined ? mapping : CubeReflectionMapping;
|
|
mapping = mapping !== undefined ? mapping : CubeReflectionMapping;
|
|
format = format !== undefined ? format : RGBFormat;
|
|
format = format !== undefined ? format : RGBFormat;
|
|
Texture.call(this, images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding);
|
|
Texture.call(this, images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding);
|
|
- this.flipY = false;
|
|
|
|
|
|
+ this.flipY = false; // Why CubeTexture._needsFlipEnvMap is necessary:
|
|
|
|
+ //
|
|
|
|
+ // By convention -- likely based on the RenderMan spec from the 1990's -- cube maps are specified by WebGL (and three.js)
|
|
|
|
+ // in a coordinate system in which positive-x is to the right when looking up the positive-z axis -- in other words,
|
|
|
|
+ // in a left-handed coordinate system. By continuing this convention, preexisting cube maps continued to render correctly.
|
|
|
|
+ // three.js uses a right-handed coordinate system. So environment maps used in three.js appear to have px and nx swapped
|
|
|
|
+ // and the flag _needsFlipEnvMap controls this conversion. The flip is not required (and thus _needsFlipEnvMap is set to false)
|
|
|
|
+ // when using WebGLCubeRenderTarget.texture as a cube texture.
|
|
|
|
+
|
|
this._needsFlipEnvMap = true;
|
|
this._needsFlipEnvMap = true;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -9494,6 +9568,17 @@
|
|
return this;
|
|
return this;
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+ WebGLCubeRenderTarget.prototype.clear = function (renderer, color, depth, stencil) {
|
|
|
|
+ var currentRenderTarget = renderer.getRenderTarget();
|
|
|
|
+
|
|
|
|
+ for (var i = 0; i < 6; i++) {
|
|
|
|
+ renderer.setRenderTarget(this, i);
|
|
|
|
+ renderer.clear(color, depth, stencil);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ renderer.setRenderTarget(currentRenderTarget);
|
|
|
|
+ };
|
|
|
|
+
|
|
function DataTexture(data, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, encoding) {
|
|
function DataTexture(data, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, encoding) {
|
|
Texture.call(this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding);
|
|
Texture.call(this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding);
|
|
this.image = {
|
|
this.image = {
|
|
@@ -11534,6 +11619,7 @@
|
|
renderer.setRenderTarget(currentRenderTarget);
|
|
renderer.setRenderTarget(currentRenderTarget);
|
|
renderer.setRenderList(currentRenderList);
|
|
renderer.setRenderList(currentRenderList);
|
|
renderer.setRenderState(currentRenderState);
|
|
renderer.setRenderState(currentRenderState);
|
|
|
|
+ texture.addEventListener('dispose', onTextureDispose);
|
|
return mapTextureMapping(renderTarget.texture, texture.mapping);
|
|
return mapTextureMapping(renderTarget.texture, texture.mapping);
|
|
} else {
|
|
} else {
|
|
// image not yet ready. try the conversion next frame
|
|
// image not yet ready. try the conversion next frame
|
|
@@ -11546,6 +11632,17 @@
|
|
return texture;
|
|
return texture;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ function onTextureDispose(event) {
|
|
|
|
+ var texture = event.target;
|
|
|
|
+ texture.removeEventListener('dispose', onTextureDispose);
|
|
|
|
+ var cubemap = cubemaps.get(texture);
|
|
|
|
+
|
|
|
|
+ if (cubemap !== undefined) {
|
|
|
|
+ cubemaps.delete(texture);
|
|
|
|
+ cubemap.dispose();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
function dispose() {
|
|
function dispose() {
|
|
cubemaps = new WeakMap();
|
|
cubemaps = new WeakMap();
|
|
}
|
|
}
|
|
@@ -11625,7 +11722,7 @@
|
|
wireframeAttributes.delete(buffergeometry);
|
|
wireframeAttributes.delete(buffergeometry);
|
|
}
|
|
}
|
|
|
|
|
|
- bindingStates.releaseStatesOfGeometry(geometry);
|
|
|
|
|
|
+ bindingStates.releaseStatesOfGeometry(buffergeometry);
|
|
|
|
|
|
if (geometry.isInstancedBufferGeometry === true) {
|
|
if (geometry.isInstancedBufferGeometry === true) {
|
|
delete geometry._maxInstanceCount;
|
|
delete geometry._maxInstanceCount;
|
|
@@ -13736,7 +13833,7 @@
|
|
return (lightB.castShadow ? 1 : 0) - (lightA.castShadow ? 1 : 0);
|
|
return (lightB.castShadow ? 1 : 0) - (lightA.castShadow ? 1 : 0);
|
|
}
|
|
}
|
|
|
|
|
|
- function WebGLLights() {
|
|
|
|
|
|
+ function WebGLLights(extensions, capabilities) {
|
|
var cache = new UniformsCache();
|
|
var cache = new UniformsCache();
|
|
var shadowCache = ShadowUniformsCache();
|
|
var shadowCache = ShadowUniformsCache();
|
|
var state = {
|
|
var state = {
|
|
@@ -13957,8 +14054,22 @@
|
|
}
|
|
}
|
|
|
|
|
|
if (rectAreaLength > 0) {
|
|
if (rectAreaLength > 0) {
|
|
- state.rectAreaLTC1 = UniformsLib.LTC_1;
|
|
|
|
- state.rectAreaLTC2 = UniformsLib.LTC_2;
|
|
|
|
|
|
+ if (capabilities.isWebGL2) {
|
|
|
|
+ // WebGL 2
|
|
|
|
+ state.rectAreaLTC1 = UniformsLib.LTC_FLOAT_1;
|
|
|
|
+ state.rectAreaLTC2 = UniformsLib.LTC_FLOAT_2;
|
|
|
|
+ } else {
|
|
|
|
+ // WebGL 1
|
|
|
|
+ if (extensions.has('OES_texture_float_linear') === true) {
|
|
|
|
+ state.rectAreaLTC1 = UniformsLib.LTC_FLOAT_1;
|
|
|
|
+ state.rectAreaLTC2 = UniformsLib.LTC_FLOAT_2;
|
|
|
|
+ } else if (extensions.has('OES_texture_half_float_linear') === true) {
|
|
|
|
+ state.rectAreaLTC1 = UniformsLib.LTC_HALF_1;
|
|
|
|
+ state.rectAreaLTC2 = UniformsLib.LTC_HALF_2;
|
|
|
|
+ } else {
|
|
|
|
+ console.error('THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.');
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
state.ambient[0] = r;
|
|
state.ambient[0] = r;
|
|
@@ -13999,8 +14110,8 @@
|
|
};
|
|
};
|
|
}
|
|
}
|
|
|
|
|
|
- function WebGLRenderState() {
|
|
|
|
- var lights = new WebGLLights();
|
|
|
|
|
|
+ function WebGLRenderState(extensions, capabilities) {
|
|
|
|
+ var lights = new WebGLLights(extensions, capabilities);
|
|
var lightsArray = [];
|
|
var lightsArray = [];
|
|
var shadowsArray = [];
|
|
var shadowsArray = [];
|
|
|
|
|
|
@@ -14035,19 +14146,19 @@
|
|
};
|
|
};
|
|
}
|
|
}
|
|
|
|
|
|
- function WebGLRenderStates() {
|
|
|
|
|
|
+ function WebGLRenderStates(extensions, capabilities) {
|
|
var renderStates = new WeakMap();
|
|
var renderStates = new WeakMap();
|
|
|
|
|
|
function get(scene, camera) {
|
|
function get(scene, camera) {
|
|
var renderState;
|
|
var renderState;
|
|
|
|
|
|
if (renderStates.has(scene) === false) {
|
|
if (renderStates.has(scene) === false) {
|
|
- renderState = new WebGLRenderState();
|
|
|
|
|
|
+ renderState = new WebGLRenderState(extensions, capabilities);
|
|
renderStates.set(scene, new WeakMap());
|
|
renderStates.set(scene, new WeakMap());
|
|
renderStates.get(scene).set(camera, renderState);
|
|
renderStates.get(scene).set(camera, renderState);
|
|
} else {
|
|
} else {
|
|
if (renderStates.get(scene).has(camera) === false) {
|
|
if (renderStates.get(scene).has(camera) === false) {
|
|
- renderState = new WebGLRenderState();
|
|
|
|
|
|
+ renderState = new WebGLRenderState(extensions, capabilities);
|
|
renderStates.get(scene).set(camera, renderState);
|
|
renderStates.get(scene).set(camera, renderState);
|
|
} else {
|
|
} else {
|
|
renderState = renderStates.get(scene).get(camera);
|
|
renderState = renderStates.get(scene).get(camera);
|
|
@@ -17334,7 +17445,7 @@
|
|
programCache = new WebGLPrograms(_this, cubemaps, extensions, capabilities, bindingStates, clipping);
|
|
programCache = new WebGLPrograms(_this, cubemaps, extensions, capabilities, bindingStates, clipping);
|
|
materials = new WebGLMaterials(properties);
|
|
materials = new WebGLMaterials(properties);
|
|
renderLists = new WebGLRenderLists(properties);
|
|
renderLists = new WebGLRenderLists(properties);
|
|
- renderStates = new WebGLRenderStates();
|
|
|
|
|
|
+ renderStates = new WebGLRenderStates(extensions, capabilities);
|
|
background = new WebGLBackground(_this, cubemaps, state, objects, _premultipliedAlpha);
|
|
background = new WebGLBackground(_this, cubemaps, state, objects, _premultipliedAlpha);
|
|
bufferRenderer = new WebGLBufferRenderer(_gl, extensions, info, capabilities);
|
|
bufferRenderer = new WebGLBufferRenderer(_gl, extensions, info, capabilities);
|
|
indexedBufferRenderer = new WebGLIndexedBufferRenderer(_gl, extensions, info, capabilities);
|
|
indexedBufferRenderer = new WebGLIndexedBufferRenderer(_gl, extensions, info, capabilities);
|
|
@@ -17723,8 +17834,8 @@
|
|
this.compile = function (scene, camera) {
|
|
this.compile = function (scene, camera) {
|
|
currentRenderState = renderStates.get(scene, camera);
|
|
currentRenderState = renderStates.get(scene, camera);
|
|
currentRenderState.init();
|
|
currentRenderState.init();
|
|
- scene.traverse(function (object) {
|
|
|
|
- if (object.isLight) {
|
|
|
|
|
|
+ scene.traverseVisible(function (object) {
|
|
|
|
+ if (object.isLight && object.layers.test(camera.layers)) {
|
|
currentRenderState.pushLight(object);
|
|
currentRenderState.pushLight(object);
|
|
|
|
|
|
if (object.castShadow) {
|
|
if (object.castShadow) {
|
|
@@ -19932,6 +20043,9 @@
|
|
|
|
|
|
VideoTexture.prototype = Object.assign(Object.create(Texture.prototype), {
|
|
VideoTexture.prototype = Object.assign(Object.create(Texture.prototype), {
|
|
constructor: VideoTexture,
|
|
constructor: VideoTexture,
|
|
|
|
+ clone: function clone() {
|
|
|
|
+ return new this.constructor(this.image).copy(this);
|
|
|
|
+ },
|
|
isVideoTexture: true,
|
|
isVideoTexture: true,
|
|
update: function update() {
|
|
update: function update() {
|
|
var video = this.image;
|
|
var video = this.image;
|
|
@@ -28970,7 +29084,10 @@
|
|
};
|
|
};
|
|
|
|
|
|
_proto.fromArray = function fromArray(array, offset) {
|
|
_proto.fromArray = function fromArray(array, offset) {
|
|
- if (offset === undefined) offset = 0;
|
|
|
|
|
|
+ if (offset === void 0) {
|
|
|
|
+ offset = 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
var coefficients = this.coefficients;
|
|
var coefficients = this.coefficients;
|
|
|
|
|
|
for (var i = 0; i < 9; i++) {
|
|
for (var i = 0; i < 9; i++) {
|
|
@@ -28981,8 +29098,14 @@
|
|
};
|
|
};
|
|
|
|
|
|
_proto.toArray = function toArray(array, offset) {
|
|
_proto.toArray = function toArray(array, offset) {
|
|
- if (array === undefined) array = [];
|
|
|
|
- if (offset === undefined) offset = 0;
|
|
|
|
|
|
+ if (array === void 0) {
|
|
|
|
+ array = [];
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (offset === void 0) {
|
|
|
|
+ offset = 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
var coefficients = this.coefficients;
|
|
var coefficients = this.coefficients;
|
|
|
|
|
|
for (var i = 0; i < 9; i++) {
|
|
for (var i = 0; i < 9; i++) {
|
|
@@ -29084,12 +29207,12 @@
|
|
var material = new Materials[json.type]();
|
|
var material = new Materials[json.type]();
|
|
if (json.uuid !== undefined) material.uuid = json.uuid;
|
|
if (json.uuid !== undefined) material.uuid = json.uuid;
|
|
if (json.name !== undefined) material.name = json.name;
|
|
if (json.name !== undefined) material.name = json.name;
|
|
- if (json.color !== undefined) material.color.setHex(json.color);
|
|
|
|
|
|
+ if (json.color !== undefined && material.color !== undefined) material.color.setHex(json.color);
|
|
if (json.roughness !== undefined) material.roughness = json.roughness;
|
|
if (json.roughness !== undefined) material.roughness = json.roughness;
|
|
if (json.metalness !== undefined) material.metalness = json.metalness;
|
|
if (json.metalness !== undefined) material.metalness = json.metalness;
|
|
if (json.sheen !== undefined) material.sheen = new Color().setHex(json.sheen);
|
|
if (json.sheen !== undefined) material.sheen = new Color().setHex(json.sheen);
|
|
- if (json.emissive !== undefined) material.emissive.setHex(json.emissive);
|
|
|
|
- if (json.specular !== undefined) material.specular.setHex(json.specular);
|
|
|
|
|
|
+ if (json.emissive !== undefined && material.emissive !== undefined) material.emissive.setHex(json.emissive);
|
|
|
|
+ if (json.specular !== undefined && material.specular !== undefined) material.specular.setHex(json.specular);
|
|
if (json.shininess !== undefined) material.shininess = json.shininess;
|
|
if (json.shininess !== undefined) material.shininess = json.shininess;
|
|
if (json.clearcoat !== undefined) material.clearcoat = json.clearcoat;
|
|
if (json.clearcoat !== undefined) material.clearcoat = json.clearcoat;
|
|
if (json.clearcoatRoughness !== undefined) material.clearcoatRoughness = json.clearcoatRoughness;
|
|
if (json.clearcoatRoughness !== undefined) material.clearcoatRoughness = json.clearcoatRoughness;
|
|
@@ -30999,10 +31122,10 @@
|
|
|
|
|
|
if (this._connected === true) {
|
|
if (this._connected === true) {
|
|
this.disconnect();
|
|
this.disconnect();
|
|
- this.filters = value;
|
|
|
|
|
|
+ this.filters = value.slice();
|
|
this.connect();
|
|
this.connect();
|
|
} else {
|
|
} else {
|
|
- this.filters = value;
|
|
|
|
|
|
+ this.filters = value.slice();
|
|
}
|
|
}
|
|
|
|
|
|
return this;
|
|
return this;
|
|
@@ -32072,7 +32195,10 @@
|
|
var _lastIndex = --nObjects,
|
|
var _lastIndex = --nObjects,
|
|
_lastObject = objects[_lastIndex];
|
|
_lastObject = objects[_lastIndex];
|
|
|
|
|
|
- indicesByUUID[_lastObject.uuid] = index;
|
|
|
|
|
|
+ if (_lastIndex > 0) {
|
|
|
|
+ indicesByUUID[_lastObject.uuid] = index;
|
|
|
|
+ }
|
|
|
|
+
|
|
objects[index] = _lastObject;
|
|
objects[index] = _lastObject;
|
|
objects.pop(); // accounting is done, now do the same for all bindings
|
|
objects.pop(); // accounting is done, now do the same for all bindings
|
|
|
|
|
|
@@ -36594,6 +36720,11 @@
|
|
CubeCamera.prototype.updateCubeMap = function (renderer, scene) {
|
|
CubeCamera.prototype.updateCubeMap = function (renderer, scene) {
|
|
console.warn('THREE.CubeCamera: .updateCubeMap() is now .update().');
|
|
console.warn('THREE.CubeCamera: .updateCubeMap() is now .update().');
|
|
return this.update(renderer, scene);
|
|
return this.update(renderer, scene);
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ CubeCamera.prototype.clear = function (renderer, color, depth, stencil) {
|
|
|
|
+ console.warn('THREE.CubeCamera: .clear() is now .renderTarget.clear().');
|
|
|
|
+ return this.renderTarget.clear(renderer, color, depth, stencil);
|
|
}; //
|
|
}; //
|
|
|
|
|
|
|
|
|