super-three 0.161.0 → 0.163.0
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 +822 -1332
- package/build/three.module.js +820 -1328
- package/build/three.module.min.js +1 -1
- package/examples/jsm/controls/DragControls.js +91 -30
- package/examples/jsm/controls/OrbitControls.js +32 -6
- package/examples/jsm/controls/TransformControls.js +9 -9
- package/examples/jsm/exporters/GLTFExporter.js +30 -3
- package/examples/jsm/exporters/USDZExporter.js +15 -0
- package/examples/jsm/geometries/TextGeometry.js +10 -2
- package/examples/jsm/interactive/HTMLMesh.js +7 -9
- package/examples/jsm/interactive/InteractiveGroup.js +15 -25
- package/examples/jsm/libs/fflate.module.js +694 -496
- package/examples/jsm/libs/rhino3dm/rhino3dm.js +1 -8723
- package/examples/jsm/libs/rhino3dm/rhino3dm.module.js +1 -8734
- package/examples/jsm/libs/rhino3dm/rhino3dm.wasm +0 -0
- package/examples/jsm/libs/tween.module.js +32 -14
- package/examples/jsm/lines/LineMaterial.js +0 -2
- package/examples/jsm/loaders/3DMLoader.js +13 -21
- package/examples/jsm/loaders/3MFLoader.js +2 -0
- package/examples/jsm/loaders/EXRLoader.js +89 -19
- package/examples/jsm/loaders/FBXLoader.js +1 -1
- package/examples/jsm/loaders/GLTFLoader.js +6 -0
- package/examples/jsm/loaders/KTX2Loader.js +2 -6
- package/examples/jsm/loaders/LUT3dlLoader.js +0 -15
- package/examples/jsm/loaders/LUTCubeLoader.js +0 -14
- package/examples/jsm/loaders/LUTImageLoader.js +0 -14
- package/examples/jsm/loaders/RGBMLoader.js +16 -0
- package/examples/jsm/loaders/VOXLoader.js +9 -2
- package/examples/jsm/loaders/VRMLLoader.js +6 -2
- package/examples/jsm/misc/GPUComputationRenderer.js +0 -6
- package/examples/jsm/misc/ProgressiveLightMap.js +1 -0
- package/examples/jsm/nodes/Nodes.js +15 -8
- package/examples/jsm/nodes/accessors/AccessorsUtils.js +10 -0
- package/examples/jsm/nodes/accessors/BatchNode.js +78 -0
- package/examples/jsm/nodes/accessors/ClippingNode.js +144 -0
- package/examples/jsm/nodes/accessors/InstanceNode.js +25 -2
- package/examples/jsm/nodes/accessors/MaterialNode.js +2 -2
- package/examples/jsm/nodes/accessors/MaterialReferenceNode.js +2 -12
- package/examples/jsm/nodes/accessors/MorphNode.js +20 -10
- package/examples/jsm/nodes/accessors/NormalNode.js +12 -2
- package/examples/jsm/nodes/accessors/ReferenceNode.js +87 -29
- package/examples/jsm/nodes/accessors/RendererReferenceNode.js +29 -0
- package/examples/jsm/nodes/accessors/SkinningNode.js +31 -10
- package/examples/jsm/nodes/accessors/StorageBufferNode.js +18 -0
- package/examples/jsm/nodes/accessors/TangentNode.js +8 -2
- package/examples/jsm/nodes/accessors/TextureNode.js +30 -7
- package/examples/jsm/nodes/accessors/UniformsNode.js +140 -0
- package/examples/jsm/nodes/code/CodeNode.js +6 -0
- package/examples/jsm/nodes/core/AssignNode.js +68 -12
- package/examples/jsm/nodes/core/Node.js +67 -6
- package/examples/jsm/nodes/core/NodeBuilder.js +23 -24
- package/examples/jsm/nodes/core/NodeFrame.js +8 -8
- package/examples/jsm/nodes/core/NodeUtils.js +2 -2
- package/examples/jsm/nodes/core/TempNode.js +1 -1
- package/examples/jsm/nodes/core/UniformNode.js +20 -0
- package/examples/jsm/nodes/display/BlendModeNode.js +30 -1
- package/examples/jsm/nodes/display/NormalMapNode.js +3 -5
- package/examples/jsm/nodes/display/PassNode.js +17 -1
- package/examples/jsm/nodes/display/ToneMappingNode.js +8 -4
- package/examples/jsm/nodes/display/ViewportSharedTextureNode.js +6 -0
- package/examples/jsm/nodes/fog/FogExp2Node.js +4 -5
- package/examples/jsm/nodes/fog/FogNode.js +13 -3
- package/examples/jsm/nodes/fog/FogRangeNode.js +4 -3
- package/examples/jsm/nodes/lighting/AnalyticLightNode.js +1 -1
- package/examples/jsm/nodes/lighting/EnvironmentNode.js +12 -69
- package/examples/jsm/nodes/materials/NodeMaterial.js +70 -17
- package/examples/jsm/nodes/math/CondNode.js +42 -7
- package/examples/jsm/nodes/math/MathNode.js +20 -0
- package/examples/jsm/nodes/pmrem/PMREMNode.js +193 -0
- package/examples/jsm/nodes/pmrem/PMREMUtils.js +288 -0
- package/examples/jsm/nodes/shadernode/ShaderNode.js +1 -1
- package/examples/jsm/nodes/utils/ArrayElementNode.js +0 -6
- package/examples/jsm/nodes/utils/EquirectUVNode.js +1 -1
- package/examples/jsm/nodes/utils/LoopNode.js +2 -0
- package/examples/jsm/nodes/utils/StorageArrayElementNode.js +91 -0
- package/examples/jsm/objects/QuadMesh.js +7 -23
- package/examples/jsm/physics/RapierPhysics.js +4 -4
- package/examples/jsm/postprocessing/GlitchPass.js +0 -3
- package/examples/jsm/postprocessing/LUTPass.js +5 -71
- package/examples/jsm/postprocessing/OutputPass.js +2 -0
- package/examples/jsm/postprocessing/SAOPass.js +0 -1
- package/examples/jsm/postprocessing/SSAOPass.js +0 -3
- package/examples/jsm/renderers/common/Animation.js +3 -0
- package/examples/jsm/renderers/common/Background.js +3 -3
- package/examples/jsm/renderers/common/ClippingContext.js +165 -0
- package/examples/jsm/renderers/common/Info.js +11 -19
- package/examples/jsm/renderers/common/PostProcessing.js +12 -4
- package/examples/jsm/renderers/common/RenderContext.js +3 -1
- package/examples/jsm/renderers/common/RenderContexts.js +2 -13
- package/examples/jsm/renderers/common/RenderObject.js +46 -3
- package/examples/jsm/renderers/common/RenderObjects.js +2 -0
- package/examples/jsm/renderers/common/Renderer.js +113 -39
- package/examples/jsm/renderers/common/StorageBufferAttribute.js +2 -2
- package/examples/jsm/renderers/common/StorageInstancedBufferAttribute.js +17 -0
- package/examples/jsm/renderers/common/Textures.js +3 -13
- package/examples/jsm/renderers/common/UniformsGroup.js +6 -4
- package/examples/jsm/renderers/common/extras/PMREMGenerator.js +777 -0
- package/examples/jsm/renderers/common/nodes/NodeStorageBuffer.js +23 -0
- package/examples/jsm/renderers/common/nodes/NodeUniformBuffer.js +23 -0
- package/examples/jsm/renderers/common/nodes/Nodes.js +6 -18
- package/examples/jsm/renderers/webgl/WebGLBackend.js +174 -30
- package/examples/jsm/renderers/webgl/WebGLBufferRenderer.js +141 -0
- package/examples/jsm/renderers/webgl/nodes/GLSLNodeBuilder.js +136 -11
- package/examples/jsm/renderers/webgl/utils/WebGLAttributeUtils.js +8 -2
- package/examples/jsm/renderers/webgl/utils/WebGLConstants.js +1 -0
- package/examples/jsm/renderers/webgl/utils/WebGLTextureUtils.js +90 -0
- package/examples/jsm/renderers/webgl/utils/WebGLUtils.js +3 -1
- package/examples/jsm/renderers/webgl-legacy/nodes/GLSL1NodeBuilder.js +0 -2
- package/examples/jsm/renderers/webgl-legacy/nodes/WebGLNodeBuilder.js +0 -2
- package/examples/jsm/renderers/webgpu/WebGPUBackend.js +67 -37
- package/examples/jsm/renderers/webgpu/nodes/WGSLNodeBuilder.js +20 -43
- package/examples/jsm/renderers/webgpu/utils/WebGPUAttributeUtils.js +32 -1
- package/examples/jsm/renderers/webgpu/utils/WebGPUBindingUtils.js +18 -4
- package/examples/jsm/renderers/webgpu/utils/WebGPUTextureUtils.js +94 -20
- package/examples/jsm/shaders/OutputShader.js +4 -0
- package/examples/jsm/utils/GPUStatsPanel.js +10 -45
- package/examples/jsm/utils/SkeletonUtils.js +14 -3
- package/examples/jsm/utils/TextureUtils.js +1 -1
- package/examples/jsm/webxr/VRButton.js +13 -5
- package/examples/jsm/webxr/XRButton.js +0 -1
- package/examples/jsm/webxr/XRControllerModelFactory.js +8 -0
- package/package.json +4 -3
- package/src/Three.Legacy.js +20 -0
- package/src/Three.js +0 -2
- package/src/animation/AnimationClip.js +1 -1
- package/src/constants.js +4 -7
- package/src/core/BufferAttribute.js +0 -11
- package/src/core/BufferGeometry.js +23 -29
- package/src/core/Object3D.js +21 -7
- package/src/core/Raycaster.js +18 -4
- package/src/core/RenderTarget.js +44 -21
- package/src/extras/PMREMGenerator.js +11 -0
- package/src/extras/curves/EllipseCurve.js +2 -2
- package/src/helpers/SpotLightHelper.js +18 -1
- package/src/loaders/DataTextureLoader.js +0 -4
- package/src/loaders/MaterialLoader.js +1 -0
- package/src/loaders/ObjectLoader.js +4 -1
- package/src/materials/Material.js +2 -1
- package/src/materials/MeshBasicMaterial.js +3 -0
- package/src/materials/MeshLambertMaterial.js +3 -0
- package/src/materials/MeshPhongMaterial.js +3 -0
- package/src/materials/MeshStandardMaterial.js +3 -0
- package/src/materials/ShaderMaterial.js +0 -4
- package/src/math/Quaternion.js +13 -12
- package/src/math/Spherical.js +4 -5
- package/src/math/Vector3.js +7 -7
- package/src/objects/BatchedMesh.js +4 -3
- package/src/objects/InstancedMesh.js +63 -0
- package/src/objects/Mesh.js +0 -1
- package/src/renderers/WebGLCubeRenderTarget.js +1 -10
- package/src/renderers/WebGLRenderer.js +70 -136
- package/src/renderers/shaders/ShaderChunk/envmap_common_pars_fragment.glsl.js +1 -0
- package/src/renderers/shaders/ShaderChunk/envmap_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/envmap_physical_pars_fragment.glsl.js +2 -2
- package/src/renderers/shaders/ShaderChunk/logdepthbuf_fragment.glsl.js +2 -2
- package/src/renderers/shaders/ShaderChunk/logdepthbuf_pars_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/logdepthbuf_pars_vertex.glsl.js +2 -10
- package/src/renderers/shaders/ShaderChunk/logdepthbuf_vertex.glsl.js +2 -16
- package/src/renderers/shaders/ShaderChunk/map_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/morphinstance_vertex.glsl.js +14 -0
- package/src/renderers/shaders/ShaderChunk/morphtarget_pars_vertex.glsl.js +11 -2
- package/src/renderers/shaders/ShaderChunk/shadowmap_pars_fragment.glsl.js +32 -22
- package/src/renderers/shaders/ShaderChunk/tonemapping_pars_fragment.glsl.js +23 -0
- package/src/renderers/shaders/ShaderChunk.js +2 -0
- package/src/renderers/shaders/ShaderLib/backgroundCube.glsl.js +3 -2
- package/src/renderers/shaders/ShaderLib/depth.glsl.js +2 -0
- package/src/renderers/shaders/ShaderLib/distanceRGBA.glsl.js +2 -0
- package/src/renderers/shaders/ShaderLib/linedashed.glsl.js +1 -0
- package/src/renderers/shaders/ShaderLib/meshbasic.glsl.js +1 -0
- package/src/renderers/shaders/ShaderLib/meshlambert.glsl.js +1 -0
- package/src/renderers/shaders/ShaderLib/meshmatcap.glsl.js +1 -0
- package/src/renderers/shaders/ShaderLib/meshnormal.glsl.js +1 -0
- package/src/renderers/shaders/ShaderLib/meshphong.glsl.js +1 -0
- package/src/renderers/shaders/ShaderLib/meshphysical.glsl.js +1 -0
- package/src/renderers/shaders/ShaderLib/meshtoon.glsl.js +1 -0
- package/src/renderers/shaders/ShaderLib/points.glsl.js +1 -0
- package/src/renderers/shaders/ShaderLib/shadow.glsl.js +1 -0
- package/src/renderers/shaders/ShaderLib.js +3 -2
- package/src/renderers/shaders/UniformsLib.js +1 -0
- package/src/renderers/shaders/UniformsUtils.js +10 -1
- package/src/renderers/webgl/WebGLAttributes.js +6 -33
- package/src/renderers/webgl/WebGLBackground.js +18 -0
- package/src/renderers/webgl/WebGLBindingStates.js +14 -51
- package/src/renderers/webgl/WebGLBufferRenderer.js +3 -25
- package/src/renderers/webgl/WebGLCapabilities.js +2 -12
- package/src/renderers/webgl/WebGLCubeUVMaps.js +10 -6
- package/src/renderers/webgl/WebGLExtensions.js +4 -19
- package/src/renderers/webgl/WebGLIndexedBufferRenderer.js +3 -25
- package/src/renderers/webgl/WebGLLights.js +6 -32
- package/src/renderers/webgl/WebGLMaterials.js +26 -4
- package/src/renderers/webgl/WebGLMorphtargets.js +79 -210
- package/src/renderers/webgl/WebGLProgram.js +30 -48
- package/src/renderers/webgl/WebGLPrograms.js +5 -14
- package/src/renderers/webgl/WebGLRenderStates.js +8 -6
- package/src/renderers/webgl/WebGLState.js +21 -75
- package/src/renderers/webgl/WebGLTextures.js +143 -275
- package/src/renderers/webgl/WebGLUniformsGroups.js +1 -1
- package/src/renderers/webgl/WebGLUtils.js +6 -57
- package/src/renderers/webxr/WebXRDepthSensing.js +2 -3
- package/src/renderers/webxr/WebXRManager.js +2 -2
- package/src/scenes/Scene.js +14 -0
- package/src/textures/Texture.js +6 -24
- package/examples/jsm/nodes/core/ArrayUniformNode.js +0 -26
- package/examples/jsm/nodes/utils/SpecularMIPLevelNode.js +0 -37
- package/src/renderers/WebGL1Renderer.js +0 -7
- package/src/renderers/WebGLMultipleRenderTargets.js +0 -82
|
@@ -5,9 +5,8 @@ import NodeUniformsGroup from '../../common/nodes/NodeUniformsGroup.js';
|
|
|
5
5
|
import NodeSampler from '../../common/nodes/NodeSampler.js';
|
|
6
6
|
import { NodeSampledTexture, NodeSampledCubeTexture } from '../../common/nodes/NodeSampledTexture.js';
|
|
7
7
|
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { getVectorLength, getStrideLength } from '../../common/BufferUtils.js';
|
|
8
|
+
import NodeUniformBuffer from '../../common/nodes/NodeUniformBuffer.js';
|
|
9
|
+
import NodeStorageBuffer from '../../common/nodes/NodeStorageBuffer.js';
|
|
11
10
|
|
|
12
11
|
import { NodeBuilder, CodeNode } from '../../../nodes/Nodes.js';
|
|
13
12
|
|
|
@@ -78,6 +77,10 @@ const wgslMethods = {
|
|
|
78
77
|
mod_vec2: 'threejs_mod_vec2',
|
|
79
78
|
mod_vec3: 'threejs_mod_vec3',
|
|
80
79
|
mod_vec4: 'threejs_mod_vec4',
|
|
80
|
+
equals_bool: 'threejs_equals_bool',
|
|
81
|
+
equals_bvec2: 'threejs_equals_bvec2',
|
|
82
|
+
equals_bvec3: 'threejs_equals_bvec3',
|
|
83
|
+
equals_bvec4: 'threejs_equals_bvec4',
|
|
81
84
|
lessThanEqual: 'threejs_lessThanEqual',
|
|
82
85
|
greaterThan: 'threejs_greaterThan',
|
|
83
86
|
inversesqrt: 'inverseSqrt',
|
|
@@ -110,6 +113,10 @@ fn threejs_greaterThan( a : vec3<f32>, b : vec3<f32> ) -> vec3<bool> {
|
|
|
110
113
|
mod_vec2: new CodeNode( 'fn threejs_mod_vec2( x : vec2f, y : vec2f ) -> vec2f { return x - y * floor( x / y ); }' ),
|
|
111
114
|
mod_vec3: new CodeNode( 'fn threejs_mod_vec3( x : vec3f, y : vec3f ) -> vec3f { return x - y * floor( x / y ); }' ),
|
|
112
115
|
mod_vec4: new CodeNode( 'fn threejs_mod_vec4( x : vec4f, y : vec4f ) -> vec4f { return x - y * floor( x / y ); }' ),
|
|
116
|
+
equals_bool: new CodeNode( 'fn threejs_equals_bool( a : bool, b : bool ) -> bool { return a == b; }' ),
|
|
117
|
+
equals_bvec2: new CodeNode( 'fn threejs_equals_bvec2( a : vec2f, b : vec2f ) -> vec2<bool> { return vec2<bool>( a.x == b.x, a.y == b.y ); }' ),
|
|
118
|
+
equals_bvec3: new CodeNode( 'fn threejs_equals_bvec3( a : vec3f, b : vec3f ) -> vec3<bool> { return vec3<bool>( a.x == b.x, a.y == b.y, a.z == b.z ); }' ),
|
|
119
|
+
equals_bvec4: new CodeNode( 'fn threejs_equals_bvec4( a : vec4f, b : vec4f ) -> vec4<bool> { return vec4<bool>( a.x == b.x, a.y == b.y, a.z == b.z, a.w == b.w ); }' ),
|
|
113
120
|
repeatWrapping: new CodeNode( `
|
|
114
121
|
fn threejs_repeatWrapping( uv : vec2<f32>, dimension : vec2<u32> ) -> vec2<u32> {
|
|
115
122
|
|
|
@@ -221,7 +228,7 @@ class WGSLNodeBuilder extends NodeBuilder {
|
|
|
221
228
|
|
|
222
229
|
isUnfilterable( texture ) {
|
|
223
230
|
|
|
224
|
-
return texture.isDataTexture === true && texture.type === FloatType;
|
|
231
|
+
return this.getComponentTypeFromTexture( texture ) !== 'float' || ( texture.isDataTexture === true && texture.type === FloatType );
|
|
225
232
|
|
|
226
233
|
}
|
|
227
234
|
|
|
@@ -383,8 +390,8 @@ class WGSLNodeBuilder extends NodeBuilder {
|
|
|
383
390
|
|
|
384
391
|
} else if ( type === 'buffer' || type === 'storageBuffer' ) {
|
|
385
392
|
|
|
386
|
-
const bufferClass = type === 'storageBuffer' ?
|
|
387
|
-
const buffer = new bufferClass(
|
|
393
|
+
const bufferClass = type === 'storageBuffer' ? NodeStorageBuffer : NodeUniformBuffer;
|
|
394
|
+
const buffer = new bufferClass( node );
|
|
388
395
|
buffer.setVisibility( gpuShaderStageLib[ shaderStage ] );
|
|
389
396
|
|
|
390
397
|
bindings.push( buffer );
|
|
@@ -411,31 +418,9 @@ class WGSLNodeBuilder extends NodeBuilder {
|
|
|
411
418
|
|
|
412
419
|
}
|
|
413
420
|
|
|
414
|
-
|
|
421
|
+
uniformGPU = this.getNodeUniform( uniformNode, type );
|
|
415
422
|
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
for ( const uniformNode of node.nodes ) {
|
|
419
|
-
|
|
420
|
-
const uniformNodeGPU = this.getNodeUniform( uniformNode, type );
|
|
421
|
-
|
|
422
|
-
// fit bounds to buffer
|
|
423
|
-
uniformNodeGPU.boundary = getVectorLength( uniformNodeGPU.itemSize );
|
|
424
|
-
uniformNodeGPU.itemSize = getStrideLength( uniformNodeGPU.itemSize );
|
|
425
|
-
|
|
426
|
-
uniformsGroup.addUniform( uniformNodeGPU );
|
|
427
|
-
|
|
428
|
-
uniformGPU.push( uniformNodeGPU );
|
|
429
|
-
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
} else {
|
|
433
|
-
|
|
434
|
-
uniformGPU = this.getNodeUniform( uniformNode, type );
|
|
435
|
-
|
|
436
|
-
uniformsGroup.addUniform( uniformGPU );
|
|
437
|
-
|
|
438
|
-
}
|
|
423
|
+
uniformsGroup.addUniform( uniformGPU );
|
|
439
424
|
|
|
440
425
|
}
|
|
441
426
|
|
|
@@ -774,11 +759,13 @@ ${ flowData.code }
|
|
|
774
759
|
|
|
775
760
|
const format = getFormat( texture );
|
|
776
761
|
|
|
777
|
-
textureType =
|
|
762
|
+
textureType = `texture_storage_2d<${ format }, write>`;
|
|
778
763
|
|
|
779
764
|
} else {
|
|
780
765
|
|
|
781
|
-
|
|
766
|
+
const componentPrefix = this.getComponentTypeFromTexture( texture ).charAt( 0 );
|
|
767
|
+
|
|
768
|
+
textureType = `texture_2d<${ componentPrefix }32>`;
|
|
782
769
|
|
|
783
770
|
}
|
|
784
771
|
|
|
@@ -806,17 +793,7 @@ ${ flowData.code }
|
|
|
806
793
|
snippets: []
|
|
807
794
|
} );
|
|
808
795
|
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
const length = uniform.value.length;
|
|
812
|
-
|
|
813
|
-
group.snippets.push( `uniform ${vectorType}[ ${length} ] ${uniform.name}` );
|
|
814
|
-
|
|
815
|
-
} else {
|
|
816
|
-
|
|
817
|
-
group.snippets.push( `\t${uniform.name} : ${ vectorType}` );
|
|
818
|
-
|
|
819
|
-
}
|
|
796
|
+
group.snippets.push( `\t${ uniform.name } : ${ vectorType }` );
|
|
820
797
|
|
|
821
798
|
}
|
|
822
799
|
|
|
@@ -17,7 +17,9 @@ const typedAttributeToVertexFormatPrefix = new Map( [
|
|
|
17
17
|
|
|
18
18
|
const typeArraysToVertexFormatPrefixForItemSize1 = new Map( [
|
|
19
19
|
[ Int32Array, 'sint32' ],
|
|
20
|
+
[ Int16Array, 'sint32' ], // patch for INT16
|
|
20
21
|
[ Uint32Array, 'uint32' ],
|
|
22
|
+
[ Uint16Array, 'uint32' ], // patch for UINT16
|
|
21
23
|
[ Float32Array, 'float32' ]
|
|
22
24
|
] );
|
|
23
25
|
|
|
@@ -44,11 +46,33 @@ class WebGPUAttributeUtils {
|
|
|
44
46
|
|
|
45
47
|
let array = bufferAttribute.array;
|
|
46
48
|
|
|
47
|
-
|
|
49
|
+
// patch for INT16 and UINT16
|
|
50
|
+
if ( attribute.normalized === false && ( array.constructor === Int16Array || array.constructor === Uint16Array ) ) {
|
|
51
|
+
|
|
52
|
+
const tempArray = new Uint32Array( array.length );
|
|
53
|
+
for ( let i = 0; i < array.length; i ++ ) {
|
|
54
|
+
|
|
55
|
+
tempArray[ i ] = array[ i ];
|
|
56
|
+
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
array = tempArray;
|
|
60
|
+
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
bufferAttribute.array = array;
|
|
64
|
+
|
|
65
|
+
if ( ( bufferAttribute.isStorageBufferAttribute || bufferAttribute.isStorageInstancedBufferAttribute ) && bufferAttribute.itemSize === 3 ) {
|
|
48
66
|
|
|
49
67
|
bufferAttribute.itemSize = 4;
|
|
50
68
|
array = new array.constructor( bufferAttribute.count * 4 );
|
|
51
69
|
|
|
70
|
+
for ( let i = 0; i < bufferAttribute.count; i ++ ) {
|
|
71
|
+
|
|
72
|
+
array.set( bufferAttribute.array.subarray( i * 3, i * 3 + 3 ), i * 4 );
|
|
73
|
+
|
|
74
|
+
}
|
|
75
|
+
|
|
52
76
|
}
|
|
53
77
|
|
|
54
78
|
const size = array.byteLength + ( ( 4 - ( array.byteLength % 4 ) ) % 4 ); // ensure 4 byte alignment, see #20441
|
|
@@ -143,6 +167,13 @@ class WebGPUAttributeUtils {
|
|
|
143
167
|
|
|
144
168
|
}
|
|
145
169
|
|
|
170
|
+
// patch for INT16 and UINT16
|
|
171
|
+
if ( geometryAttribute.normalized === false && ( geometryAttribute.array.constructor === Int16Array || geometryAttribute.array.constructor === Uint16Array ) ) {
|
|
172
|
+
|
|
173
|
+
arrayStride = 4;
|
|
174
|
+
|
|
175
|
+
}
|
|
176
|
+
|
|
146
177
|
vertexBufferLayout = {
|
|
147
178
|
arrayStride,
|
|
148
179
|
attributes: [],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
GPUTextureAspect, GPUTextureViewDimension, GPUBufferBindingType, GPUTextureSampleType
|
|
3
3
|
} from './WebGPUConstants.js';
|
|
4
|
-
import { FloatType } from 'three';
|
|
4
|
+
import { FloatType, IntType, UnsignedIntType } from 'three';
|
|
5
5
|
|
|
6
6
|
class WebGPUBindingUtils {
|
|
7
7
|
|
|
@@ -73,11 +73,25 @@ class WebGPUBindingUtils {
|
|
|
73
73
|
|
|
74
74
|
texture.sampleType = GPUTextureSampleType.Depth;
|
|
75
75
|
|
|
76
|
-
} else if ( binding.texture.isDataTexture
|
|
76
|
+
} else if ( binding.texture.isDataTexture ) {
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
const type = binding.texture.type;
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
if ( type === IntType ) {
|
|
81
|
+
|
|
82
|
+
texture.sampleType = GPUTextureSampleType.SInt;
|
|
83
|
+
|
|
84
|
+
} else if ( type === UnsignedIntType ) {
|
|
85
|
+
|
|
86
|
+
texture.sampleType = GPUTextureSampleType.UInt;
|
|
87
|
+
|
|
88
|
+
} else if ( type === FloatType ) {
|
|
89
|
+
|
|
90
|
+
// @TODO: Add support for this soon: backend.hasFeature( 'float32-filterable' )
|
|
91
|
+
|
|
92
|
+
texture.sampleType = GPUTextureSampleType.UnfilterableFloat;
|
|
93
|
+
|
|
94
|
+
}
|
|
81
95
|
|
|
82
96
|
}
|
|
83
97
|
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
NearestFilter, NearestMipmapNearestFilter, NearestMipmapLinearFilter,
|
|
8
8
|
RepeatWrapping, MirroredRepeatWrapping,
|
|
9
9
|
RGB_ETC2_Format, RGBA_ETC2_EAC_Format,
|
|
10
|
-
RGBAFormat, RedFormat, RGFormat, RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT5_Format, UnsignedByteType, FloatType, HalfFloatType, SRGBColorSpace, DepthFormat, DepthStencilFormat,
|
|
10
|
+
RGBAFormat, RGBFormat, RedFormat, RGFormat, RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT5_Format, UnsignedByteType, FloatType, HalfFloatType, SRGBColorSpace, DepthFormat, DepthStencilFormat,
|
|
11
11
|
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,
|
|
12
|
-
RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_10x10_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, UnsignedIntType, UnsignedShortType, UnsignedInt248Type,
|
|
13
|
-
NeverCompare, AlwaysCompare, LessCompare, LessEqualCompare, EqualCompare, GreaterEqualCompare, GreaterCompare, NotEqualCompare
|
|
12
|
+
RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_10x10_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, UnsignedIntType, UnsignedShortType, UnsignedInt248Type, UnsignedInt5999Type,
|
|
13
|
+
NeverCompare, AlwaysCompare, LessCompare, LessEqualCompare, EqualCompare, GreaterEqualCompare, GreaterCompare, NotEqualCompare, IntType, RedIntegerFormat, RGIntegerFormat, RGBAIntegerFormat
|
|
14
14
|
} from 'three';
|
|
15
15
|
|
|
16
16
|
import { CubeReflectionMapping, CubeRefractionMapping, EquirectangularReflectionMapping, EquirectangularRefractionMapping, DepthTexture } from 'three';
|
|
@@ -38,8 +38,8 @@ class WebGPUTextureUtils {
|
|
|
38
38
|
|
|
39
39
|
this._passUtils = null;
|
|
40
40
|
|
|
41
|
-
this.defaultTexture =
|
|
42
|
-
this.defaultCubeTexture =
|
|
41
|
+
this.defaultTexture = {};
|
|
42
|
+
this.defaultCubeTexture = {};
|
|
43
43
|
|
|
44
44
|
this.colorBuffer = null;
|
|
45
45
|
|
|
@@ -79,13 +79,15 @@ class WebGPUTextureUtils {
|
|
|
79
79
|
|
|
80
80
|
let textureGPU;
|
|
81
81
|
|
|
82
|
+
const format = getFormat( texture );
|
|
83
|
+
|
|
82
84
|
if ( texture.isCubeTexture ) {
|
|
83
85
|
|
|
84
|
-
textureGPU = this._getDefaultCubeTextureGPU();
|
|
86
|
+
textureGPU = this._getDefaultCubeTextureGPU( format );
|
|
85
87
|
|
|
86
88
|
} else {
|
|
87
89
|
|
|
88
|
-
textureGPU = this._getDefaultTextureGPU();
|
|
90
|
+
textureGPU = this._getDefaultTextureGPU( format );
|
|
89
91
|
|
|
90
92
|
}
|
|
91
93
|
|
|
@@ -111,7 +113,7 @@ class WebGPUTextureUtils {
|
|
|
111
113
|
const { width, height, depth, levels } = options;
|
|
112
114
|
|
|
113
115
|
const dimension = this._getDimension( texture );
|
|
114
|
-
const format = texture.internalFormat || getFormat( texture, backend.device );
|
|
116
|
+
const format = texture.internalFormat || options.format || getFormat( texture, backend.device );
|
|
115
117
|
|
|
116
118
|
let sampleCount = options.sampleCount !== undefined ? options.sampleCount : 1;
|
|
117
119
|
|
|
@@ -268,7 +270,7 @@ class WebGPUTextureUtils {
|
|
|
268
270
|
|
|
269
271
|
}
|
|
270
272
|
|
|
271
|
-
getDepthBuffer( depth = true, stencil =
|
|
273
|
+
getDepthBuffer( depth = true, stencil = false ) {
|
|
272
274
|
|
|
273
275
|
const backend = this.backend;
|
|
274
276
|
const { width, height } = backend.getDrawingBufferSize();
|
|
@@ -327,13 +329,13 @@ class WebGPUTextureUtils {
|
|
|
327
329
|
|
|
328
330
|
if ( texture.isDataTexture || texture.isData3DTexture ) {
|
|
329
331
|
|
|
330
|
-
this._copyBufferToTexture( options.image, textureData.texture, textureDescriptorGPU, 0,
|
|
332
|
+
this._copyBufferToTexture( options.image, textureData.texture, textureDescriptorGPU, 0, texture.flipY );
|
|
331
333
|
|
|
332
334
|
} else if ( texture.isDataArrayTexture ) {
|
|
333
335
|
|
|
334
336
|
for ( let i = 0; i < options.image.depth; i ++ ) {
|
|
335
337
|
|
|
336
|
-
this._copyBufferToTexture( options.image, textureData.texture, textureDescriptorGPU, i,
|
|
338
|
+
this._copyBufferToTexture( options.image, textureData.texture, textureDescriptorGPU, i, texture.flipY, i );
|
|
337
339
|
|
|
338
340
|
}
|
|
339
341
|
|
|
@@ -422,19 +424,19 @@ class WebGPUTextureUtils {
|
|
|
422
424
|
|
|
423
425
|
}
|
|
424
426
|
|
|
425
|
-
_getDefaultTextureGPU() {
|
|
427
|
+
_getDefaultTextureGPU( format ) {
|
|
426
428
|
|
|
427
|
-
let defaultTexture = this.defaultTexture;
|
|
429
|
+
let defaultTexture = this.defaultTexture[ format ];
|
|
428
430
|
|
|
429
|
-
if ( defaultTexture ===
|
|
431
|
+
if ( defaultTexture === undefined ) {
|
|
430
432
|
|
|
431
433
|
const texture = new Texture();
|
|
432
434
|
texture.minFilter = NearestFilter;
|
|
433
435
|
texture.magFilter = NearestFilter;
|
|
434
436
|
|
|
435
|
-
this.createTexture( texture, { width: 1, height: 1 } );
|
|
437
|
+
this.createTexture( texture, { width: 1, height: 1, format } );
|
|
436
438
|
|
|
437
|
-
this.defaultTexture = defaultTexture = texture;
|
|
439
|
+
this.defaultTexture[ format ] = defaultTexture = texture;
|
|
438
440
|
|
|
439
441
|
}
|
|
440
442
|
|
|
@@ -442,11 +444,11 @@ class WebGPUTextureUtils {
|
|
|
442
444
|
|
|
443
445
|
}
|
|
444
446
|
|
|
445
|
-
_getDefaultCubeTextureGPU() {
|
|
447
|
+
_getDefaultCubeTextureGPU( format ) {
|
|
446
448
|
|
|
447
|
-
let defaultCubeTexture = this.defaultTexture;
|
|
449
|
+
let defaultCubeTexture = this.defaultTexture[ format ];
|
|
448
450
|
|
|
449
|
-
if ( defaultCubeTexture ===
|
|
451
|
+
if ( defaultCubeTexture === undefined ) {
|
|
450
452
|
|
|
451
453
|
const texture = new CubeTexture();
|
|
452
454
|
texture.minFilter = NearestFilter;
|
|
@@ -454,7 +456,7 @@ class WebGPUTextureUtils {
|
|
|
454
456
|
|
|
455
457
|
this.createTexture( texture, { width: 1, height: 1, depth: 6 } );
|
|
456
458
|
|
|
457
|
-
this.defaultCubeTexture = defaultCubeTexture = texture;
|
|
459
|
+
this.defaultCubeTexture[ format ] = defaultCubeTexture = texture;
|
|
458
460
|
|
|
459
461
|
}
|
|
460
462
|
|
|
@@ -930,6 +932,21 @@ export function getFormat( texture, device = null ) {
|
|
|
930
932
|
|
|
931
933
|
break;
|
|
932
934
|
|
|
935
|
+
case RGBFormat:
|
|
936
|
+
|
|
937
|
+
switch ( type ) {
|
|
938
|
+
|
|
939
|
+
case UnsignedInt5999Type:
|
|
940
|
+
formatGPU = GPUTextureFormat.RGB9E5UFloat;
|
|
941
|
+
break;
|
|
942
|
+
|
|
943
|
+
default:
|
|
944
|
+
console.error( 'WebGPURenderer: Unsupported texture type with RGBFormat.', type );
|
|
945
|
+
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
break;
|
|
949
|
+
|
|
933
950
|
case RedFormat:
|
|
934
951
|
|
|
935
952
|
switch ( type ) {
|
|
@@ -1026,6 +1043,63 @@ export function getFormat( texture, device = null ) {
|
|
|
1026
1043
|
|
|
1027
1044
|
break;
|
|
1028
1045
|
|
|
1046
|
+
case RedIntegerFormat:
|
|
1047
|
+
|
|
1048
|
+
switch ( type ) {
|
|
1049
|
+
|
|
1050
|
+
case IntType:
|
|
1051
|
+
formatGPU = GPUTextureFormat.R32Sint;
|
|
1052
|
+
break;
|
|
1053
|
+
|
|
1054
|
+
case UnsignedIntType:
|
|
1055
|
+
formatGPU = GPUTextureFormat.R32Uint;
|
|
1056
|
+
break;
|
|
1057
|
+
|
|
1058
|
+
default:
|
|
1059
|
+
console.error( 'WebGPURenderer: Unsupported texture type with RedIntegerFormat.', type );
|
|
1060
|
+
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
break;
|
|
1064
|
+
|
|
1065
|
+
case RGIntegerFormat:
|
|
1066
|
+
|
|
1067
|
+
switch ( type ) {
|
|
1068
|
+
|
|
1069
|
+
case IntType:
|
|
1070
|
+
formatGPU = GPUTextureFormat.RG32Sint;
|
|
1071
|
+
break;
|
|
1072
|
+
|
|
1073
|
+
case UnsignedIntType:
|
|
1074
|
+
formatGPU = GPUTextureFormat.RG32Uint;
|
|
1075
|
+
break;
|
|
1076
|
+
|
|
1077
|
+
default:
|
|
1078
|
+
console.error( 'WebGPURenderer: Unsupported texture type with RGIntegerFormat.', type );
|
|
1079
|
+
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
break;
|
|
1083
|
+
|
|
1084
|
+
case RGBAIntegerFormat:
|
|
1085
|
+
|
|
1086
|
+
switch ( type ) {
|
|
1087
|
+
|
|
1088
|
+
case IntType:
|
|
1089
|
+
formatGPU = GPUTextureFormat.RGBA32Sint;
|
|
1090
|
+
break;
|
|
1091
|
+
|
|
1092
|
+
case UnsignedIntType:
|
|
1093
|
+
formatGPU = GPUTextureFormat.RGBA32Uint;
|
|
1094
|
+
break;
|
|
1095
|
+
|
|
1096
|
+
default:
|
|
1097
|
+
console.error( 'WebGPURenderer: Unsupported texture type with RGBAIntegerFormat.', type );
|
|
1098
|
+
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
break;
|
|
1102
|
+
|
|
1029
1103
|
default:
|
|
1030
1104
|
console.error( 'WebGPURenderer: Unsupported texture format.', format );
|
|
1031
1105
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import Stats from '../libs/stats.module.js';
|
|
2
2
|
|
|
3
|
-
// https://www.khronos.org/registry/webgl/extensions/EXT_disjoint_timer_query/
|
|
4
3
|
// https://www.khronos.org/registry/webgl/extensions/EXT_disjoint_timer_query_webgl2/
|
|
5
4
|
export class GPUStatsPanel extends Stats.Panel {
|
|
6
5
|
|
|
@@ -8,18 +7,11 @@ export class GPUStatsPanel extends Stats.Panel {
|
|
|
8
7
|
|
|
9
8
|
super( name, '#f90', '#210' );
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
let extension = context.getExtension( 'EXT_disjoint_timer_query_webgl2' );
|
|
13
|
-
if ( extension === null ) {
|
|
14
|
-
|
|
15
|
-
isWebGL2 = false;
|
|
16
|
-
extension = context.getExtension( 'EXT_disjoint_timer_query' );
|
|
17
|
-
|
|
18
|
-
if ( extension === null ) {
|
|
10
|
+
const extension = context.getExtension( 'EXT_disjoint_timer_query_webgl2' );
|
|
19
11
|
|
|
20
|
-
|
|
12
|
+
if ( extension === null ) {
|
|
21
13
|
|
|
22
|
-
|
|
14
|
+
console.warn( 'GPUStatsPanel: disjoint_time_query extension not available.' );
|
|
23
15
|
|
|
24
16
|
}
|
|
25
17
|
|
|
@@ -40,40 +32,21 @@ export class GPUStatsPanel extends Stats.Panel {
|
|
|
40
32
|
}
|
|
41
33
|
|
|
42
34
|
// create the query object
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
query = gl.createQuery();
|
|
47
|
-
gl.beginQuery( ext.TIME_ELAPSED_EXT, query );
|
|
48
|
-
|
|
49
|
-
} else {
|
|
50
|
-
|
|
51
|
-
query = ext.createQueryEXT();
|
|
52
|
-
ext.beginQueryEXT( ext.TIME_ELAPSED_EXT, query );
|
|
53
|
-
|
|
54
|
-
}
|
|
35
|
+
const query = gl.createQuery();
|
|
36
|
+
gl.beginQuery( ext.TIME_ELAPSED_EXT, query );
|
|
55
37
|
|
|
56
38
|
this.activeQueries ++;
|
|
57
39
|
|
|
58
40
|
const checkQuery = () => {
|
|
59
41
|
|
|
60
42
|
// check if the query is available and valid
|
|
61
|
-
let available, disjoint, ns;
|
|
62
|
-
if ( isWebGL2 ) {
|
|
63
43
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
} else {
|
|
69
|
-
|
|
70
|
-
available = ext.getQueryObjectEXT( query, ext.QUERY_RESULT_AVAILABLE_EXT );
|
|
71
|
-
disjoint = gl.getParameter( ext.GPU_DISJOINT_EXT );
|
|
72
|
-
ns = ext.getQueryObjectEXT( query, ext.QUERY_RESULT_EXT );
|
|
73
|
-
|
|
74
|
-
}
|
|
44
|
+
const available = gl.getQueryParameter( query, gl.QUERY_RESULT_AVAILABLE );
|
|
45
|
+
const disjoint = gl.getParameter( ext.GPU_DISJOINT_EXT );
|
|
46
|
+
const ns = gl.getQueryParameter( query, gl.QUERY_RESULT );
|
|
75
47
|
|
|
76
48
|
const ms = ns * 1e-6;
|
|
49
|
+
|
|
77
50
|
if ( available ) {
|
|
78
51
|
|
|
79
52
|
// update the display if it is valid
|
|
@@ -111,15 +84,7 @@ export class GPUStatsPanel extends Stats.Panel {
|
|
|
111
84
|
|
|
112
85
|
}
|
|
113
86
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
gl.endQuery( ext.TIME_ELAPSED_EXT );
|
|
117
|
-
|
|
118
|
-
} else {
|
|
119
|
-
|
|
120
|
-
ext.endQueryEXT( ext.TIME_ELAPSED_EXT );
|
|
121
|
-
|
|
122
|
-
}
|
|
87
|
+
gl.endQuery( ext.TIME_ELAPSED_EXT );
|
|
123
88
|
|
|
124
89
|
};
|
|
125
90
|
|
|
@@ -200,7 +200,8 @@ function retarget( target, source, options = {} ) {
|
|
|
200
200
|
function retargetClip( target, source, clip, options = {} ) {
|
|
201
201
|
|
|
202
202
|
options.useFirstFramePosition = options.useFirstFramePosition !== undefined ? options.useFirstFramePosition : false;
|
|
203
|
-
|
|
203
|
+
// Calculate the fps from the source clip based on the track with the most frames, unless fps is already provided.
|
|
204
|
+
options.fps = options.fps !== undefined ? options.fps : ( Math.max( ...clip.tracks.map( track => track.times.length ) ) / clip.duration );
|
|
204
205
|
options.names = options.names || [];
|
|
205
206
|
|
|
206
207
|
if ( ! source.isObject3D ) {
|
|
@@ -210,7 +211,7 @@ function retargetClip( target, source, clip, options = {} ) {
|
|
|
210
211
|
}
|
|
211
212
|
|
|
212
213
|
const numFrames = Math.round( clip.duration * ( options.fps / 1000 ) * 1000 ),
|
|
213
|
-
delta =
|
|
214
|
+
delta = clip.duration / ( numFrames - 1 ),
|
|
214
215
|
convertedTracks = [],
|
|
215
216
|
mixer = new AnimationMixer( source ),
|
|
216
217
|
bones = getBones( target.skeleton ),
|
|
@@ -287,7 +288,17 @@ function retargetClip( target, source, clip, options = {} ) {
|
|
|
287
288
|
|
|
288
289
|
}
|
|
289
290
|
|
|
290
|
-
|
|
291
|
+
if ( i === numFrames - 2 ) {
|
|
292
|
+
|
|
293
|
+
// last mixer update before final loop iteration
|
|
294
|
+
// make sure we do not go over or equal to clip duration
|
|
295
|
+
mixer.update( delta - 0.0000001 );
|
|
296
|
+
|
|
297
|
+
} else {
|
|
298
|
+
|
|
299
|
+
mixer.update( delta );
|
|
300
|
+
|
|
301
|
+
}
|
|
291
302
|
|
|
292
303
|
source.updateMatrixWorld();
|
|
293
304
|
|
|
@@ -48,7 +48,7 @@ export function decompress( texture, maxTextureSize = Infinity, renderer = null
|
|
|
48
48
|
if ( ! fullscreenQuad ) {
|
|
49
49
|
|
|
50
50
|
fullscreenQuad = new Mesh( fullscreenQuadGeometry, fullscreenQuadMaterial );
|
|
51
|
-
fullscreenQuad.
|
|
51
|
+
fullscreenQuad.frustumCulled = false;
|
|
52
52
|
|
|
53
53
|
}
|
|
54
54
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
class VRButton {
|
|
2
2
|
|
|
3
|
-
static createButton( renderer ) {
|
|
3
|
+
static createButton( renderer, sessionInit = {} ) {
|
|
4
4
|
|
|
5
5
|
const button = document.createElement( 'button' );
|
|
6
6
|
|
|
@@ -46,7 +46,15 @@ class VRButton {
|
|
|
46
46
|
// ('local' is always available for immersive sessions and doesn't need to
|
|
47
47
|
// be requested separately.)
|
|
48
48
|
|
|
49
|
-
const
|
|
49
|
+
const sessionOptions = {
|
|
50
|
+
...sessionInit,
|
|
51
|
+
optionalFeatures: [
|
|
52
|
+
'local-floor',
|
|
53
|
+
'bounded-floor',
|
|
54
|
+
'layers',
|
|
55
|
+
...( sessionInit.optionalFeatures || [] )
|
|
56
|
+
],
|
|
57
|
+
};
|
|
50
58
|
|
|
51
59
|
button.onmouseenter = function () {
|
|
52
60
|
|
|
@@ -64,7 +72,7 @@ class VRButton {
|
|
|
64
72
|
|
|
65
73
|
if ( currentSession === null ) {
|
|
66
74
|
|
|
67
|
-
navigator.xr.requestSession( 'immersive-vr',
|
|
75
|
+
navigator.xr.requestSession( 'immersive-vr', sessionOptions ).then( onSessionStarted );
|
|
68
76
|
|
|
69
77
|
} else {
|
|
70
78
|
|
|
@@ -72,7 +80,7 @@ class VRButton {
|
|
|
72
80
|
|
|
73
81
|
if ( navigator.xr.offerSession !== undefined ) {
|
|
74
82
|
|
|
75
|
-
navigator.xr.offerSession( 'immersive-vr',
|
|
83
|
+
navigator.xr.offerSession( 'immersive-vr', sessionOptions )
|
|
76
84
|
.then( onSessionStarted )
|
|
77
85
|
.catch( ( err ) => {
|
|
78
86
|
|
|
@@ -88,7 +96,7 @@ class VRButton {
|
|
|
88
96
|
|
|
89
97
|
if ( navigator.xr.offerSession !== undefined ) {
|
|
90
98
|
|
|
91
|
-
navigator.xr.offerSession( 'immersive-vr',
|
|
99
|
+
navigator.xr.offerSession( 'immersive-vr', sessionOptions )
|
|
92
100
|
.then( onSessionStarted )
|
|
93
101
|
.catch( ( err ) => {
|
|
94
102
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "super-three",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.163.0",
|
|
4
4
|
"description": "JavaScript 3D library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./build/three.cjs",
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
"build": "rollup -c utils/build/rollup.config.js",
|
|
46
46
|
"build-module": "rollup -c utils/build/rollup.config.js --configOnlyModule",
|
|
47
47
|
"dev": "concurrently --names \"ROLLUP,HTTP\" -c \"bgBlue.bold,bgGreen.bold\" \"rollup -c utils/build/rollup.config.js -w -m inline\" \"servez -p 8080\"",
|
|
48
|
+
"dev-ssl": "concurrently --names \"ROLLUP,HTTPS\" -c \"bgBlue.bold,bgGreen.bold\" \"rollup -c utils/build/rollup.config.js -w -m inline\" \"servez -p 8080 --ssl\"",
|
|
48
49
|
"lint-core": "eslint src",
|
|
49
50
|
"lint-addons": "eslint examples/jsm --ext .js --ignore-pattern libs --ignore-pattern ifc",
|
|
50
51
|
"lint-examples": "eslint examples --ext .html",
|
|
@@ -94,13 +95,13 @@
|
|
|
94
95
|
"eslint": "^8.37.0",
|
|
95
96
|
"eslint-config-mdcs": "^5.0.0",
|
|
96
97
|
"eslint-plugin-compat": "^4.1.2",
|
|
97
|
-
"eslint-plugin-html": "^
|
|
98
|
+
"eslint-plugin-html": "^8.0.0",
|
|
98
99
|
"eslint-plugin-import": "^2.27.5",
|
|
99
100
|
"failonlyreporter": "^1.0.0",
|
|
100
101
|
"jimp": "^0.22.7",
|
|
101
102
|
"magic-string": "^0.30.0",
|
|
102
103
|
"pixelmatch": "^5.3.0",
|
|
103
|
-
"puppeteer": "^
|
|
104
|
+
"puppeteer": "^22.0.0",
|
|
104
105
|
"qunit": "^2.19.4",
|
|
105
106
|
"rollup": "^4.6.0",
|
|
106
107
|
"rollup-plugin-filesize": "^10.0.0",
|