|
@@ -3,7 +3,7 @@
|
|
* Copyright 2010-2021 Three.js Authors
|
|
* Copyright 2010-2021 Three.js Authors
|
|
* SPDX-License-Identifier: MIT
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
*/
|
|
-const REVISION = '133dev';
|
|
|
|
|
|
+const REVISION = '133';
|
|
const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
|
|
const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
|
|
const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
|
|
const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
|
|
const CullFaceNone = 0;
|
|
const CullFaceNone = 0;
|
|
@@ -6706,8 +6706,9 @@ class Object3D extends EventDispatcher {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- onBeforeRender() {}
|
|
|
|
- onAfterRender() {}
|
|
|
|
|
|
+ onBeforeRender( /* renderer, scene, camera, geometry, material, group */ ) {}
|
|
|
|
+
|
|
|
|
+ onAfterRender( /* renderer, scene, camera, geometry, material, group */ ) {}
|
|
|
|
|
|
applyMatrix4( matrix ) {
|
|
applyMatrix4( matrix ) {
|
|
|
|
|
|
@@ -16193,7 +16194,6 @@ function WebGLExtensions( gl ) {
|
|
|
|
|
|
getExtension( 'OES_texture_float_linear' );
|
|
getExtension( 'OES_texture_float_linear' );
|
|
getExtension( 'EXT_color_buffer_half_float' );
|
|
getExtension( 'EXT_color_buffer_half_float' );
|
|
- getExtension( 'EXT_multisampled_render_to_texture' );
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
@@ -16673,6 +16673,7 @@ function WebGLMorphtargets( gl, capabilities, textures ) {
|
|
buffer[ offset + stride + 0 ] = morph.x;
|
|
buffer[ offset + stride + 0 ] = morph.x;
|
|
buffer[ offset + stride + 1 ] = morph.y;
|
|
buffer[ offset + stride + 1 ] = morph.y;
|
|
buffer[ offset + stride + 2 ] = morph.z;
|
|
buffer[ offset + stride + 2 ] = morph.z;
|
|
|
|
+ buffer[ offset + stride + 3 ] = 0;
|
|
|
|
|
|
if ( hasMorphNormals === true ) {
|
|
if ( hasMorphNormals === true ) {
|
|
|
|
|
|
@@ -16680,9 +16681,10 @@ function WebGLMorphtargets( gl, capabilities, textures ) {
|
|
|
|
|
|
if ( morphNormal.normalized === true ) denormalize( morph, morphNormal );
|
|
if ( morphNormal.normalized === true ) denormalize( morph, morphNormal );
|
|
|
|
|
|
- buffer[ offset + stride + 3 ] = morph.x;
|
|
|
|
- buffer[ offset + stride + 4 ] = morph.y;
|
|
|
|
- buffer[ offset + stride + 5 ] = morph.z;
|
|
|
|
|
|
+ buffer[ offset + stride + 4 ] = morph.x;
|
|
|
|
+ buffer[ offset + stride + 5 ] = morph.y;
|
|
|
|
+ buffer[ offset + stride + 6 ] = morph.z;
|
|
|
|
+ buffer[ offset + stride + 7 ] = 0;
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -23662,8 +23664,6 @@ class WebXRManager extends EventDispatcher {
|
|
let xrFrame = null;
|
|
let xrFrame = null;
|
|
let depthStyle = null;
|
|
let depthStyle = null;
|
|
let clearStyle = null;
|
|
let clearStyle = null;
|
|
- const msaartcSupported = renderer.extensions.has( 'EXT_multisampled_render_to_texture' );
|
|
|
|
- let msaaExt = null;
|
|
|
|
|
|
|
|
const controllers = [];
|
|
const controllers = [];
|
|
const inputSourcesMap = new Map();
|
|
const inputSourcesMap = new Map();
|
|
@@ -23933,11 +23933,7 @@ class WebXRManager extends EventDispatcher {
|
|
|
|
|
|
session.updateRenderState( { layers: [ glProjLayer ] } );
|
|
session.updateRenderState( { layers: [ glProjLayer ] } );
|
|
|
|
|
|
- if ( isMultisample && msaartcSupported ) {
|
|
|
|
-
|
|
|
|
- msaaExt = renderer.extensions.get( 'EXT_multisampled_render_to_texture' );
|
|
|
|
-
|
|
|
|
- } else if ( isMultisample ) {
|
|
|
|
|
|
+ if ( isMultisample ) {
|
|
|
|
|
|
glMultisampledFramebuffer = gl.createFramebuffer();
|
|
glMultisampledFramebuffer = gl.createFramebuffer();
|
|
glColorRenderbuffer = gl.createRenderbuffer();
|
|
glColorRenderbuffer = gl.createRenderbuffer();
|
|
@@ -24258,28 +24254,14 @@ class WebXRManager extends EventDispatcher {
|
|
|
|
|
|
state.bindXRFramebuffer( glFramebuffer );
|
|
state.bindXRFramebuffer( glFramebuffer );
|
|
|
|
|
|
- if ( isMultisample && msaartcSupported ) {
|
|
|
|
-
|
|
|
|
- if ( glSubImage.depthStencilTexture !== undefined ) {
|
|
|
|
-
|
|
|
|
- msaaExt.framebufferTexture2DMultisampleEXT( 36160, depthStyle, 3553, glSubImage.depthStencilTexture, 0, 4 );
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- msaaExt.framebufferTexture2DMultisampleEXT( 36160, 36064, 3553, glSubImage.colorTexture, 0, 4 );
|
|
|
|
-
|
|
|
|
- } else {
|
|
|
|
-
|
|
|
|
- if ( glSubImage.depthStencilTexture !== undefined ) {
|
|
|
|
-
|
|
|
|
- gl.framebufferTexture2D( 36160, depthStyle, 3553, glSubImage.depthStencilTexture, 0 );
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
|
|
+ if ( glSubImage.depthStencilTexture !== undefined ) {
|
|
|
|
|
|
- gl.framebufferTexture2D( 36160, 36064, 3553, glSubImage.colorTexture, 0 );
|
|
|
|
|
|
+ gl.framebufferTexture2D( 36160, depthStyle, 3553, glSubImage.depthStencilTexture, 0 );
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ gl.framebufferTexture2D( 36160, 36064, 3553, glSubImage.colorTexture, 0 );
|
|
|
|
+
|
|
viewport = glSubImage.viewport;
|
|
viewport = glSubImage.viewport;
|
|
|
|
|
|
}
|
|
}
|
|
@@ -24304,7 +24286,7 @@ class WebXRManager extends EventDispatcher {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- if ( isMultisample && ! msaartcSupported ) {
|
|
|
|
|
|
+ if ( isMultisample ) {
|
|
|
|
|
|
state.bindXRFramebuffer( glMultisampledFramebuffer );
|
|
state.bindXRFramebuffer( glMultisampledFramebuffer );
|
|
|
|
|
|
@@ -24329,7 +24311,7 @@ class WebXRManager extends EventDispatcher {
|
|
|
|
|
|
if ( onAnimationFrameCallback ) onAnimationFrameCallback( time, frame );
|
|
if ( onAnimationFrameCallback ) onAnimationFrameCallback( time, frame );
|
|
|
|
|
|
- if ( isMultisample && ! msaartcSupported ) {
|
|
|
|
|
|
+ if ( isMultisample ) {
|
|
|
|
|
|
const width = glProjLayer.textureWidth;
|
|
const width = glProjLayer.textureWidth;
|
|
const height = glProjLayer.textureHeight;
|
|
const height = glProjLayer.textureHeight;
|
|
@@ -25837,7 +25819,7 @@ function WebGLRenderer( parameters = {} ) {
|
|
|
|
|
|
const frontFaceCW = ( object.isMesh && object.matrixWorld.determinant() < 0 );
|
|
const frontFaceCW = ( object.isMesh && object.matrixWorld.determinant() < 0 );
|
|
|
|
|
|
- const program = setProgram( camera, scene, material, object );
|
|
|
|
|
|
+ const program = setProgram( camera, scene, geometry, material, object );
|
|
|
|
|
|
state.setMaterial( material, frontFaceCW );
|
|
state.setMaterial( material, frontFaceCW );
|
|
|
|
|
|
@@ -25869,12 +25851,6 @@ function WebGLRenderer( parameters = {} ) {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- if ( geometry.morphAttributes.position !== undefined || geometry.morphAttributes.normal !== undefined ) {
|
|
|
|
-
|
|
|
|
- morphtargets.update( object, geometry, material, program );
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
bindingStates.setup( object, material, program, geometry, index );
|
|
bindingStates.setup( object, material, program, geometry, index );
|
|
|
|
|
|
let attribute;
|
|
let attribute;
|
|
@@ -26439,7 +26415,7 @@ function WebGLRenderer( parameters = {} ) {
|
|
|
|
|
|
if ( object.isImmediateRenderObject ) {
|
|
if ( object.isImmediateRenderObject ) {
|
|
|
|
|
|
- const program = setProgram( camera, scene, material, object );
|
|
|
|
|
|
+ const program = setProgram( camera, scene, geometry, material, object );
|
|
|
|
|
|
state.setMaterial( material );
|
|
state.setMaterial( material );
|
|
|
|
|
|
@@ -26604,7 +26580,7 @@ function WebGLRenderer( parameters = {} ) {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- function setProgram( camera, scene, material, object ) {
|
|
|
|
|
|
+ function setProgram( camera, scene, geometry, material, object ) {
|
|
|
|
|
|
if ( scene.isScene !== true ) scene = _emptyScene; // scene could be a Mesh, Line, Points, ...
|
|
if ( scene.isScene !== true ) scene = _emptyScene; // scene could be a Mesh, Line, Points, ...
|
|
|
|
|
|
@@ -26614,11 +26590,11 @@ function WebGLRenderer( parameters = {} ) {
|
|
const environment = material.isMeshStandardMaterial ? scene.environment : null;
|
|
const environment = material.isMeshStandardMaterial ? scene.environment : null;
|
|
const encoding = ( _currentRenderTarget === null ) ? _this.outputEncoding : _currentRenderTarget.texture.encoding;
|
|
const encoding = ( _currentRenderTarget === null ) ? _this.outputEncoding : _currentRenderTarget.texture.encoding;
|
|
const envMap = ( material.isMeshStandardMaterial ? cubeuvmaps : cubemaps ).get( material.envMap || environment );
|
|
const envMap = ( material.isMeshStandardMaterial ? cubeuvmaps : cubemaps ).get( material.envMap || environment );
|
|
- const vertexAlphas = material.vertexColors === true && !! object.geometry && !! object.geometry.attributes.color && object.geometry.attributes.color.itemSize === 4;
|
|
|
|
- const vertexTangents = !! material.normalMap && !! object.geometry && !! object.geometry.attributes.tangent;
|
|
|
|
- const morphTargets = !! object.geometry && !! object.geometry.morphAttributes.position;
|
|
|
|
- const morphNormals = !! object.geometry && !! object.geometry.morphAttributes.normal;
|
|
|
|
- const morphTargetsCount = ( !! object.geometry && !! object.geometry.morphAttributes.position ) ? object.geometry.morphAttributes.position.length : 0;
|
|
|
|
|
|
+ const vertexAlphas = material.vertexColors === true && !! geometry && !! geometry.attributes.color && geometry.attributes.color.itemSize === 4;
|
|
|
|
+ const vertexTangents = !! material.normalMap && !! geometry && !! geometry.attributes.tangent;
|
|
|
|
+ const morphTargets = !! geometry && !! geometry.morphAttributes.position;
|
|
|
|
+ const morphNormals = !! geometry && !! geometry.morphAttributes.normal;
|
|
|
|
+ const morphTargetsCount = ( !! geometry && !! geometry.morphAttributes.position ) ? geometry.morphAttributes.position.length : 0;
|
|
|
|
|
|
const materialProperties = properties.get( material );
|
|
const materialProperties = properties.get( material );
|
|
const lights = currentRenderState.state.lights;
|
|
const lights = currentRenderState.state.lights;
|
|
@@ -26816,9 +26792,9 @@ function WebGLRenderer( parameters = {} ) {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- // skinning uniforms must be set even if material didn't change
|
|
|
|
- // auto-setting of texture unit for bone texture must go before other textures
|
|
|
|
- // otherwise textures used for skinning can take over texture units reserved for other material textures
|
|
|
|
|
|
+ // skinning and morph target uniforms must be set even if material didn't change
|
|
|
|
+ // auto-setting of texture unit for bone and morph texture must go before other textures
|
|
|
|
+ // otherwise textures used for skinning and morphing can take over texture units reserved for other material textures
|
|
|
|
|
|
if ( object.isSkinnedMesh ) {
|
|
if ( object.isSkinnedMesh ) {
|
|
|
|
|
|
@@ -26846,6 +26822,13 @@ function WebGLRenderer( parameters = {} ) {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if ( !! geometry && ( geometry.morphAttributes.position !== undefined || geometry.morphAttributes.normal !== undefined ) ) {
|
|
|
|
+
|
|
|
|
+ morphtargets.update( object, geometry, material, program );
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
if ( refreshMaterial || materialProperties.receiveShadow !== object.receiveShadow ) {
|
|
if ( refreshMaterial || materialProperties.receiveShadow !== object.receiveShadow ) {
|
|
|
|
|
|
materialProperties.receiveShadow = object.receiveShadow;
|
|
materialProperties.receiveShadow = object.receiveShadow;
|
|
@@ -28431,7 +28414,7 @@ class SkinnedMesh extends Mesh {
|
|
_skinIndex.fromBufferAttribute( geometry.attributes.skinIndex, index );
|
|
_skinIndex.fromBufferAttribute( geometry.attributes.skinIndex, index );
|
|
_skinWeight.fromBufferAttribute( geometry.attributes.skinWeight, index );
|
|
_skinWeight.fromBufferAttribute( geometry.attributes.skinWeight, index );
|
|
|
|
|
|
- _basePosition.fromBufferAttribute( geometry.attributes.position, index ).applyMatrix4( this.bindMatrix );
|
|
|
|
|
|
+ _basePosition.copy( target ).applyMatrix4( this.bindMatrix );
|
|
|
|
|
|
target.set( 0, 0, 0 );
|
|
target.set( 0, 0, 0 );
|
|
|
|
|