super-three 0.173.2 → 0.173.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/three.cjs +64 -577
- package/build/three.core.js +0 -15
- package/build/three.core.min.js +1 -1
- package/build/three.module.js +65 -563
- package/build/three.module.min.js +1 -1
- package/package.json +1 -1
package/build/three.module.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright 2010-2025 Three.js Authors
|
|
4
4
|
* SPDX-License-Identifier: MIT
|
|
5
5
|
*/
|
|
6
|
-
import { Color, Matrix3, Vector2, mergeUniforms, Vector3, CubeUVReflectionMapping, Mesh, BoxGeometry, ShaderMaterial, cloneUniforms, BackSide, ColorManagement, SRGBTransfer, PlaneGeometry, FrontSide, getUnlitUniformColorSpace, Euler, Matrix4, IntType, RGBAFormat, HalfFloatType, UnsignedByteType, FloatType, Plane, EquirectangularReflectionMapping, EquirectangularRefractionMapping, WebGLCubeRenderTarget, CubeReflectionMapping, CubeRefractionMapping, PerspectiveCamera, NoToneMapping, MeshBasicMaterial, BufferGeometry, BufferAttribute, WebGLRenderTarget, NoBlending, OrthographicCamera, LinearFilter, LinearSRGBColorSpace, warnOnce, arrayNeedsUint32, Uint32BufferAttribute, Uint16BufferAttribute, Vector4, DataArrayTexture, LessEqualCompare, Texture, DepthTexture, Data3DTexture, CubeTexture, GLSL3, CustomToneMapping, NeutralToneMapping, AgXToneMapping, ACESFilmicToneMapping, CineonToneMapping, ReinhardToneMapping, LinearToneMapping, PCFShadowMap, PCFSoftShadowMap, VSMShadowMap, LinearTransfer, AddOperation, MixOperation, MultiplyOperation, ObjectSpaceNormalMap, TangentSpaceNormalMap, NormalBlending, DoubleSide, UniformsUtils, Layers, Frustum, MeshDepthMaterial, RGBADepthPacking, MeshDistanceMaterial, NearestFilter, LessEqualDepth, AddEquation, SubtractEquation, ReverseSubtractEquation, ZeroFactor, OneFactor, SrcColorFactor, SrcAlphaFactor, SrcAlphaSaturateFactor, DstColorFactor, DstAlphaFactor, OneMinusSrcColorFactor, OneMinusSrcAlphaFactor, OneMinusDstColorFactor, OneMinusDstAlphaFactor, ConstantColorFactor, OneMinusConstantColorFactor, ConstantAlphaFactor, OneMinusConstantAlphaFactor, CustomBlending, MultiplyBlending, SubtractiveBlending, AdditiveBlending, CullFaceNone, CullFaceBack, CullFaceFront, NotEqualDepth, GreaterDepth, GreaterEqualDepth, EqualDepth, LessDepth, AlwaysDepth, NeverDepth, MinEquation, MaxEquation, RepeatWrapping, ClampToEdgeWrapping, MirroredRepeatWrapping, NearestMipmapNearestFilter, NearestMipmapLinearFilter, LinearMipmapNearestFilter, LinearMipmapLinearFilter, NeverCompare, AlwaysCompare, LessCompare, EqualCompare, GreaterEqualCompare, GreaterCompare, NotEqualCompare, NoColorSpace, DepthStencilFormat, getByteLength,
|
|
6
|
+
import { Color, Matrix3, Vector2, mergeUniforms, Vector3, CubeUVReflectionMapping, Mesh, BoxGeometry, ShaderMaterial, cloneUniforms, BackSide, ColorManagement, SRGBTransfer, PlaneGeometry, FrontSide, getUnlitUniformColorSpace, Euler, Matrix4, IntType, RGBAFormat, HalfFloatType, UnsignedByteType, FloatType, Plane, EquirectangularReflectionMapping, EquirectangularRefractionMapping, WebGLCubeRenderTarget, CubeReflectionMapping, CubeRefractionMapping, PerspectiveCamera, NoToneMapping, MeshBasicMaterial, BufferGeometry, BufferAttribute, WebGLRenderTarget, NoBlending, OrthographicCamera, LinearFilter, LinearSRGBColorSpace, warnOnce, arrayNeedsUint32, Uint32BufferAttribute, Uint16BufferAttribute, Vector4, DataArrayTexture, LessEqualCompare, Texture, DepthTexture, Data3DTexture, CubeTexture, GLSL3, CustomToneMapping, NeutralToneMapping, AgXToneMapping, ACESFilmicToneMapping, CineonToneMapping, ReinhardToneMapping, LinearToneMapping, PCFShadowMap, PCFSoftShadowMap, VSMShadowMap, LinearTransfer, AddOperation, MixOperation, MultiplyOperation, ObjectSpaceNormalMap, TangentSpaceNormalMap, NormalBlending, DoubleSide, UniformsUtils, Layers, Frustum, MeshDepthMaterial, RGBADepthPacking, MeshDistanceMaterial, NearestFilter, LessEqualDepth, AddEquation, SubtractEquation, ReverseSubtractEquation, ZeroFactor, OneFactor, SrcColorFactor, SrcAlphaFactor, SrcAlphaSaturateFactor, DstColorFactor, DstAlphaFactor, OneMinusSrcColorFactor, OneMinusSrcAlphaFactor, OneMinusDstColorFactor, OneMinusDstAlphaFactor, ConstantColorFactor, OneMinusConstantColorFactor, ConstantAlphaFactor, OneMinusConstantAlphaFactor, CustomBlending, MultiplyBlending, SubtractiveBlending, AdditiveBlending, CullFaceNone, CullFaceBack, CullFaceFront, NotEqualDepth, GreaterDepth, GreaterEqualDepth, EqualDepth, LessDepth, AlwaysDepth, NeverDepth, MinEquation, MaxEquation, RepeatWrapping, ClampToEdgeWrapping, MirroredRepeatWrapping, NearestMipmapNearestFilter, NearestMipmapLinearFilter, LinearMipmapNearestFilter, LinearMipmapLinearFilter, NeverCompare, AlwaysCompare, LessCompare, EqualCompare, GreaterEqualCompare, GreaterCompare, NotEqualCompare, NoColorSpace, DepthStencilFormat, getByteLength, UnsignedIntType, UnsignedInt248Type, UnsignedShortType, DepthFormat, createElementNS, UnsignedShort4444Type, UnsignedShort5551Type, UnsignedInt5999Type, ByteType, ShortType, AlphaFormat, RGBFormat, LuminanceFormat, LuminanceAlphaFormat, RedFormat, RedIntegerFormat, RGFormat, RGIntegerFormat, RGBAIntegerFormat, RGB_S3TC_DXT1_Format, RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT5_Format, RGB_PVRTC_4BPPV1_Format, RGB_PVRTC_2BPPV1_Format, RGBA_PVRTC_4BPPV1_Format, RGBA_PVRTC_2BPPV1_Format, RGB_ETC1_Format, RGB_ETC2_Format, RGBA_ETC2_EAC_Format, RGBA_ASTC_4x4_Format, RGBA_ASTC_5x4_Format, RGBA_ASTC_5x5_Format, RGBA_ASTC_6x5_Format, RGBA_ASTC_6x6_Format, RGBA_ASTC_8x5_Format, RGBA_ASTC_8x6_Format, RGBA_ASTC_8x8_Format, RGBA_ASTC_10x5_Format, RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_10x10_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, RGBA_BPTC_Format, RGB_BPTC_SIGNED_Format, RGB_BPTC_UNSIGNED_Format, RED_RGTC1_Format, SIGNED_RED_RGTC1_Format, RED_GREEN_RGTC2_Format, SIGNED_RED_GREEN_RGTC2_Format, EventDispatcher, ArrayCamera, WebXRController, RAD2DEG, createCanvasElement, SRGBColorSpace, REVISION, toNormalizedProjectionMatrix, toReversedProjectionMatrix, probeAsync, WebGLCoordinateSystem } from './three.core.js';
|
|
7
7
|
export { AdditiveAnimationBlendMode, AlwaysStencilFunc, AmbientLight, AnimationAction, AnimationClip, AnimationLoader, AnimationMixer, AnimationObjectGroup, AnimationUtils, ArcCurve, ArrowHelper, AttachedBindMode, Audio, AudioAnalyser, AudioContext, AudioListener, AudioLoader, AxesHelper, BasicDepthPacking, BasicShadowMap, BatchedMesh, Bone, BooleanKeyframeTrack, Box2, Box3, Box3Helper, BoxHelper, BufferGeometryLoader, Cache, Camera, CameraHelper, CanvasTexture, CapsuleGeometry, CatmullRomCurve3, CircleGeometry, Clock, ColorKeyframeTrack, CompressedArrayTexture, CompressedCubeTexture, CompressedTexture, CompressedTextureLoader, ConeGeometry, Controls, CubeCamera, CubeTextureLoader, CubicBezierCurve, CubicBezierCurve3, CubicInterpolant, CullFaceFrontBack, Curve, CurvePath, CylinderGeometry, Cylindrical, DataTexture, DataTextureLoader, DataUtils, DecrementStencilOp, DecrementWrapStencilOp, DefaultLoadingManager, DetachedBindMode, DirectionalLight, DirectionalLightHelper, DiscreteInterpolant, DodecahedronGeometry, DynamicCopyUsage, DynamicDrawUsage, DynamicReadUsage, EdgesGeometry, EllipseCurve, EqualStencilFunc, ExtrudeGeometry, FileLoader, Float16BufferAttribute, Float32BufferAttribute, Fog, FogExp2, FramebufferTexture, GLBufferAttribute, GLSL1, GreaterEqualStencilFunc, GreaterStencilFunc, GridHelper, Group, HemisphereLight, HemisphereLightHelper, IcosahedronGeometry, ImageBitmapLoader, ImageLoader, ImageUtils, IncrementStencilOp, IncrementWrapStencilOp, InstancedBufferAttribute, InstancedBufferGeometry, InstancedInterleavedBuffer, InstancedMesh, Int16BufferAttribute, Int32BufferAttribute, Int8BufferAttribute, InterleavedBuffer, InterleavedBufferAttribute, Interpolant, InterpolateDiscrete, InterpolateLinear, InterpolateSmooth, InvertStencilOp, KeepStencilOp, KeyframeTrack, LOD, LatheGeometry, LessEqualStencilFunc, LessStencilFunc, Light, LightProbe, Line, Line3, LineBasicMaterial, LineCurve, LineCurve3, LineDashedMaterial, LineLoop, LineSegments, LinearInterpolant, LinearMipMapLinearFilter, LinearMipMapNearestFilter, Loader, LoaderUtils, LoadingManager, LoopOnce, LoopPingPong, LoopRepeat, MOUSE, Material, MaterialLoader, MathUtils, Matrix2, MeshLambertMaterial, MeshMatcapMaterial, MeshNormalMaterial, MeshPhongMaterial, MeshPhysicalMaterial, MeshStandardMaterial, MeshToonMaterial, NearestMipMapLinearFilter, NearestMipMapNearestFilter, NeverStencilFunc, NormalAnimationBlendMode, NotEqualStencilFunc, NumberKeyframeTrack, Object3D, ObjectLoader, OctahedronGeometry, Path, PlaneHelper, PointLight, PointLightHelper, Points, PointsMaterial, PolarGridHelper, PolyhedronGeometry, PositionalAudio, PropertyBinding, PropertyMixer, QuadraticBezierCurve, QuadraticBezierCurve3, Quaternion, QuaternionKeyframeTrack, QuaternionLinearInterpolant, RGBDepthPacking, RGBIntegerFormat, RGDepthPacking, RawShaderMaterial, Ray, Raycaster, RectAreaLight, RenderTarget, RenderTarget3D, RenderTargetArray, ReplaceStencilOp, RingGeometry, Scene, ShadowMaterial, Shape, ShapeGeometry, ShapePath, ShapeUtils, Skeleton, SkeletonHelper, SkinnedMesh, Source, Sphere, SphereGeometry, Spherical, SphericalHarmonics3, SplineCurve, SpotLight, SpotLightHelper, Sprite, SpriteMaterial, StaticCopyUsage, StaticDrawUsage, StaticReadUsage, StereoCamera, StreamCopyUsage, StreamDrawUsage, StreamReadUsage, StringKeyframeTrack, TOUCH, TetrahedronGeometry, TextureLoader, TextureUtils, TimestampQuery, TorusGeometry, TorusKnotGeometry, Triangle, TriangleFanDrawMode, TriangleStripDrawMode, TrianglesDrawMode, TubeGeometry, UVMapping, Uint8BufferAttribute, Uint8ClampedBufferAttribute, Uniform, UniformsGroup, VectorKeyframeTrack, VideoFrameTexture, VideoTexture, WebGL3DRenderTarget, WebGLArrayRenderTarget, WebGPUCoordinateSystem, WireframeGeometry, WrapAroundEnding, ZeroCurvatureEnding, ZeroSlopeEnding, ZeroStencilOp } from './three.core.js';
|
|
8
8
|
|
|
9
9
|
function WebGLAnimation() {
|
|
@@ -1378,7 +1378,7 @@ function WebGLBackground( renderer, cubemaps, cubeuvmaps, state, objects, alpha,
|
|
|
1378
1378
|
if ( boxMesh === undefined ) {
|
|
1379
1379
|
|
|
1380
1380
|
boxMesh = new Mesh(
|
|
1381
|
-
new BoxGeometry(
|
|
1381
|
+
new BoxGeometry( 1, 1, 1 ),
|
|
1382
1382
|
new ShaderMaterial( {
|
|
1383
1383
|
name: 'BackgroundCubeMaterial',
|
|
1384
1384
|
uniforms: cloneUniforms( ShaderLib.backgroundCube.uniforms ),
|
|
@@ -4289,103 +4289,6 @@ function WebGLMorphtargets( gl, capabilities, textures ) {
|
|
|
4289
4289
|
|
|
4290
4290
|
}
|
|
4291
4291
|
|
|
4292
|
-
/**
|
|
4293
|
-
* @author fernandojsg / http://fernandojsg.com
|
|
4294
|
-
* @author Takahiro https://github.com/takahirox
|
|
4295
|
-
*/
|
|
4296
|
-
|
|
4297
|
-
class WebGLMultiview {
|
|
4298
|
-
|
|
4299
|
-
constructor( renderer, extensions, gl ) {
|
|
4300
|
-
|
|
4301
|
-
this.renderer = renderer;
|
|
4302
|
-
|
|
4303
|
-
this.DEFAULT_NUMVIEWS = 2;
|
|
4304
|
-
this.maxNumViews = 0;
|
|
4305
|
-
this.gl = gl;
|
|
4306
|
-
|
|
4307
|
-
this.extensions = extensions;
|
|
4308
|
-
|
|
4309
|
-
this.available = this.extensions.has( 'OCULUS_multiview' );
|
|
4310
|
-
|
|
4311
|
-
if ( this.available ) {
|
|
4312
|
-
|
|
4313
|
-
const extension = this.extensions.get( 'OCULUS_multiview' );
|
|
4314
|
-
|
|
4315
|
-
this.maxNumViews = this.gl.getParameter( extension.MAX_VIEWS_OVR );
|
|
4316
|
-
|
|
4317
|
-
this.mat4 = [];
|
|
4318
|
-
this.mat3 = [];
|
|
4319
|
-
this.cameraArray = [];
|
|
4320
|
-
|
|
4321
|
-
for ( var i = 0; i < this.maxNumViews; i ++ ) {
|
|
4322
|
-
|
|
4323
|
-
this.mat4[ i ] = new Matrix4();
|
|
4324
|
-
this.mat3[ i ] = new Matrix3();
|
|
4325
|
-
|
|
4326
|
-
}
|
|
4327
|
-
|
|
4328
|
-
}
|
|
4329
|
-
|
|
4330
|
-
}
|
|
4331
|
-
|
|
4332
|
-
//
|
|
4333
|
-
getCameraArray( camera ) {
|
|
4334
|
-
|
|
4335
|
-
if ( camera.isArrayCamera ) return camera.cameras;
|
|
4336
|
-
|
|
4337
|
-
this.cameraArray[ 0 ] = camera;
|
|
4338
|
-
|
|
4339
|
-
return this.cameraArray;
|
|
4340
|
-
|
|
4341
|
-
}
|
|
4342
|
-
|
|
4343
|
-
updateCameraProjectionMatricesUniform( camera, uniforms ) {
|
|
4344
|
-
|
|
4345
|
-
var cameras = this.getCameraArray( camera );
|
|
4346
|
-
|
|
4347
|
-
for ( var i = 0; i < cameras.length; i ++ ) {
|
|
4348
|
-
|
|
4349
|
-
this.mat4[ i ].copy( cameras[ i ].projectionMatrix );
|
|
4350
|
-
|
|
4351
|
-
}
|
|
4352
|
-
|
|
4353
|
-
uniforms.setValue( this.gl, 'projectionMatrices', this.mat4 );
|
|
4354
|
-
|
|
4355
|
-
}
|
|
4356
|
-
|
|
4357
|
-
updateCameraViewMatricesUniform( camera, uniforms ) {
|
|
4358
|
-
|
|
4359
|
-
var cameras = this.getCameraArray( camera );
|
|
4360
|
-
|
|
4361
|
-
for ( var i = 0; i < cameras.length; i ++ ) {
|
|
4362
|
-
|
|
4363
|
-
this.mat4[ i ].copy( cameras[ i ].matrixWorldInverse );
|
|
4364
|
-
|
|
4365
|
-
}
|
|
4366
|
-
|
|
4367
|
-
uniforms.setValue( this.gl, 'viewMatrices', this.mat4 );
|
|
4368
|
-
|
|
4369
|
-
}
|
|
4370
|
-
|
|
4371
|
-
updateObjectMatricesUniforms( object, camera, uniforms ) {
|
|
4372
|
-
|
|
4373
|
-
var cameras = this.getCameraArray( camera );
|
|
4374
|
-
|
|
4375
|
-
for ( var i = 0; i < cameras.length; i ++ ) {
|
|
4376
|
-
|
|
4377
|
-
this.mat4[ i ].multiplyMatrices( cameras[ i ].matrixWorldInverse, object.matrixWorld );
|
|
4378
|
-
this.mat3[ i ].getNormalMatrix( this.mat4[ i ] );
|
|
4379
|
-
|
|
4380
|
-
}
|
|
4381
|
-
|
|
4382
|
-
uniforms.setValue( this.gl, 'modelViewMatrices', this.mat4 );
|
|
4383
|
-
uniforms.setValue( this.gl, 'normalMatrices', this.mat3 );
|
|
4384
|
-
|
|
4385
|
-
}
|
|
4386
|
-
|
|
4387
|
-
}
|
|
4388
|
-
|
|
4389
4292
|
function WebGLObjects( gl, geometries, attributes, info ) {
|
|
4390
4293
|
|
|
4391
4294
|
let updateMap = new WeakMap();
|
|
@@ -6137,8 +6040,6 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
|
|
|
6137
6040
|
let prefixVertex, prefixFragment;
|
|
6138
6041
|
let versionString = parameters.glslVersion ? '#version ' + parameters.glslVersion + '\n' : '';
|
|
6139
6042
|
|
|
6140
|
-
const numMultiviewViews = parameters.numMultiviewViews;
|
|
6141
|
-
|
|
6142
6043
|
if ( parameters.isRawShaderMaterial ) {
|
|
6143
6044
|
|
|
6144
6045
|
prefixVertex = [
|
|
@@ -6526,53 +6427,6 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
|
|
|
6526
6427
|
'#define textureCubeGradEXT textureGrad'
|
|
6527
6428
|
].join( '\n' ) + '\n' + prefixFragment;
|
|
6528
6429
|
|
|
6529
|
-
// Multiview
|
|
6530
|
-
|
|
6531
|
-
if ( numMultiviewViews > 0 ) {
|
|
6532
|
-
|
|
6533
|
-
// TODO: fix light transforms here?
|
|
6534
|
-
|
|
6535
|
-
prefixVertex = [
|
|
6536
|
-
'#extension GL_OVR_multiview : require',
|
|
6537
|
-
'layout(num_views = ' + numMultiviewViews + ') in;',
|
|
6538
|
-
'#define VIEW_ID gl_ViewID_OVR'
|
|
6539
|
-
].join( '\n' ) + '\n' + prefixVertex;
|
|
6540
|
-
|
|
6541
|
-
prefixVertex = prefixVertex.replace(
|
|
6542
|
-
[
|
|
6543
|
-
'uniform mat4 modelViewMatrix;',
|
|
6544
|
-
'uniform mat4 projectionMatrix;',
|
|
6545
|
-
'uniform mat4 viewMatrix;',
|
|
6546
|
-
'uniform mat3 normalMatrix;'
|
|
6547
|
-
].join( '\n' ),
|
|
6548
|
-
[
|
|
6549
|
-
'uniform mat4 modelViewMatrices[' + numMultiviewViews + '];',
|
|
6550
|
-
'uniform mat4 projectionMatrices[' + numMultiviewViews + '];',
|
|
6551
|
-
'uniform mat4 viewMatrices[' + numMultiviewViews + '];',
|
|
6552
|
-
'uniform mat3 normalMatrices[' + numMultiviewViews + '];',
|
|
6553
|
-
|
|
6554
|
-
'#define modelViewMatrix modelViewMatrices[VIEW_ID]',
|
|
6555
|
-
'#define projectionMatrix projectionMatrices[VIEW_ID]',
|
|
6556
|
-
'#define viewMatrix viewMatrices[VIEW_ID]',
|
|
6557
|
-
'#define normalMatrix normalMatrices[VIEW_ID]'
|
|
6558
|
-
].join( '\n' )
|
|
6559
|
-
);
|
|
6560
|
-
|
|
6561
|
-
prefixFragment = [
|
|
6562
|
-
'#extension GL_OVR_multiview : require',
|
|
6563
|
-
'#define VIEW_ID gl_ViewID_OVR'
|
|
6564
|
-
].join( '\n' ) + '\n' + prefixFragment;
|
|
6565
|
-
|
|
6566
|
-
prefixFragment = prefixFragment.replace(
|
|
6567
|
-
'uniform mat4 viewMatrix;',
|
|
6568
|
-
[
|
|
6569
|
-
'uniform mat4 viewMatrices[' + numMultiviewViews + '];',
|
|
6570
|
-
'#define viewMatrix viewMatrices[VIEW_ID]'
|
|
6571
|
-
].join( '\n' )
|
|
6572
|
-
);
|
|
6573
|
-
|
|
6574
|
-
}
|
|
6575
|
-
|
|
6576
6430
|
}
|
|
6577
6431
|
|
|
6578
6432
|
const vertexGlsl = versionString + prefixVertex + vertexShader;
|
|
@@ -6765,7 +6619,6 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
|
|
|
6765
6619
|
this.program = program;
|
|
6766
6620
|
this.vertexShader = glVertexShader;
|
|
6767
6621
|
this.fragmentShader = glFragmentShader;
|
|
6768
|
-
this.numMultiviewViews = numMultiviewViews;
|
|
6769
6622
|
|
|
6770
6623
|
return this;
|
|
6771
6624
|
|
|
@@ -6998,8 +6851,6 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
|
|
|
6998
6851
|
const currentRenderTarget = renderer.getRenderTarget();
|
|
6999
6852
|
const reverseDepthBuffer = renderer.state.buffers.depth.getReversed();
|
|
7000
6853
|
|
|
7001
|
-
const numMultiviewViews = currentRenderTarget && currentRenderTarget.isWebGLMultiviewRenderTarget ? currentRenderTarget.numViews : 0;
|
|
7002
|
-
|
|
7003
6854
|
const IS_INSTANCEDMESH = object.isInstancedMesh === true;
|
|
7004
6855
|
const IS_BATCHEDMESH = object.isBatchedMesh === true;
|
|
7005
6856
|
|
|
@@ -7089,7 +6940,6 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
|
|
|
7089
6940
|
instancingMorph: IS_INSTANCEDMESH && object.morphTexture !== null,
|
|
7090
6941
|
|
|
7091
6942
|
supportsVertexTextures: SUPPORTS_VERTEX_TEXTURES,
|
|
7092
|
-
numMultiviewViews: numMultiviewViews,
|
|
7093
6943
|
outputColorSpace: ( currentRenderTarget === null ) ? renderer.outputColorSpace : ( currentRenderTarget.isXRRenderTarget === true ? currentRenderTarget.texture.colorSpace : LinearSRGBColorSpace ),
|
|
7094
6944
|
alphaToCoverage: !! material.alphaToCoverage,
|
|
7095
6945
|
|
|
@@ -7454,8 +7304,6 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
|
|
|
7454
7304
|
_programLayers.enable( 20 );
|
|
7455
7305
|
if ( parameters.alphaToCoverage )
|
|
7456
7306
|
_programLayers.enable( 21 );
|
|
7457
|
-
if ( parameters.numMultiviewViews )
|
|
7458
|
-
_programLayers.enable( 21 );
|
|
7459
7307
|
|
|
7460
7308
|
array.push( _programLayers.mask );
|
|
7461
7309
|
|
|
@@ -10253,7 +10101,6 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
10253
10101
|
|
|
10254
10102
|
const multisampledRTTExt = extensions.has( 'WEBGL_multisampled_render_to_texture' ) ? extensions.get( 'WEBGL_multisampled_render_to_texture' ) : null;
|
|
10255
10103
|
const supportsInvalidateFramebuffer = typeof navigator === 'undefined' ? false : /OculusBrowser/g.test( navigator.userAgent );
|
|
10256
|
-
const multiviewExt = extensions.has( 'OCULUS_multiview' ) ? extensions.get( 'OCULUS_multiview' ) : null;
|
|
10257
10104
|
|
|
10258
10105
|
const _imageDimensions = new Vector2();
|
|
10259
10106
|
const _videoTextures = new WeakMap();
|
|
@@ -10261,9 +10108,6 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
10261
10108
|
|
|
10262
10109
|
const _sources = new WeakMap(); // maps WebglTexture objects to instances of Source
|
|
10263
10110
|
|
|
10264
|
-
let _deferredUploads = [];
|
|
10265
|
-
let _deferTextureUploads = false;
|
|
10266
|
-
|
|
10267
10111
|
// cordova iOS (as of 5.0) still uses UIWebView, which provides OffscreenCanvas,
|
|
10268
10112
|
// also OffscreenCanvas.getContext("webgl"), but not OffscreenCanvas.getContext("2d")!
|
|
10269
10113
|
// Some implementations may only implement OffscreenCanvas partially (e.g. lacking 2d).
|
|
@@ -10778,11 +10622,8 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
10778
10622
|
|
|
10779
10623
|
} else {
|
|
10780
10624
|
|
|
10781
|
-
|
|
10782
|
-
|
|
10783
|
-
return;
|
|
10784
|
-
|
|
10785
|
-
}
|
|
10625
|
+
uploadTexture( textureProperties, texture, slot );
|
|
10626
|
+
return;
|
|
10786
10627
|
|
|
10787
10628
|
}
|
|
10788
10629
|
|
|
@@ -10991,45 +10832,8 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
10991
10832
|
|
|
10992
10833
|
}
|
|
10993
10834
|
|
|
10994
|
-
function setDeferTextureUploads( deferFlag ) {
|
|
10995
|
-
|
|
10996
|
-
_deferTextureUploads = deferFlag;
|
|
10997
|
-
|
|
10998
|
-
}
|
|
10999
|
-
|
|
11000
|
-
function runDeferredUploads() {
|
|
11001
|
-
|
|
11002
|
-
const previousDeferSetting = _deferTextureUploads;
|
|
11003
|
-
_deferTextureUploads = false;
|
|
11004
|
-
|
|
11005
|
-
for ( const upload of _deferredUploads ) {
|
|
11006
|
-
|
|
11007
|
-
uploadTexture( upload.textureProperties, upload.texture, upload.slot );
|
|
11008
|
-
upload.texture.isPendingDeferredUpload = false;
|
|
11009
|
-
|
|
11010
|
-
}
|
|
11011
|
-
|
|
11012
|
-
_deferredUploads = [];
|
|
11013
|
-
|
|
11014
|
-
_deferTextureUploads = previousDeferSetting;
|
|
11015
|
-
|
|
11016
|
-
}
|
|
11017
|
-
|
|
11018
10835
|
function uploadTexture( textureProperties, texture, slot ) {
|
|
11019
10836
|
|
|
11020
|
-
if ( _deferTextureUploads ) {
|
|
11021
|
-
|
|
11022
|
-
if ( ! texture.isPendingDeferredUpload ) {
|
|
11023
|
-
|
|
11024
|
-
texture.isPendingDeferredUpload = true;
|
|
11025
|
-
_deferredUploads.push( { textureProperties: textureProperties, texture: texture, slot: slot } );
|
|
11026
|
-
|
|
11027
|
-
}
|
|
11028
|
-
|
|
11029
|
-
return false;
|
|
11030
|
-
|
|
11031
|
-
}
|
|
11032
|
-
|
|
11033
10837
|
let textureType = _gl.TEXTURE_2D;
|
|
11034
10838
|
|
|
11035
10839
|
if ( texture.isDataArrayTexture || texture.isCompressedArrayTexture ) textureType = _gl.TEXTURE_2D_ARRAY;
|
|
@@ -11459,7 +11263,6 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
11459
11263
|
}
|
|
11460
11264
|
|
|
11461
11265
|
textureProperties.__version = texture.version;
|
|
11462
|
-
return true;
|
|
11463
11266
|
|
|
11464
11267
|
}
|
|
11465
11268
|
|
|
@@ -11718,11 +11521,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
11718
11521
|
const width = Math.max( 1, renderTarget.width >> level );
|
|
11719
11522
|
const height = Math.max( 1, renderTarget.height >> level );
|
|
11720
11523
|
|
|
11721
|
-
if (
|
|
11722
|
-
|
|
11723
|
-
state.texStorage3D( _gl.TEXTURE_2D_ARRAY, 0, glInternalFormat, renderTarget.width, renderTarget.height, renderTarget.numViews );
|
|
11724
|
-
|
|
11725
|
-
} else if ( textureTarget === _gl.TEXTURE_3D || textureTarget === _gl.TEXTURE_2D_ARRAY ) {
|
|
11524
|
+
if ( textureTarget === _gl.TEXTURE_3D || textureTarget === _gl.TEXTURE_2D_ARRAY ) {
|
|
11726
11525
|
|
|
11727
11526
|
state.texImage3D( textureTarget, level, glInternalFormat, width, height, renderTarget.depth, 0, glFormat, glType, null );
|
|
11728
11527
|
|
|
@@ -11736,31 +11535,13 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
11736
11535
|
|
|
11737
11536
|
state.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer );
|
|
11738
11537
|
|
|
11739
|
-
|
|
11740
|
-
|
|
11741
|
-
if ( renderTarget.isWebGLMultiviewRenderTarget === true ) {
|
|
11538
|
+
if ( useMultisampledRTT( renderTarget ) ) {
|
|
11742
11539
|
|
|
11743
|
-
|
|
11744
|
-
|
|
11745
|
-
multiviewExt.framebufferTextureMultisampleMultiviewOVR( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, textureProperties.__webglTexture, 0, getRenderTargetSamples( renderTarget ), 0, renderTarget.numViews );
|
|
11746
|
-
|
|
11747
|
-
} else {
|
|
11748
|
-
|
|
11749
|
-
multiviewExt.framebufferTextureMultiviewOVR( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, textureProperties.__webglTexture, 0, 0, renderTarget.numViews );
|
|
11750
|
-
|
|
11751
|
-
}
|
|
11540
|
+
multisampledRTTExt.framebufferTexture2DMultisampleEXT( _gl.FRAMEBUFFER, attachment, textureTarget, textureProperties.__webglTexture, 0, getRenderTargetSamples( renderTarget ) );
|
|
11752
11541
|
|
|
11753
11542
|
} else if ( textureTarget === _gl.TEXTURE_2D || ( textureTarget >= _gl.TEXTURE_CUBE_MAP_POSITIVE_X && textureTarget <= _gl.TEXTURE_CUBE_MAP_NEGATIVE_Z ) ) { // see #24753
|
|
11754
11543
|
|
|
11755
|
-
|
|
11756
|
-
|
|
11757
|
-
multisampledRTTExt.framebufferTexture2DMultisampleEXT( _gl.FRAMEBUFFER, attachment, textureTarget, textureProperties.__webglTexture, 0, getRenderTargetSamples( renderTarget ) );
|
|
11758
|
-
|
|
11759
|
-
} else {
|
|
11760
|
-
|
|
11761
|
-
_gl.framebufferTexture2D( _gl.FRAMEBUFFER, attachment, textureTarget, textureProperties.__webglTexture, level );
|
|
11762
|
-
|
|
11763
|
-
}
|
|
11544
|
+
_gl.framebufferTexture2D( _gl.FRAMEBUFFER, attachment, textureTarget, textureProperties.__webglTexture, level );
|
|
11764
11545
|
|
|
11765
11546
|
}
|
|
11766
11547
|
|
|
@@ -11773,59 +11554,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
11773
11554
|
|
|
11774
11555
|
_gl.bindRenderbuffer( _gl.RENDERBUFFER, renderbuffer );
|
|
11775
11556
|
|
|
11776
|
-
if ( renderTarget.
|
|
11777
|
-
|
|
11778
|
-
const useMultisample = useMultisampledRTT( renderTarget );
|
|
11779
|
-
const numViews = renderTarget.numViews;
|
|
11780
|
-
|
|
11781
|
-
const depthTexture = renderTarget.depthTexture;
|
|
11782
|
-
let glInternalFormat = _gl.DEPTH_COMPONENT24;
|
|
11783
|
-
let glDepthAttachment = _gl.DEPTH_ATTACHMENT;
|
|
11784
|
-
|
|
11785
|
-
if ( depthTexture && depthTexture.isDepthTexture ) {
|
|
11786
|
-
|
|
11787
|
-
if ( depthTexture.type === FloatType ) {
|
|
11788
|
-
|
|
11789
|
-
glInternalFormat = _gl.DEPTH_COMPONENT32F;
|
|
11790
|
-
|
|
11791
|
-
} else if ( depthTexture.type === UnsignedInt248Type ) {
|
|
11792
|
-
|
|
11793
|
-
glInternalFormat = _gl.DEPTH24_STENCIL8;
|
|
11794
|
-
glDepthAttachment = _gl.DEPTH_STENCIL_ATTACHMENT;
|
|
11795
|
-
|
|
11796
|
-
}
|
|
11797
|
-
|
|
11798
|
-
// we're defaulting to _gl.DEPTH_COMPONENT24 so don't assign here
|
|
11799
|
-
// or else DeepScan will complain
|
|
11800
|
-
|
|
11801
|
-
// else if ( depthTexture.type === UnsignedIntType ) {
|
|
11802
|
-
|
|
11803
|
-
// glInternalFormat = _gl.DEPTH_COMPONENT24;
|
|
11804
|
-
|
|
11805
|
-
// }
|
|
11806
|
-
|
|
11807
|
-
}
|
|
11808
|
-
|
|
11809
|
-
let depthStencilTexture = properties.get( renderTarget.depthTexture ).__webglTexture;
|
|
11810
|
-
if ( depthStencilTexture === undefined ) {
|
|
11811
|
-
|
|
11812
|
-
depthStencilTexture = _gl.createTexture();
|
|
11813
|
-
_gl.bindTexture( _gl.TEXTURE_2D_ARRAY, depthStencilTexture );
|
|
11814
|
-
_gl.texStorage3D( _gl.TEXTURE_2D_ARRAY, 1, glInternalFormat, renderTarget.width, renderTarget.height, numViews );
|
|
11815
|
-
|
|
11816
|
-
}
|
|
11817
|
-
|
|
11818
|
-
if ( useMultisample ) {
|
|
11819
|
-
|
|
11820
|
-
multiviewExt.framebufferTextureMultisampleMultiviewOVR( _gl.FRAMEBUFFER, glDepthAttachment, depthStencilTexture, 0, getRenderTargetSamples( renderTarget ), 0, numViews );
|
|
11821
|
-
|
|
11822
|
-
} else {
|
|
11823
|
-
|
|
11824
|
-
multiviewExt.framebufferTextureMultiviewOVR( _gl.FRAMEBUFFER, glDepthAttachment, depthStencilTexture, 0, 0, numViews );
|
|
11825
|
-
|
|
11826
|
-
}
|
|
11827
|
-
|
|
11828
|
-
} else if ( renderTarget.depthBuffer ) {
|
|
11557
|
+
if ( renderTarget.depthBuffer ) {
|
|
11829
11558
|
|
|
11830
11559
|
// retrieve the depth attachment types
|
|
11831
11560
|
const depthTexture = renderTarget.depthTexture;
|
|
@@ -11915,85 +11644,38 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
11915
11644
|
|
|
11916
11645
|
}
|
|
11917
11646
|
|
|
11918
|
-
|
|
11919
|
-
|
|
11920
|
-
setTexture2DArray( renderTarget.depthTexture, 0 );
|
|
11921
|
-
|
|
11922
|
-
} else {
|
|
11923
|
-
|
|
11924
|
-
setTexture2D( renderTarget.depthTexture, 0 );
|
|
11925
|
-
|
|
11926
|
-
}
|
|
11647
|
+
setTexture2D( renderTarget.depthTexture, 0 );
|
|
11927
11648
|
|
|
11928
11649
|
const webglDepthTexture = textureProperties.__webglTexture;
|
|
11929
11650
|
const samples = getRenderTargetSamples( renderTarget );
|
|
11930
11651
|
|
|
11931
|
-
if ( renderTarget.
|
|
11932
|
-
|
|
11933
|
-
const useMultisample = useMultisampledRTT( renderTarget );
|
|
11934
|
-
const numViews = renderTarget.numViews;
|
|
11935
|
-
|
|
11936
|
-
if ( renderTarget.depthTexture.format === DepthFormat ) {
|
|
11652
|
+
if ( renderTarget.depthTexture.format === DepthFormat ) {
|
|
11937
11653
|
|
|
11938
|
-
|
|
11654
|
+
if ( useMultisampledRTT( renderTarget ) ) {
|
|
11939
11655
|
|
|
11940
|
-
|
|
11941
|
-
|
|
11942
|
-
} else {
|
|
11656
|
+
multisampledRTTExt.framebufferTexture2DMultisampleEXT( _gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0, samples );
|
|
11943
11657
|
|
|
11944
|
-
|
|
11945
|
-
|
|
11946
|
-
}
|
|
11947
|
-
|
|
11948
|
-
} else if ( renderTarget.depthTexture.format === DepthStencilFormat ) {
|
|
11658
|
+
} else {
|
|
11949
11659
|
|
|
11950
|
-
|
|
11660
|
+
_gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0 );
|
|
11951
11661
|
|
|
11952
|
-
|
|
11662
|
+
}
|
|
11953
11663
|
|
|
11954
|
-
|
|
11664
|
+
} else if ( renderTarget.depthTexture.format === DepthStencilFormat ) {
|
|
11955
11665
|
|
|
11956
|
-
|
|
11666
|
+
if ( useMultisampledRTT( renderTarget ) ) {
|
|
11957
11667
|
|
|
11958
|
-
|
|
11668
|
+
multisampledRTTExt.framebufferTexture2DMultisampleEXT( _gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0, samples );
|
|
11959
11669
|
|
|
11960
11670
|
} else {
|
|
11961
11671
|
|
|
11962
|
-
|
|
11672
|
+
_gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0 );
|
|
11963
11673
|
|
|
11964
11674
|
}
|
|
11965
11675
|
|
|
11966
11676
|
} else {
|
|
11967
11677
|
|
|
11968
|
-
|
|
11969
|
-
|
|
11970
|
-
if ( useMultisampledRTT( renderTarget ) ) {
|
|
11971
|
-
|
|
11972
|
-
multisampledRTTExt.framebufferTexture2DMultisampleEXT( _gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0, samples );
|
|
11973
|
-
|
|
11974
|
-
} else {
|
|
11975
|
-
|
|
11976
|
-
_gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0 );
|
|
11977
|
-
|
|
11978
|
-
}
|
|
11979
|
-
|
|
11980
|
-
} else if ( renderTarget.depthTexture.format === DepthStencilFormat ) {
|
|
11981
|
-
|
|
11982
|
-
if ( useMultisampledRTT( renderTarget ) ) {
|
|
11983
|
-
|
|
11984
|
-
multisampledRTTExt.framebufferTexture2DMultisampleEXT( _gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0, samples );
|
|
11985
|
-
|
|
11986
|
-
} else {
|
|
11987
|
-
|
|
11988
|
-
_gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0 );
|
|
11989
|
-
|
|
11990
|
-
}
|
|
11991
|
-
|
|
11992
|
-
} else {
|
|
11993
|
-
|
|
11994
|
-
throw new Error( 'Unknown depthTexture format' );
|
|
11995
|
-
|
|
11996
|
-
}
|
|
11678
|
+
throw new Error( 'Unknown depthTexture format' );
|
|
11997
11679
|
|
|
11998
11680
|
}
|
|
11999
11681
|
|
|
@@ -12308,12 +11990,6 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
12308
11990
|
|
|
12309
11991
|
}
|
|
12310
11992
|
|
|
12311
|
-
if ( renderTarget.isWebGLMultiviewRenderTarget === true ) {
|
|
12312
|
-
|
|
12313
|
-
glTextureType = _gl.TEXTURE_2D_ARRAY;
|
|
12314
|
-
|
|
12315
|
-
}
|
|
12316
|
-
|
|
12317
11993
|
state.bindTexture( glTextureType, textureProperties.__webglTexture );
|
|
12318
11994
|
setTextureParameters( glTextureType, texture );
|
|
12319
11995
|
|
|
@@ -12343,9 +12019,9 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
12343
12019
|
|
|
12344
12020
|
// Setup depth and stencil buffers
|
|
12345
12021
|
|
|
12346
|
-
if ( renderTarget.depthBuffer
|
|
12022
|
+
if ( renderTarget.depthBuffer ) {
|
|
12347
12023
|
|
|
12348
|
-
|
|
12024
|
+
setupDepthRenderbuffer( renderTarget );
|
|
12349
12025
|
|
|
12350
12026
|
}
|
|
12351
12027
|
|
|
@@ -12590,16 +12266,12 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
12590
12266
|
this.setTexture3D = setTexture3D;
|
|
12591
12267
|
this.setTextureCube = setTextureCube;
|
|
12592
12268
|
this.rebindTextures = rebindTextures;
|
|
12593
|
-
this.uploadTexture = uploadTexture;
|
|
12594
12269
|
this.setupRenderTarget = setupRenderTarget;
|
|
12595
12270
|
this.updateRenderTargetMipmap = updateRenderTargetMipmap;
|
|
12596
12271
|
this.updateMultisampleRenderTarget = updateMultisampleRenderTarget;
|
|
12597
|
-
this.setupDepthTexture = setupDepthTexture;
|
|
12598
12272
|
this.setupDepthRenderbuffer = setupDepthRenderbuffer;
|
|
12599
12273
|
this.setupFrameBufferTexture = setupFrameBufferTexture;
|
|
12600
12274
|
this.useMultisampledRTT = useMultisampledRTT;
|
|
12601
|
-
this.runDeferredUploads = runDeferredUploads;
|
|
12602
|
-
this.setDeferTextureUploads = setDeferTextureUploads;
|
|
12603
12275
|
|
|
12604
12276
|
}
|
|
12605
12277
|
|
|
@@ -12812,39 +12484,6 @@ function WebGLUtils( gl, extensions ) {
|
|
|
12812
12484
|
|
|
12813
12485
|
}
|
|
12814
12486
|
|
|
12815
|
-
/**
|
|
12816
|
-
* @author fernandojsg / http://fernandojsg.com
|
|
12817
|
-
* @author Takahiro https://github.com/takahirox
|
|
12818
|
-
*/
|
|
12819
|
-
|
|
12820
|
-
|
|
12821
|
-
class WebGLMultiviewRenderTarget extends WebGLRenderTarget {
|
|
12822
|
-
|
|
12823
|
-
constructor( width, height, numViews, options = {} ) {
|
|
12824
|
-
|
|
12825
|
-
super( width, height, options );
|
|
12826
|
-
|
|
12827
|
-
this.depthBuffer = false;
|
|
12828
|
-
this.stencilBuffer = false;
|
|
12829
|
-
|
|
12830
|
-
this.numViews = numViews;
|
|
12831
|
-
|
|
12832
|
-
}
|
|
12833
|
-
|
|
12834
|
-
copy( source ) {
|
|
12835
|
-
|
|
12836
|
-
super.copy( source );
|
|
12837
|
-
|
|
12838
|
-
this.numViews = source.numViews;
|
|
12839
|
-
|
|
12840
|
-
return this;
|
|
12841
|
-
|
|
12842
|
-
}
|
|
12843
|
-
|
|
12844
|
-
}
|
|
12845
|
-
|
|
12846
|
-
WebGLMultiviewRenderTarget.prototype.isWebGLMultiviewRenderTarget = true;
|
|
12847
|
-
|
|
12848
12487
|
const _occlusion_vertex = `
|
|
12849
12488
|
void main() {
|
|
12850
12489
|
|
|
@@ -12951,7 +12590,7 @@ class WebXRDepthSensing {
|
|
|
12951
12590
|
|
|
12952
12591
|
class WebXRManager extends EventDispatcher {
|
|
12953
12592
|
|
|
12954
|
-
constructor( renderer, gl
|
|
12593
|
+
constructor( renderer, gl ) {
|
|
12955
12594
|
|
|
12956
12595
|
super();
|
|
12957
12596
|
|
|
@@ -12960,7 +12599,6 @@ class WebXRManager extends EventDispatcher {
|
|
|
12960
12599
|
let session = null;
|
|
12961
12600
|
|
|
12962
12601
|
let framebufferScaleFactor = 1.0;
|
|
12963
|
-
var poseTarget = null;
|
|
12964
12602
|
|
|
12965
12603
|
let referenceSpace = null;
|
|
12966
12604
|
let referenceSpaceType = 'local-floor';
|
|
@@ -12969,8 +12607,6 @@ class WebXRManager extends EventDispatcher {
|
|
|
12969
12607
|
let customReferenceSpace = null;
|
|
12970
12608
|
|
|
12971
12609
|
let pose = null;
|
|
12972
|
-
var layers = [];
|
|
12973
|
-
|
|
12974
12610
|
let glBinding = null;
|
|
12975
12611
|
let glProjLayer = null;
|
|
12976
12612
|
let glBaseLayer = null;
|
|
@@ -13004,18 +12640,11 @@ class WebXRManager extends EventDispatcher {
|
|
|
13004
12640
|
let _currentDepthFar = null;
|
|
13005
12641
|
|
|
13006
12642
|
//
|
|
12643
|
+
|
|
13007
12644
|
this.cameraAutoUpdate = true;
|
|
13008
|
-
this.layersEnabled = false;
|
|
13009
12645
|
this.enabled = false;
|
|
13010
12646
|
|
|
13011
12647
|
this.isPresenting = false;
|
|
13012
|
-
this.isMultiview = false;
|
|
13013
|
-
|
|
13014
|
-
this.getCameraPose = function ( ) {
|
|
13015
|
-
|
|
13016
|
-
return pose;
|
|
13017
|
-
|
|
13018
|
-
};
|
|
13019
12648
|
|
|
13020
12649
|
this.getController = function ( index ) {
|
|
13021
12650
|
|
|
@@ -13184,12 +12813,6 @@ class WebXRManager extends EventDispatcher {
|
|
|
13184
12813
|
|
|
13185
12814
|
};
|
|
13186
12815
|
|
|
13187
|
-
this.getRenderTarget = function () {
|
|
13188
|
-
|
|
13189
|
-
return newRenderTarget;
|
|
13190
|
-
|
|
13191
|
-
};
|
|
13192
|
-
|
|
13193
12816
|
this.getFrame = function () {
|
|
13194
12817
|
|
|
13195
12818
|
return xrFrame;
|
|
@@ -13274,20 +12897,12 @@ class WebXRManager extends EventDispatcher {
|
|
|
13274
12897
|
|
|
13275
12898
|
}
|
|
13276
12899
|
|
|
13277
|
-
scope.isMultiview = useMultiview && extensions.has( 'OCULUS_multiview' );
|
|
13278
|
-
|
|
13279
12900
|
const projectionlayerInit = {
|
|
13280
12901
|
colorFormat: gl.RGBA8,
|
|
13281
12902
|
depthFormat: glDepthFormat,
|
|
13282
12903
|
scaleFactor: framebufferScaleFactor
|
|
13283
12904
|
};
|
|
13284
12905
|
|
|
13285
|
-
if ( scope.isMultiview ) {
|
|
13286
|
-
|
|
13287
|
-
projectionlayerInit.textureType = 'texture-array';
|
|
13288
|
-
|
|
13289
|
-
}
|
|
13290
|
-
|
|
13291
12906
|
glBinding = new XRWebGLBinding( session, gl );
|
|
13292
12907
|
|
|
13293
12908
|
glProjLayer = glBinding.createProjectionLayer( projectionlayerInit );
|
|
@@ -13297,32 +12912,18 @@ class WebXRManager extends EventDispatcher {
|
|
|
13297
12912
|
renderer.setPixelRatio( 1 );
|
|
13298
12913
|
renderer.setSize( glProjLayer.textureWidth, glProjLayer.textureHeight, false );
|
|
13299
12914
|
|
|
13300
|
-
|
|
13301
|
-
|
|
13302
|
-
|
|
13303
|
-
|
|
13304
|
-
|
|
13305
|
-
|
|
13306
|
-
|
|
13307
|
-
|
|
13308
|
-
|
|
13309
|
-
|
|
13310
|
-
|
|
13311
|
-
|
|
13312
|
-
const extension = extensions.get( 'OCULUS_multiview' );
|
|
13313
|
-
|
|
13314
|
-
this.maxNumViews = gl.getParameter( extension.MAX_VIEWS_OVR );
|
|
13315
|
-
|
|
13316
|
-
newRenderTarget = new WebGLMultiviewRenderTarget( glProjLayer.textureWidth, glProjLayer.textureHeight, 2, renderTargetOptions );
|
|
13317
|
-
|
|
13318
|
-
} else {
|
|
13319
|
-
|
|
13320
|
-
newRenderTarget = new WebGLRenderTarget(
|
|
13321
|
-
glProjLayer.textureWidth,
|
|
13322
|
-
glProjLayer.textureHeight,
|
|
13323
|
-
renderTargetOptions );
|
|
13324
|
-
|
|
13325
|
-
}
|
|
12915
|
+
newRenderTarget = new WebGLRenderTarget(
|
|
12916
|
+
glProjLayer.textureWidth,
|
|
12917
|
+
glProjLayer.textureHeight,
|
|
12918
|
+
{
|
|
12919
|
+
format: RGBAFormat,
|
|
12920
|
+
type: UnsignedByteType,
|
|
12921
|
+
depthTexture: new DepthTexture( glProjLayer.textureWidth, glProjLayer.textureHeight, depthType, undefined, undefined, undefined, undefined, undefined, undefined, depthFormat ),
|
|
12922
|
+
stencilBuffer: attributes.stencil,
|
|
12923
|
+
colorSpace: renderer.outputColorSpace,
|
|
12924
|
+
samples: attributes.antialias ? 4 : 0,
|
|
12925
|
+
resolveDepthBuffer: ( glProjLayer.ignoreDepthValues === false )
|
|
12926
|
+
} );
|
|
13326
12927
|
|
|
13327
12928
|
}
|
|
13328
12929
|
|
|
@@ -13351,28 +12952,7 @@ class WebXRManager extends EventDispatcher {
|
|
|
13351
12952
|
return session.environmentBlendMode;
|
|
13352
12953
|
|
|
13353
12954
|
}
|
|
13354
|
-
};
|
|
13355
|
-
|
|
13356
|
-
this.addLayer = function(layer) {
|
|
13357
|
-
if (!window.XRWebGLBinding || !this.layersEnabled || !session) { return; }
|
|
13358
12955
|
|
|
13359
|
-
layers.push( layer );
|
|
13360
|
-
this.updateLayers();
|
|
13361
|
-
};
|
|
13362
|
-
|
|
13363
|
-
this.removeLayer = function(layer) {
|
|
13364
|
-
|
|
13365
|
-
layers.splice( layers.indexOf(layer), 1 );
|
|
13366
|
-
if (!window.XRWebGLBinding || !this.layersEnabled || !session) { return; }
|
|
13367
|
-
|
|
13368
|
-
this.updateLayers();
|
|
13369
|
-
};
|
|
13370
|
-
|
|
13371
|
-
this.updateLayers = function() {
|
|
13372
|
-
var layersCopy = layers.map(function (x) { return x; });
|
|
13373
|
-
|
|
13374
|
-
layersCopy.unshift( session.renderState.layers[0] );
|
|
13375
|
-
session.updateRenderState( { layers: layersCopy } );
|
|
13376
12956
|
};
|
|
13377
12957
|
|
|
13378
12958
|
this.getDepthTexture = function () {
|
|
@@ -13541,12 +13121,6 @@ class WebXRManager extends EventDispatcher {
|
|
|
13541
13121
|
|
|
13542
13122
|
}
|
|
13543
13123
|
|
|
13544
|
-
this.setPoseTarget = function ( object ) {
|
|
13545
|
-
|
|
13546
|
-
if ( object !== undefined ) poseTarget = object;
|
|
13547
|
-
|
|
13548
|
-
};
|
|
13549
|
-
|
|
13550
13124
|
this.updateCamera = function ( camera ) {
|
|
13551
13125
|
|
|
13552
13126
|
if ( session === null ) return;
|
|
@@ -13582,9 +13156,8 @@ class WebXRManager extends EventDispatcher {
|
|
|
13582
13156
|
cameraR.layers.mask = camera.layers.mask | 0b100;
|
|
13583
13157
|
cameraXR.layers.mask = cameraL.layers.mask | cameraR.layers.mask;
|
|
13584
13158
|
|
|
13159
|
+
const parent = camera.parent;
|
|
13585
13160
|
const cameras = cameraXR.cameras;
|
|
13586
|
-
var object = poseTarget || camera;
|
|
13587
|
-
const parent = object.parent;
|
|
13588
13161
|
|
|
13589
13162
|
updateCamera( cameraXR, parent );
|
|
13590
13163
|
|
|
@@ -13608,28 +13181,28 @@ class WebXRManager extends EventDispatcher {
|
|
|
13608
13181
|
|
|
13609
13182
|
}
|
|
13610
13183
|
|
|
13611
|
-
|
|
13184
|
+
// update user camera and its children
|
|
13612
13185
|
|
|
13613
|
-
|
|
13186
|
+
updateUserCamera( camera, cameraXR, parent );
|
|
13614
13187
|
|
|
13615
|
-
|
|
13188
|
+
};
|
|
13616
13189
|
|
|
13617
|
-
|
|
13190
|
+
function updateUserCamera( camera, cameraXR, parent ) {
|
|
13618
13191
|
|
|
13619
|
-
if (
|
|
13192
|
+
if ( parent === null ) {
|
|
13620
13193
|
|
|
13621
|
-
|
|
13194
|
+
camera.matrix.copy( cameraXR.matrixWorld );
|
|
13622
13195
|
|
|
13623
13196
|
} else {
|
|
13624
13197
|
|
|
13625
|
-
|
|
13626
|
-
|
|
13627
|
-
|
|
13198
|
+
camera.matrix.copy( parent.matrixWorld );
|
|
13199
|
+
camera.matrix.invert();
|
|
13200
|
+
camera.matrix.multiply( cameraXR.matrixWorld );
|
|
13628
13201
|
|
|
13629
13202
|
}
|
|
13630
13203
|
|
|
13631
|
-
|
|
13632
|
-
|
|
13204
|
+
camera.matrix.decompose( camera.position, camera.quaternion, camera.scale );
|
|
13205
|
+
camera.updateMatrixWorld( true );
|
|
13633
13206
|
|
|
13634
13207
|
camera.projectionMatrix.copy( cameraXR.projectionMatrix );
|
|
13635
13208
|
camera.projectionMatrixInverse.copy( cameraXR.projectionMatrixInverse );
|
|
@@ -14841,7 +14414,6 @@ class WebGLRenderer {
|
|
|
14841
14414
|
powerPreference = 'default',
|
|
14842
14415
|
failIfMajorPerformanceCaveat = false,
|
|
14843
14416
|
reverseDepthBuffer = false,
|
|
14844
|
-
multiviewStereo = false,
|
|
14845
14417
|
} = parameters;
|
|
14846
14418
|
|
|
14847
14419
|
this.isWebGLRenderer = true;
|
|
@@ -15049,7 +14621,6 @@ class WebGLRenderer {
|
|
|
15049
14621
|
let extensions, capabilities, state, info;
|
|
15050
14622
|
let properties, textures, cubemaps, cubeuvmaps, attributes, geometries, objects;
|
|
15051
14623
|
let programCache, materials, renderLists, renderStates, clipping, shadowMap;
|
|
15052
|
-
let multiview;
|
|
15053
14624
|
|
|
15054
14625
|
let background, morphtargets, bufferRenderer, indexedBufferRenderer;
|
|
15055
14626
|
|
|
@@ -15088,7 +14659,6 @@ class WebGLRenderer {
|
|
|
15088
14659
|
renderLists = new WebGLRenderLists();
|
|
15089
14660
|
renderStates = new WebGLRenderStates( extensions );
|
|
15090
14661
|
background = new WebGLBackground( _this, cubemaps, cubeuvmaps, state, objects, _alpha, premultipliedAlpha );
|
|
15091
|
-
multiview = new WebGLMultiview( _this, extensions, _gl );
|
|
15092
14662
|
shadowMap = new WebGLShadowMap( _this, objects, capabilities );
|
|
15093
14663
|
uniformsGroups = new WebGLUniformsGroups( _gl, info, capabilities, state );
|
|
15094
14664
|
|
|
@@ -16025,21 +15595,11 @@ class WebGLRenderer {
|
|
|
16025
15595
|
|
|
16026
15596
|
if ( _renderBackground ) background.render( scene );
|
|
16027
15597
|
|
|
16028
|
-
|
|
16029
|
-
|
|
16030
|
-
textures.setDeferTextureUploads( true );
|
|
16031
|
-
|
|
16032
|
-
renderScene( currentRenderList, scene, camera, camera.cameras[ 0 ].viewport );
|
|
16033
|
-
|
|
16034
|
-
} else {
|
|
16035
|
-
|
|
16036
|
-
for ( let i = 0, l = cameras.length; i < l; i ++ ) {
|
|
15598
|
+
for ( let i = 0, l = cameras.length; i < l; i ++ ) {
|
|
16037
15599
|
|
|
16038
|
-
|
|
15600
|
+
const camera2 = cameras[ i ];
|
|
16039
15601
|
|
|
16040
|
-
|
|
16041
|
-
|
|
16042
|
-
}
|
|
15602
|
+
renderScene( currentRenderList, scene, camera2, camera2.viewport );
|
|
16043
15603
|
|
|
16044
15604
|
}
|
|
16045
15605
|
|
|
@@ -16565,7 +16125,6 @@ class WebGLRenderer {
|
|
|
16565
16125
|
materialProperties.vertexAlphas = parameters.vertexAlphas;
|
|
16566
16126
|
materialProperties.vertexTangents = parameters.vertexTangents;
|
|
16567
16127
|
materialProperties.toneMapping = parameters.toneMapping;
|
|
16568
|
-
materialProperties.numMultiviewViews = parameters.numMultiviewViews;
|
|
16569
16128
|
|
|
16570
16129
|
}
|
|
16571
16130
|
|
|
@@ -16597,8 +16156,6 @@ class WebGLRenderer {
|
|
|
16597
16156
|
|
|
16598
16157
|
}
|
|
16599
16158
|
|
|
16600
|
-
const numMultiviewViews = _currentRenderTarget && _currentRenderTarget.isWebGLMultiviewRenderTarget ? _currentRenderTarget.numViews : 0;
|
|
16601
|
-
|
|
16602
16159
|
const morphAttribute = geometry.morphAttributes.position || geometry.morphAttributes.normal || geometry.morphAttributes.color;
|
|
16603
16160
|
const morphTargetsCount = ( morphAttribute !== undefined ) ? morphAttribute.length : 0;
|
|
16604
16161
|
|
|
@@ -16726,10 +16283,6 @@ class WebGLRenderer {
|
|
|
16726
16283
|
|
|
16727
16284
|
needsProgramChange = true;
|
|
16728
16285
|
|
|
16729
|
-
} else if ( materialProperties.numMultiviewViews !== numMultiviewViews ) {
|
|
16730
|
-
|
|
16731
|
-
needsProgramChange = true;
|
|
16732
|
-
|
|
16733
16286
|
}
|
|
16734
16287
|
|
|
16735
16288
|
} else {
|
|
@@ -16776,34 +16329,25 @@ class WebGLRenderer {
|
|
|
16776
16329
|
|
|
16777
16330
|
// common camera uniforms
|
|
16778
16331
|
|
|
16779
|
-
|
|
16332
|
+
const reverseDepthBuffer = state.buffers.depth.getReversed();
|
|
16780
16333
|
|
|
16781
|
-
|
|
16782
|
-
multiview.updateCameraViewMatricesUniform( camera, p_uniforms );
|
|
16334
|
+
if ( reverseDepthBuffer ) {
|
|
16783
16335
|
|
|
16784
|
-
|
|
16785
|
-
|
|
16786
|
-
const reverseDepthBuffer = state.buffers.depth.getReversed();
|
|
16787
|
-
|
|
16788
|
-
if ( reverseDepthBuffer ) {
|
|
16336
|
+
_currentProjectionMatrix.copy( camera.projectionMatrix );
|
|
16789
16337
|
|
|
16790
|
-
|
|
16338
|
+
toNormalizedProjectionMatrix( _currentProjectionMatrix );
|
|
16339
|
+
toReversedProjectionMatrix( _currentProjectionMatrix );
|
|
16791
16340
|
|
|
16792
|
-
|
|
16793
|
-
toReversedProjectionMatrix( _currentProjectionMatrix );
|
|
16341
|
+
p_uniforms.setValue( _gl, 'projectionMatrix', _currentProjectionMatrix );
|
|
16794
16342
|
|
|
16795
|
-
|
|
16796
|
-
|
|
16797
|
-
} else {
|
|
16798
|
-
|
|
16799
|
-
p_uniforms.setValue( _gl, 'projectionMatrix', camera.projectionMatrix );
|
|
16800
|
-
|
|
16801
|
-
}
|
|
16343
|
+
} else {
|
|
16802
16344
|
|
|
16803
|
-
p_uniforms.setValue( _gl, '
|
|
16345
|
+
p_uniforms.setValue( _gl, 'projectionMatrix', camera.projectionMatrix );
|
|
16804
16346
|
|
|
16805
16347
|
}
|
|
16806
16348
|
|
|
16349
|
+
p_uniforms.setValue( _gl, 'viewMatrix', camera.matrixWorldInverse );
|
|
16350
|
+
|
|
16807
16351
|
const uCamPos = p_uniforms.map.cameraPosition;
|
|
16808
16352
|
|
|
16809
16353
|
if ( uCamPos !== undefined ) {
|
|
@@ -16964,17 +16508,8 @@ class WebGLRenderer {
|
|
|
16964
16508
|
|
|
16965
16509
|
// common matrices
|
|
16966
16510
|
|
|
16967
|
-
|
|
16968
|
-
|
|
16969
|
-
multiview.updateObjectMatricesUniforms( object, camera, p_uniforms );
|
|
16970
|
-
|
|
16971
|
-
} else {
|
|
16972
|
-
|
|
16973
|
-
p_uniforms.setValue( _gl, 'modelViewMatrix', object.modelViewMatrix );
|
|
16974
|
-
p_uniforms.setValue( _gl, 'normalMatrix', object.normalMatrix );
|
|
16975
|
-
|
|
16976
|
-
}
|
|
16977
|
-
|
|
16511
|
+
p_uniforms.setValue( _gl, 'modelViewMatrix', object.modelViewMatrix );
|
|
16512
|
+
p_uniforms.setValue( _gl, 'normalMatrix', object.normalMatrix );
|
|
16978
16513
|
p_uniforms.setValue( _gl, 'modelMatrix', object.matrixWorld );
|
|
16979
16514
|
|
|
16980
16515
|
// UBOs
|
|
@@ -17024,32 +16559,6 @@ class WebGLRenderer {
|
|
|
17024
16559
|
|
|
17025
16560
|
}
|
|
17026
16561
|
|
|
17027
|
-
this.setTexture2D = ( function () {
|
|
17028
|
-
|
|
17029
|
-
var warned = false;
|
|
17030
|
-
|
|
17031
|
-
// backwards compatibility: peel texture.texture
|
|
17032
|
-
return function setTexture2D( texture, slot ) {
|
|
17033
|
-
|
|
17034
|
-
if ( texture && texture.isWebGLRenderTarget ) {
|
|
17035
|
-
|
|
17036
|
-
if ( ! warned ) {
|
|
17037
|
-
|
|
17038
|
-
console.warn( "THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead." );
|
|
17039
|
-
warned = true;
|
|
17040
|
-
|
|
17041
|
-
}
|
|
17042
|
-
|
|
17043
|
-
texture = texture.texture;
|
|
17044
|
-
|
|
17045
|
-
}
|
|
17046
|
-
|
|
17047
|
-
textures.setTexture2D( texture, slot );
|
|
17048
|
-
|
|
17049
|
-
};
|
|
17050
|
-
|
|
17051
|
-
}() );
|
|
17052
|
-
|
|
17053
16562
|
this.getActiveCubeFace = function () {
|
|
17054
16563
|
|
|
17055
16564
|
return _currentActiveCubeFace;
|
|
@@ -17078,7 +16587,7 @@ class WebGLRenderer {
|
|
|
17078
16587
|
|
|
17079
16588
|
renderTargetProperties.__autoAllocateDepthBuffer = depthTexture === undefined;
|
|
17080
16589
|
|
|
17081
|
-
if ( ! renderTargetProperties.__autoAllocateDepthBuffer
|
|
16590
|
+
if ( ! renderTargetProperties.__autoAllocateDepthBuffer ) {
|
|
17082
16591
|
|
|
17083
16592
|
// The multisample_render_to_texture extension doesn't work properly if there
|
|
17084
16593
|
// are midframe flushes and an external depth buffer. Disable use of the extension.
|
|
@@ -17104,13 +16613,6 @@ class WebGLRenderer {
|
|
|
17104
16613
|
const _scratchFrameBuffer = _gl.createFramebuffer();
|
|
17105
16614
|
this.setRenderTarget = function ( renderTarget, activeCubeFace = 0, activeMipmapLevel = 0 ) {
|
|
17106
16615
|
|
|
17107
|
-
// Render to base layer instead of canvas in WebXR
|
|
17108
|
-
if ( renderTarget === null && this.xr.isPresenting ) {
|
|
17109
|
-
|
|
17110
|
-
renderTarget = this.xr.getRenderTarget();
|
|
17111
|
-
|
|
17112
|
-
}
|
|
17113
|
-
|
|
17114
16616
|
_currentRenderTarget = renderTarget;
|
|
17115
16617
|
_currentActiveCubeFace = activeCubeFace;
|
|
17116
16618
|
_currentActiveMipmapLevel = activeMipmapLevel;
|