|
@@ -11840,7 +11840,7 @@ Camera.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
|
|
|
}
|
|
|
|
|
|
- this.updateMatrixWorld( true );
|
|
|
+ this.updateWorldMatrix( true, false );
|
|
|
|
|
|
const e = this.matrixWorld.elements;
|
|
|
|
|
@@ -12195,22 +12195,6 @@ function CubeCamera( near, far, renderTarget ) {
|
|
|
|
|
|
};
|
|
|
|
|
|
- this.clear = function ( renderer, color, depth, stencil ) {
|
|
|
-
|
|
|
- const currentRenderTarget = renderer.getRenderTarget();
|
|
|
-
|
|
|
- for ( let i = 0; i < 6; i ++ ) {
|
|
|
-
|
|
|
- renderer.setRenderTarget( renderTarget, i );
|
|
|
-
|
|
|
- renderer.clear( color, depth, stencil );
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- renderer.setRenderTarget( currentRenderTarget );
|
|
|
-
|
|
|
- };
|
|
|
-
|
|
|
}
|
|
|
|
|
|
CubeCamera.prototype = Object.create( Object3D.prototype );
|
|
@@ -12377,6 +12361,22 @@ WebGLCubeRenderTarget.prototype.fromEquirectangularTexture = function ( renderer
|
|
|
|
|
|
};
|
|
|
|
|
|
+WebGLCubeRenderTarget.prototype.clear = function ( renderer, color, depth, stencil ) {
|
|
|
+
|
|
|
+ const currentRenderTarget = renderer.getRenderTarget();
|
|
|
+
|
|
|
+ for ( let 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 ) {
|
|
|
|
|
|
Texture.call( this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding );
|
|
@@ -18234,7 +18234,7 @@ function shadowCastingLightsFirst( lightA, lightB ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
-function WebGLLights() {
|
|
|
+function WebGLLights( extensions, capabilities ) {
|
|
|
|
|
|
const cache = new UniformsCache();
|
|
|
|
|
@@ -18491,8 +18491,34 @@ function WebGLLights() {
|
|
|
|
|
|
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.' );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|
|
@@ -18550,9 +18576,9 @@ function WebGLLights() {
|
|
|
|
|
|
}
|
|
|
|
|
|
-function WebGLRenderState() {
|
|
|
+function WebGLRenderState( extensions, capabilities ) {
|
|
|
|
|
|
- const lights = new WebGLLights();
|
|
|
+ const lights = new WebGLLights( extensions, capabilities );
|
|
|
|
|
|
const lightsArray = [];
|
|
|
const shadowsArray = [];
|
|
@@ -18600,7 +18626,7 @@ function WebGLRenderState() {
|
|
|
|
|
|
}
|
|
|
|
|
|
-function WebGLRenderStates() {
|
|
|
+function WebGLRenderStates( extensions, capabilities ) {
|
|
|
|
|
|
let renderStates = new WeakMap();
|
|
|
|
|
@@ -18610,7 +18636,7 @@ function WebGLRenderStates() {
|
|
|
|
|
|
if ( renderStates.has( scene ) === false ) {
|
|
|
|
|
|
- renderState = new WebGLRenderState();
|
|
|
+ renderState = new WebGLRenderState( extensions, capabilities );
|
|
|
renderStates.set( scene, new WeakMap() );
|
|
|
renderStates.get( scene ).set( camera, renderState );
|
|
|
|
|
@@ -18618,7 +18644,7 @@ function WebGLRenderStates() {
|
|
|
|
|
|
if ( renderStates.get( scene ).has( camera ) === false ) {
|
|
|
|
|
|
- renderState = new WebGLRenderState();
|
|
|
+ renderState = new WebGLRenderState( extensions, capabilities );
|
|
|
renderStates.get( scene ).set( camera, renderState );
|
|
|
|
|
|
} else {
|
|
@@ -23340,7 +23366,7 @@ function WebGLRenderer( parameters ) {
|
|
|
programCache = new WebGLPrograms( _this, cubemaps, extensions, capabilities, bindingStates, clipping );
|
|
|
materials = new WebGLMaterials( properties );
|
|
|
renderLists = new WebGLRenderLists( properties );
|
|
|
- renderStates = new WebGLRenderStates();
|
|
|
+ renderStates = new WebGLRenderStates( extensions, capabilities );
|
|
|
background = new WebGLBackground( _this, cubemaps, state, objects, _premultipliedAlpha );
|
|
|
|
|
|
bufferRenderer = new WebGLBufferRenderer( _gl, extensions, info, capabilities );
|
|
@@ -40081,12 +40107,12 @@ MaterialLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
|
|
|
|
|
|
if ( json.uuid !== undefined ) material.uuid = json.uuid;
|
|
|
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.metalness !== undefined ) material.metalness = json.metalness;
|
|
|
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.clearcoat !== undefined ) material.clearcoat = json.clearcoat;
|
|
|
if ( json.clearcoatRoughness !== undefined ) material.clearcoatRoughness = json.clearcoatRoughness;
|
|
@@ -42885,12 +42911,12 @@ class Audio extends Object3D {
|
|
|
if ( this._connected === true ) {
|
|
|
|
|
|
this.disconnect();
|
|
|
- this.filters = value;
|
|
|
+ this.filters = value.slice();
|
|
|
this.connect();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
- this.filters = value;
|
|
|
+ this.filters = value.slice();
|
|
|
|
|
|
}
|
|
|
|
|
@@ -44472,7 +44498,12 @@ Object.assign( AnimationObjectGroup.prototype, {
|
|
|
const lastIndex = -- nObjects,
|
|
|
lastObject = objects[ lastIndex ];
|
|
|
|
|
|
- indicesByUUID[ lastObject.uuid ] = index;
|
|
|
+ if ( lastIndex > 0 ) {
|
|
|
+
|
|
|
+ indicesByUUID[ lastObject.uuid ] = index;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
objects[ index ] = lastObject;
|
|
|
objects.pop();
|
|
|
|
|
@@ -50832,6 +50863,13 @@ CubeCamera.prototype.updateCubeMap = function ( 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 );
|
|
|
+
|
|
|
+};
|
|
|
+
|
|
|
//
|
|
|
|
|
|
const GeometryUtils = {
|