|
@@ -289,13 +289,6 @@ class EventDispatcher {
|
|
|
|
|
|
}
|
|
|
|
|
|
-let _seed = 1234567;
|
|
|
-
|
|
|
-const DEG2RAD = Math.PI / 180;
|
|
|
-const RAD2DEG = 180 / Math.PI;
|
|
|
-
|
|
|
-//
|
|
|
-
|
|
|
const _lut = [];
|
|
|
|
|
|
for ( let i = 0; i < 256; i ++ ) {
|
|
@@ -304,18 +297,14 @@ for ( let i = 0; i < 256; i ++ ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
-const hasRandomUUID = typeof crypto !== 'undefined' && 'randomUUID' in crypto;
|
|
|
-
|
|
|
-function generateUUID() {
|
|
|
-
|
|
|
- if ( hasRandomUUID ) {
|
|
|
+let _seed = 1234567;
|
|
|
|
|
|
- return crypto.randomUUID().toUpperCase();
|
|
|
|
|
|
- }
|
|
|
+const DEG2RAD = Math.PI / 180;
|
|
|
+const RAD2DEG = 180 / Math.PI;
|
|
|
|
|
|
- // TODO Remove this code when crypto.randomUUID() is available everywhere
|
|
|
- // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/21963136#21963136
|
|
|
+// http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/21963136#21963136
|
|
|
+function generateUUID() {
|
|
|
|
|
|
const d0 = Math.random() * 0xffffffff | 0;
|
|
|
const d1 = Math.random() * 0xffffffff | 0;
|
|
@@ -7040,6 +7029,8 @@ class Object3D extends EventDispatcher {
|
|
|
|
|
|
// adds object as a child of this, while maintaining the object's world transform
|
|
|
|
|
|
+ // Note: This method does not support scene graphs having non-uniformly-scaled nodes(s)
|
|
|
+
|
|
|
this.updateWorldMatrix( true, false );
|
|
|
|
|
|
_m1$1.copy( this.matrixWorld ).invert();
|
|
@@ -15395,7 +15386,7 @@ class PMREMGenerator {
|
|
|
|
|
|
_setEncoding( uniform, texture ) {
|
|
|
|
|
|
- if ( this._renderer.capabilities.isWebGL2 === true && texture.format === RGBAFormat && texture.type === UnsignedByteType && texture.encoding === sRGBEncoding ) {
|
|
|
+ /* if ( this._renderer.capabilities.isWebGL2 === true && texture.format === RGBAFormat && texture.type === UnsignedByteType && texture.encoding === sRGBEncoding ) {
|
|
|
|
|
|
uniform.value = ENCODINGS[ LinearEncoding ];
|
|
|
|
|
@@ -15403,7 +15394,9 @@ class PMREMGenerator {
|
|
|
|
|
|
uniform.value = ENCODINGS[ texture.encoding ];
|
|
|
|
|
|
- }
|
|
|
+ } */
|
|
|
+
|
|
|
+ uniform.value = ENCODINGS[ texture.encoding ];
|
|
|
|
|
|
}
|
|
|
|
|
@@ -18970,11 +18963,11 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
|
|
|
|
|
|
}
|
|
|
|
|
|
- if ( isWebGL2 && map && map.isTexture && map.format === RGBAFormat && map.type === UnsignedByteType && map.encoding === sRGBEncoding ) {
|
|
|
+ /* if ( isWebGL2 && map && map.isTexture && map.format === RGBAFormat && map.type === UnsignedByteType && map.encoding === sRGBEncoding ) {
|
|
|
|
|
|
encoding = LinearEncoding; // disable inline decode for sRGB textures in WebGL 2
|
|
|
|
|
|
- }
|
|
|
+ } */
|
|
|
|
|
|
return encoding;
|
|
|
|
|
@@ -21924,7 +21917,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
|
|
|
}
|
|
|
|
|
|
- function getInternalFormat( internalFormatName, glFormat, glType, encoding ) {
|
|
|
+ function getInternalFormat( internalFormatName, glFormat, glType/*, encoding*/ ) {
|
|
|
|
|
|
if ( isWebGL2 === false ) return glFormat;
|
|
|
|
|
@@ -21958,7 +21951,9 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
|
|
|
if ( glType === 5126 ) internalFormat = 34836;
|
|
|
if ( glType === 5131 ) internalFormat = 34842;
|
|
|
- if ( glType === 5121 ) internalFormat = ( encoding === sRGBEncoding ) ? 35907 : 32856;
|
|
|
+ //if ( glType === 5121 ) internalFormat = ( encoding === sRGBEncoding ) ? 35907 : 32856;
|
|
|
+ if ( glType === 5121 ) internalFormat = 32856;
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|
|
@@ -25357,10 +25352,10 @@ function WebGLRenderer( parameters = {} ) {
|
|
|
failIfMajorPerformanceCaveat: _failIfMajorPerformanceCaveat
|
|
|
};
|
|
|
|
|
|
- _canvas.setAttribute( 'data-engine', `three.js r${REVISION}` );
|
|
|
+ // OffscreenCanvas does not have setAttribute, see #22811
|
|
|
+ if ( 'setAttribute' in _canvas ) _canvas.setAttribute( 'data-engine', `three.js r${REVISION}` );
|
|
|
|
|
|
// event listeners must be registered before WebGL context is created, see #12753
|
|
|
-
|
|
|
_canvas.addEventListener( 'webglcontextlost', onContextLost, false );
|
|
|
_canvas.addEventListener( 'webglcontextrestored', onContextRestore, false );
|
|
|
|
|
@@ -41970,6 +41965,7 @@ AmbientLightProbe.prototype.isAmbientLightProbe = true;
|
|
|
|
|
|
const _eyeRight = /*@__PURE__*/ new Matrix4();
|
|
|
const _eyeLeft = /*@__PURE__*/ new Matrix4();
|
|
|
+const _projectionMatrix = /*@__PURE__*/ new Matrix4();
|
|
|
|
|
|
class StereoCamera {
|
|
|
|
|
@@ -42022,7 +42018,7 @@ class StereoCamera {
|
|
|
// Off-axis stereoscopic effect based on
|
|
|
// http://paulbourke.net/stereographics/stereorender/
|
|
|
|
|
|
- const projectionMatrix = camera.projectionMatrix.clone();
|
|
|
+ _projectionMatrix.copy( camera.projectionMatrix );
|
|
|
const eyeSepHalf = cache.eyeSep / 2;
|
|
|
const eyeSepOnProjection = eyeSepHalf * cache.near / cache.focus;
|
|
|
const ymax = ( cache.near * Math.tan( DEG2RAD * cache.fov * 0.5 ) ) / cache.zoom;
|
|
@@ -42038,20 +42034,20 @@ class StereoCamera {
|
|
|
xmin = - ymax * cache.aspect + eyeSepOnProjection;
|
|
|
xmax = ymax * cache.aspect + eyeSepOnProjection;
|
|
|
|
|
|
- projectionMatrix.elements[ 0 ] = 2 * cache.near / ( xmax - xmin );
|
|
|
- projectionMatrix.elements[ 8 ] = ( xmax + xmin ) / ( xmax - xmin );
|
|
|
+ _projectionMatrix.elements[ 0 ] = 2 * cache.near / ( xmax - xmin );
|
|
|
+ _projectionMatrix.elements[ 8 ] = ( xmax + xmin ) / ( xmax - xmin );
|
|
|
|
|
|
- this.cameraL.projectionMatrix.copy( projectionMatrix );
|
|
|
+ this.cameraL.projectionMatrix.copy( _projectionMatrix );
|
|
|
|
|
|
// for right eye
|
|
|
|
|
|
xmin = - ymax * cache.aspect - eyeSepOnProjection;
|
|
|
xmax = ymax * cache.aspect - eyeSepOnProjection;
|
|
|
|
|
|
- projectionMatrix.elements[ 0 ] = 2 * cache.near / ( xmax - xmin );
|
|
|
- projectionMatrix.elements[ 8 ] = ( xmax + xmin ) / ( xmax - xmin );
|
|
|
+ _projectionMatrix.elements[ 0 ] = 2 * cache.near / ( xmax - xmin );
|
|
|
+ _projectionMatrix.elements[ 8 ] = ( xmax + xmin ) / ( xmax - xmin );
|
|
|
|
|
|
- this.cameraR.projectionMatrix.copy( projectionMatrix );
|
|
|
+ this.cameraR.projectionMatrix.copy( _projectionMatrix );
|
|
|
|
|
|
}
|
|
|
|