super-three 0.156.0 → 0.157.1
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 +753 -277
- package/build/three.js +753 -277
- package/build/three.min.js +2 -2
- package/build/three.module.js +750 -276
- package/build/three.module.min.js +1 -1
- package/examples/jsm/capabilities/WebGL.js +17 -0
- package/examples/jsm/controls/DragControls.js +3 -2
- package/examples/jsm/csm/CSMShader.js +25 -21
- package/examples/jsm/exporters/EXRExporter.js +102 -24
- package/examples/jsm/exporters/GLTFExporter.js +1 -1
- package/examples/jsm/libs/rhino3dm/rhino3dm.js +8726 -4
- package/examples/jsm/libs/rhino3dm/rhino3dm.module.js +8737 -4
- package/examples/jsm/libs/rhino3dm/rhino3dm.wasm +0 -0
- package/examples/jsm/lights/LightProbeGenerator.js +37 -3
- package/examples/jsm/lines/LineMaterial.js +90 -156
- package/examples/jsm/loaders/3DMLoader.js +378 -104
- package/examples/jsm/loaders/GLTFLoader.js +1 -1
- package/examples/jsm/loaders/LDrawLoader.js +22 -16
- package/examples/jsm/loaders/RGBELoader.js +1 -1
- package/examples/jsm/loaders/USDZLoader.js +215 -12
- package/examples/jsm/materials/MeshGouraudMaterial.js +22 -18
- package/examples/jsm/nodes/Nodes.js +5 -1
- package/examples/jsm/nodes/accessors/BitangentNode.js +1 -1
- package/examples/jsm/nodes/accessors/BufferAttributeNode.js +2 -2
- package/examples/jsm/nodes/accessors/BufferNode.js +1 -1
- package/examples/jsm/nodes/accessors/CameraNode.js +1 -1
- package/examples/jsm/nodes/accessors/CubeTextureNode.js +2 -2
- package/examples/jsm/nodes/accessors/ExtendedMaterialNode.js +6 -5
- package/examples/jsm/nodes/accessors/InstanceNode.js +2 -2
- package/examples/jsm/nodes/accessors/LineMaterialNode.js +7 -9
- package/examples/jsm/nodes/accessors/MaterialNode.js +34 -46
- package/examples/jsm/nodes/accessors/MaterialReferenceNode.js +9 -9
- package/examples/jsm/nodes/accessors/ModelNode.js +1 -1
- package/examples/jsm/nodes/accessors/ModelViewProjectionNode.js +5 -4
- package/examples/jsm/nodes/accessors/MorphNode.js +4 -4
- package/examples/jsm/nodes/accessors/NormalNode.js +1 -1
- package/examples/jsm/nodes/accessors/Object3DNode.js +1 -1
- package/examples/jsm/nodes/accessors/PointUVNode.js +1 -1
- package/examples/jsm/nodes/accessors/PositionNode.js +1 -1
- package/examples/jsm/nodes/accessors/ReferenceNode.js +13 -7
- package/examples/jsm/nodes/accessors/ReflectVectorNode.js +2 -2
- package/examples/jsm/nodes/accessors/SceneNode.js +2 -2
- package/examples/jsm/nodes/accessors/SkinningNode.js +2 -2
- package/examples/jsm/nodes/accessors/StorageBufferNode.js +1 -1
- package/examples/jsm/nodes/accessors/TangentNode.js +1 -1
- package/examples/jsm/nodes/accessors/TextureBicubicNode.js +2 -2
- package/examples/jsm/nodes/accessors/TextureNode.js +12 -6
- package/examples/jsm/nodes/accessors/TextureSizeNode.js +2 -2
- package/examples/jsm/nodes/accessors/TextureStoreNode.js +1 -1
- package/examples/jsm/nodes/accessors/UVNode.js +1 -1
- package/examples/jsm/nodes/accessors/UserDataNode.js +2 -2
- package/examples/jsm/nodes/code/CodeNode.js +1 -1
- package/examples/jsm/nodes/code/ExpressionNode.js +1 -1
- package/examples/jsm/nodes/code/FunctionCallNode.js +1 -1
- package/examples/jsm/nodes/code/FunctionNode.js +18 -7
- package/examples/jsm/nodes/code/ScriptableNode.js +2 -2
- package/examples/jsm/nodes/code/ScriptableValueNode.js +2 -2
- package/examples/jsm/nodes/core/ArrayUniformNode.js +1 -1
- package/examples/jsm/nodes/core/AttributeNode.js +1 -1
- package/examples/jsm/nodes/core/BypassNode.js +1 -1
- package/examples/jsm/nodes/core/CacheNode.js +1 -1
- package/examples/jsm/nodes/core/ConstNode.js +1 -1
- package/examples/jsm/nodes/core/ContextNode.js +2 -2
- package/examples/jsm/nodes/core/IndexNode.js +1 -1
- package/examples/jsm/nodes/core/InputNode.js +1 -1
- package/examples/jsm/nodes/core/Node.js +28 -13
- package/examples/jsm/nodes/core/NodeBuilder.js +3 -17
- package/examples/jsm/nodes/core/NodeFrame.js +37 -14
- package/examples/jsm/nodes/core/OutputStructNode.js +8 -4
- package/examples/jsm/nodes/core/PropertyNode.js +3 -3
- package/examples/jsm/nodes/core/StackNode.js +1 -1
- package/examples/jsm/nodes/core/StructTypeNode.js +1 -1
- package/examples/jsm/nodes/core/TempNode.js +1 -1
- package/examples/jsm/nodes/core/UniformNode.js +3 -1
- package/examples/jsm/nodes/core/VarNode.js +1 -1
- package/examples/jsm/nodes/core/VaryingNode.js +1 -1
- package/examples/jsm/nodes/core/constants.js +1 -1
- package/examples/jsm/nodes/display/BlendModeNode.js +2 -2
- package/examples/jsm/nodes/display/BumpMapNode.js +2 -2
- package/examples/jsm/nodes/display/ColorAdjustmentNode.js +2 -2
- package/examples/jsm/nodes/display/ColorSpaceNode.js +2 -2
- package/examples/jsm/nodes/display/FrontFacingNode.js +1 -1
- package/examples/jsm/nodes/display/NormalMapNode.js +2 -2
- package/examples/jsm/nodes/display/PosterizeNode.js +2 -2
- package/examples/jsm/nodes/display/ToneMappingNode.js +2 -2
- package/examples/jsm/nodes/display/ViewportDepthNode.js +2 -2
- package/examples/jsm/nodes/display/ViewportDepthTextureNode.js +1 -1
- package/examples/jsm/nodes/display/ViewportNode.js +2 -2
- package/examples/jsm/nodes/display/ViewportSharedTextureNode.js +1 -1
- package/examples/jsm/nodes/display/ViewportTextureNode.js +1 -1
- package/examples/jsm/nodes/fog/FogExp2Node.js +2 -2
- package/examples/jsm/nodes/fog/FogNode.js +2 -2
- package/examples/jsm/nodes/fog/FogRangeNode.js +2 -2
- package/examples/jsm/nodes/geometry/RangeNode.js +2 -2
- package/examples/jsm/nodes/gpgpu/ComputeNode.js +1 -1
- package/examples/jsm/nodes/lighting/AONode.js +2 -2
- package/examples/jsm/nodes/lighting/AmbientLightNode.js +3 -3
- package/examples/jsm/nodes/lighting/AnalyticLightNode.js +4 -4
- package/examples/jsm/nodes/lighting/DirectionalLightNode.js +4 -4
- package/examples/jsm/nodes/lighting/EnvironmentNode.js +2 -2
- package/examples/jsm/nodes/lighting/HemisphereLightNode.js +3 -3
- package/examples/jsm/nodes/lighting/IESSpotLightNode.js +2 -2
- package/examples/jsm/nodes/lighting/LightNode.js +2 -2
- package/examples/jsm/nodes/lighting/LightingContextNode.js +3 -3
- package/examples/jsm/nodes/lighting/LightingNode.js +1 -1
- package/examples/jsm/nodes/lighting/LightsNode.js +4 -4
- package/examples/jsm/nodes/lighting/PointLightNode.js +3 -3
- package/examples/jsm/nodes/lighting/SpotLightNode.js +4 -4
- package/examples/jsm/nodes/materials/Line2NodeMaterial.js +449 -0
- package/examples/jsm/nodes/materials/LineBasicNodeMaterial.js +1 -1
- package/examples/jsm/nodes/materials/LineDashedNodeMaterial.js +2 -2
- package/examples/jsm/nodes/materials/Materials.js +1 -0
- package/examples/jsm/nodes/materials/MeshBasicNodeMaterial.js +1 -1
- package/examples/jsm/nodes/materials/MeshLambertNodeMaterial.js +2 -2
- package/examples/jsm/nodes/materials/MeshNormalNodeMaterial.js +2 -2
- package/examples/jsm/nodes/materials/MeshPhongNodeMaterial.js +3 -3
- package/examples/jsm/nodes/materials/MeshPhysicalNodeMaterial.js +6 -6
- package/examples/jsm/nodes/materials/MeshStandardNodeMaterial.js +3 -3
- package/examples/jsm/nodes/materials/NodeMaterial.js +27 -26
- package/examples/jsm/nodes/materials/PointsNodeMaterial.js +1 -1
- package/examples/jsm/nodes/materials/SpriteNodeMaterial.js +2 -2
- package/examples/jsm/nodes/math/CondNode.js +1 -1
- package/examples/jsm/nodes/math/HashNode.js +8 -9
- package/examples/jsm/nodes/math/MathNode.js +2 -2
- package/examples/jsm/nodes/math/OperatorNode.js +1 -1
- package/examples/jsm/nodes/procedural/CheckerNode.js +3 -3
- package/examples/jsm/nodes/shadernode/ShaderNode.js +81 -28
- package/examples/jsm/nodes/utils/ArrayElementNode.js +1 -1
- package/examples/jsm/nodes/utils/ConvertNode.js +1 -1
- package/examples/jsm/nodes/utils/DiscardNode.js +1 -1
- package/examples/jsm/nodes/utils/EquirectUVNode.js +2 -2
- package/examples/jsm/nodes/utils/JoinNode.js +1 -1
- package/examples/jsm/nodes/utils/LoopNode.js +11 -11
- package/examples/jsm/nodes/utils/MatcapUVNode.js +2 -2
- package/examples/jsm/nodes/utils/MaxMipLevelNode.js +1 -1
- package/examples/jsm/nodes/utils/OscNode.js +2 -2
- package/examples/jsm/nodes/utils/PackingNode.js +2 -2
- package/examples/jsm/nodes/utils/RemapNode.js +2 -2
- package/examples/jsm/nodes/utils/RotateUVNode.js +2 -2
- package/examples/jsm/nodes/utils/SetNode.js +62 -0
- package/examples/jsm/nodes/utils/SpecularMIPLevelNode.js +2 -2
- package/examples/jsm/nodes/utils/SplitNode.js +1 -1
- package/examples/jsm/nodes/utils/SpriteSheetUVNode.js +2 -2
- package/examples/jsm/nodes/utils/TimerNode.js +2 -2
- package/examples/jsm/nodes/utils/TriplanarTexturesNode.js +2 -2
- package/examples/jsm/objects/Sky.js +1 -3
- package/examples/jsm/postprocessing/OutputPass.js +3 -2
- package/examples/jsm/renderers/common/Background.js +2 -2
- package/examples/jsm/renderers/common/Bindings.js +3 -5
- package/examples/jsm/renderers/common/Pipelines.js +7 -7
- package/examples/jsm/renderers/common/RenderContext.js +3 -0
- package/examples/jsm/renderers/common/RenderObject.js +40 -16
- package/examples/jsm/renderers/common/RenderObjects.js +8 -14
- package/examples/jsm/renderers/common/Renderer.js +40 -13
- package/examples/jsm/renderers/common/SampledTexture.js +4 -2
- package/examples/jsm/renderers/common/StorageTexture.js +19 -0
- package/examples/jsm/renderers/common/Textures.js +14 -9
- package/examples/jsm/renderers/common/nodes/NodeBuilderState.js +35 -0
- package/examples/jsm/renderers/common/nodes/NodeSampledTexture.js +20 -10
- package/examples/jsm/renderers/common/nodes/NodeSampler.js +0 -6
- package/examples/jsm/renderers/common/nodes/Nodes.js +51 -24
- package/examples/jsm/renderers/webgl/WebGLBackend.js +100 -5
- package/examples/jsm/renderers/webgl/nodes/GLSLNodeBuilder.js +92 -6
- package/examples/jsm/renderers/webgl/utils/WebGLTextureUtils.js +13 -0
- package/examples/jsm/renderers/webgl-legacy/nodes/WebGLNodeBuilder.js +3 -3
- package/examples/jsm/renderers/webgl-legacy/nodes/WebGLNodes.js +14 -2
- package/examples/jsm/renderers/webgpu/WebGPUBackend.js +5 -5
- package/examples/jsm/renderers/webgpu/nodes/WGSLNodeBuilder.js +6 -3
- package/examples/jsm/renderers/webgpu/utils/WebGPUPipelineUtils.js +5 -5
- package/examples/jsm/renderers/webgpu/utils/WebGPUTexturePassUtils.js +285 -0
- package/examples/jsm/renderers/webgpu/utils/WebGPUTextureUtils.js +197 -167
- package/examples/jsm/shaders/GammaCorrectionShader.js +1 -1
- package/examples/jsm/shaders/MMDToonShader.js +4 -4
- package/examples/jsm/shaders/OutputShader.js +2 -2
- package/examples/jsm/shaders/SubsurfaceScatteringShader.js +6 -6
- package/examples/jsm/utils/BufferGeometryUtils.js +6 -4
- package/package.json +1 -1
- package/src/Three.js +0 -2
- package/src/animation/AnimationUtils.js +3 -20
- package/src/animation/KeyframeTrack.js +8 -8
- package/src/cameras/Camera.js +1 -5
- package/src/cameras/CubeCamera.js +14 -8
- package/src/constants.js +7 -1
- package/src/core/RenderTarget.js +16 -7
- package/src/extras/core/CurvePath.js +4 -1
- package/src/loaders/MaterialLoader.js +1 -1
- package/src/loaders/ObjectLoader.js +6 -0
- package/src/materials/Material.js +8 -8
- package/src/math/Color.js +1 -5
- package/src/math/ColorManagement.js +82 -60
- package/src/objects/Sprite.js +2 -2
- package/src/renderers/WebGLMultiviewRenderTarget.js +35 -0
- package/src/renderers/WebGLRenderer.js +78 -22
- package/src/renderers/shaders/ShaderChunk/aomap_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/clearcoat_normal_fragment_begin.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/colorspace_pars_fragment.glsl.js +35 -2
- package/src/renderers/shaders/ShaderChunk/common.glsl.js +0 -9
- package/src/renderers/shaders/ShaderChunk/lights_fragment_begin.glsl.js +19 -15
- package/src/renderers/shaders/ShaderChunk/lights_fragment_end.glsl.js +2 -2
- package/src/renderers/shaders/ShaderChunk/lights_fragment_maps.glsl.js +4 -4
- package/src/renderers/shaders/ShaderChunk/lights_lambert_pars_fragment.glsl.js +3 -3
- package/src/renderers/shaders/ShaderChunk/lights_pars_begin.glsl.js +11 -6
- package/src/renderers/shaders/ShaderChunk/lights_phong_pars_fragment.glsl.js +4 -4
- package/src/renderers/shaders/ShaderChunk/lights_physical_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js +16 -16
- package/src/renderers/shaders/ShaderChunk/lights_toon_pars_fragment.glsl.js +3 -3
- package/src/renderers/shaders/ShaderChunk/normal_fragment_begin.glsl.js +1 -1
- package/src/renderers/shaders/ShaderLib/meshphysical.glsl.js +1 -1
- package/src/renderers/shaders/UniformsUtils.js +2 -2
- package/src/renderers/webgl/WebGLBackground.js +5 -4
- package/src/renderers/webgl/WebGLLights.js +14 -3
- package/src/renderers/webgl/WebGLMultiview.js +100 -0
- package/src/renderers/webgl/WebGLProgram.js +84 -5
- package/src/renderers/webgl/WebGLPrograms.js +11 -2
- package/src/renderers/webgl/WebGLTextures.js +214 -26
- package/src/renderers/webgl/WebGLUtils.js +21 -23
- package/src/renderers/webxr/WebXRManager.js +36 -12
- package/src/scenes/Fog.js +1 -0
- package/src/scenes/FogExp2.js +1 -0
- package/src/textures/Source.js +2 -2
- package/examples/jsm/renderers/webgpu/utils/WebGPUTextureMipmapUtils.js +0 -163
- package/src/lights/AmbientLightProbe.js +0 -21
- package/src/lights/HemisphereLightProbe.js +0 -30
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
|
|
16
16
|
import { CubeReflectionMapping, CubeRefractionMapping, EquirectangularReflectionMapping, EquirectangularRefractionMapping } from 'three';
|
|
17
17
|
|
|
18
|
-
import
|
|
18
|
+
import WebGPUTexturePassUtils from './WebGPUTexturePassUtils.js';
|
|
19
19
|
|
|
20
20
|
const _compareToWebGPU = {
|
|
21
21
|
[ NeverCompare ]: 'never',
|
|
@@ -28,13 +28,15 @@ const _compareToWebGPU = {
|
|
|
28
28
|
[ NotEqualCompare ]: 'not-equal'
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
+
const _flipMap = [ 0, 1, 3, 2, 4, 5 ];
|
|
32
|
+
|
|
31
33
|
class WebGPUTextureUtils {
|
|
32
34
|
|
|
33
35
|
constructor( backend ) {
|
|
34
36
|
|
|
35
37
|
this.backend = backend;
|
|
36
38
|
|
|
37
|
-
this.
|
|
39
|
+
this._passUtils = null;
|
|
38
40
|
|
|
39
41
|
this.defaultTexture = null;
|
|
40
42
|
this.defaultCubeTexture = null;
|
|
@@ -104,14 +106,14 @@ class WebGPUTextureUtils {
|
|
|
104
106
|
const { width, height, depth, levels } = options;
|
|
105
107
|
|
|
106
108
|
const dimension = this._getDimension( texture );
|
|
107
|
-
const format = texture.internalFormat ||
|
|
109
|
+
const format = texture.internalFormat || getFormat( texture, this.device );
|
|
108
110
|
|
|
109
111
|
const sampleCount = options.sampleCount !== undefined ? options.sampleCount : 1;
|
|
110
112
|
const primarySampleCount = texture.isRenderTargetTexture ? 1 : sampleCount;
|
|
111
113
|
|
|
112
114
|
let usage = GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST | GPUTextureUsage.COPY_SRC;
|
|
113
115
|
|
|
114
|
-
if (
|
|
116
|
+
if ( texture.isStorageTexture === true ) {
|
|
115
117
|
|
|
116
118
|
usage |= GPUTextureUsage.STORAGE_BINDING;
|
|
117
119
|
|
|
@@ -237,7 +239,7 @@ class WebGPUTextureUtils {
|
|
|
237
239
|
|
|
238
240
|
if ( texture.isDataTexture || texture.isDataArrayTexture || texture.isData3DTexture ) {
|
|
239
241
|
|
|
240
|
-
this._copyBufferToTexture( options.image, textureData.texture, textureDescriptorGPU );
|
|
242
|
+
this._copyBufferToTexture( options.image, textureData.texture, textureDescriptorGPU, 0, false );
|
|
241
243
|
|
|
242
244
|
} else if ( texture.isCompressedTexture ) {
|
|
243
245
|
|
|
@@ -245,7 +247,7 @@ class WebGPUTextureUtils {
|
|
|
245
247
|
|
|
246
248
|
} else if ( texture.isCubeTexture ) {
|
|
247
249
|
|
|
248
|
-
this._copyCubeMapToTexture( options.images,
|
|
250
|
+
this._copyCubeMapToTexture( options.images, textureData.texture, textureDescriptorGPU, texture.flipY );
|
|
249
251
|
|
|
250
252
|
} else if ( texture.isVideoTexture ) {
|
|
251
253
|
|
|
@@ -255,7 +257,7 @@ class WebGPUTextureUtils {
|
|
|
255
257
|
|
|
256
258
|
} else {
|
|
257
259
|
|
|
258
|
-
this._copyImageToTexture( options.image, textureData.texture );
|
|
260
|
+
this._copyImageToTexture( options.image, textureData.texture, textureDescriptorGPU, 0, texture.flipY );
|
|
259
261
|
|
|
260
262
|
}
|
|
261
263
|
|
|
@@ -361,19 +363,21 @@ class WebGPUTextureUtils {
|
|
|
361
363
|
|
|
362
364
|
}
|
|
363
365
|
|
|
364
|
-
_copyCubeMapToTexture( images,
|
|
366
|
+
_copyCubeMapToTexture( images, textureGPU, textureDescriptorGPU, flipY ) {
|
|
365
367
|
|
|
366
368
|
for ( let i = 0; i < 6; i ++ ) {
|
|
367
369
|
|
|
368
370
|
const image = images[ i ];
|
|
369
371
|
|
|
372
|
+
const flipIndex = flipY === true ? _flipMap[ i ] : i;
|
|
373
|
+
|
|
370
374
|
if ( image.isDataTexture ) {
|
|
371
375
|
|
|
372
|
-
this._copyBufferToTexture( image.image, textureGPU, textureDescriptorGPU,
|
|
376
|
+
this._copyBufferToTexture( image.image, textureGPU, textureDescriptorGPU, flipIndex, flipY );
|
|
373
377
|
|
|
374
378
|
} else {
|
|
375
379
|
|
|
376
|
-
this._copyImageToTexture( image, textureGPU,
|
|
380
|
+
this._copyImageToTexture( image, textureGPU, textureDescriptorGPU, flipIndex, flipY );
|
|
377
381
|
|
|
378
382
|
}
|
|
379
383
|
|
|
@@ -381,7 +385,7 @@ class WebGPUTextureUtils {
|
|
|
381
385
|
|
|
382
386
|
}
|
|
383
387
|
|
|
384
|
-
_copyImageToTexture( image, textureGPU, originDepth
|
|
388
|
+
_copyImageToTexture( image, textureGPU, textureDescriptorGPU, originDepth, flipY ) {
|
|
385
389
|
|
|
386
390
|
const device = this.backend.device;
|
|
387
391
|
|
|
@@ -399,21 +403,41 @@ class WebGPUTextureUtils {
|
|
|
399
403
|
}
|
|
400
404
|
);
|
|
401
405
|
|
|
406
|
+
if ( flipY === true ) {
|
|
407
|
+
|
|
408
|
+
this._flipY( textureGPU, textureDescriptorGPU, originDepth );
|
|
409
|
+
|
|
410
|
+
}
|
|
411
|
+
|
|
402
412
|
}
|
|
403
413
|
|
|
404
|
-
|
|
414
|
+
_getPassUtils() {
|
|
405
415
|
|
|
406
|
-
|
|
416
|
+
let passUtils = this._passUtils;
|
|
407
417
|
|
|
408
|
-
|
|
418
|
+
if ( passUtils === null ) {
|
|
419
|
+
|
|
420
|
+
this._passUtils = passUtils = new WebGPUTexturePassUtils( this.backend.device );
|
|
409
421
|
|
|
410
422
|
}
|
|
411
423
|
|
|
412
|
-
|
|
424
|
+
return passUtils;
|
|
425
|
+
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
_generateMipmaps( textureGPU, textureDescriptorGPU, baseArrayLayer = 0 ) {
|
|
429
|
+
|
|
430
|
+
this._getPassUtils().generateMipmaps( textureGPU, textureDescriptorGPU, baseArrayLayer );
|
|
431
|
+
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
_flipY( textureGPU, textureDescriptorGPU, originDepth = 0 ) {
|
|
435
|
+
|
|
436
|
+
this._getPassUtils().flipY( textureGPU, textureDescriptorGPU, originDepth );
|
|
413
437
|
|
|
414
438
|
}
|
|
415
439
|
|
|
416
|
-
_copyBufferToTexture( image, textureGPU, textureDescriptorGPU, originDepth
|
|
440
|
+
_copyBufferToTexture( image, textureGPU, textureDescriptorGPU, originDepth, flipY ) {
|
|
417
441
|
|
|
418
442
|
// @TODO: Consider to use GPUCommandEncoder.copyBufferToTexture()
|
|
419
443
|
// @TODO: Consider to support valid buffer layouts with other formats like RGB
|
|
@@ -442,6 +466,12 @@ class WebGPUTextureUtils {
|
|
|
442
466
|
depthOrArrayLayers: ( image.depth !== undefined ) ? image.depth : 1
|
|
443
467
|
} );
|
|
444
468
|
|
|
469
|
+
if ( flipY === true ) {
|
|
470
|
+
|
|
471
|
+
this._flipY( textureGPU, textureDescriptorGPU, originDepth );
|
|
472
|
+
|
|
473
|
+
}
|
|
474
|
+
|
|
445
475
|
}
|
|
446
476
|
|
|
447
477
|
_copyCompressedBufferToTexture( mipmaps, textureGPU, textureDescriptorGPU ) {
|
|
@@ -619,237 +649,237 @@ class WebGPUTextureUtils {
|
|
|
619
649
|
|
|
620
650
|
}
|
|
621
651
|
|
|
622
|
-
|
|
652
|
+
}
|
|
623
653
|
|
|
624
|
-
|
|
625
|
-
const type = texture.type;
|
|
626
|
-
const colorSpace = texture.colorSpace;
|
|
654
|
+
export function getFormat( texture, device = null ) {
|
|
627
655
|
|
|
628
|
-
|
|
656
|
+
const format = texture.format;
|
|
657
|
+
const type = texture.type;
|
|
658
|
+
const colorSpace = texture.colorSpace;
|
|
629
659
|
|
|
630
|
-
|
|
660
|
+
let formatGPU;
|
|
631
661
|
|
|
632
|
-
|
|
662
|
+
if ( /*texture.isRenderTargetTexture === true ||*/ texture.isFramebufferTexture === true ) {
|
|
633
663
|
|
|
634
|
-
|
|
664
|
+
formatGPU = GPUTextureFormat.BGRA8Unorm;
|
|
635
665
|
|
|
636
|
-
|
|
666
|
+
} else if ( texture.isCompressedTexture === true ) {
|
|
637
667
|
|
|
638
|
-
|
|
639
|
-
formatGPU = ( colorSpace === SRGBColorSpace ) ? GPUTextureFormat.BC1RGBAUnormSRGB : GPUTextureFormat.BC1RGBAUnorm;
|
|
640
|
-
break;
|
|
668
|
+
switch ( format ) {
|
|
641
669
|
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
670
|
+
case RGBA_S3TC_DXT1_Format:
|
|
671
|
+
formatGPU = ( colorSpace === SRGBColorSpace ) ? GPUTextureFormat.BC1RGBAUnormSRGB : GPUTextureFormat.BC1RGBAUnorm;
|
|
672
|
+
break;
|
|
645
673
|
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
674
|
+
case RGBA_S3TC_DXT3_Format:
|
|
675
|
+
formatGPU = ( colorSpace === SRGBColorSpace ) ? GPUTextureFormat.BC2RGBAUnormSRGB : GPUTextureFormat.BC2RGBAUnorm;
|
|
676
|
+
break;
|
|
649
677
|
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
678
|
+
case RGBA_S3TC_DXT5_Format:
|
|
679
|
+
formatGPU = ( colorSpace === SRGBColorSpace ) ? GPUTextureFormat.BC3RGBAUnormSRGB : GPUTextureFormat.BC3RGBAUnorm;
|
|
680
|
+
break;
|
|
653
681
|
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
682
|
+
case RGB_ETC2_Format:
|
|
683
|
+
formatGPU = ( colorSpace === SRGBColorSpace ) ? GPUTextureFormat.ETC2RGB8UnormSRGB : GPUTextureFormat.ETC2RGB8Unorm;
|
|
684
|
+
break;
|
|
657
685
|
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
686
|
+
case RGBA_ETC2_EAC_Format:
|
|
687
|
+
formatGPU = ( colorSpace === SRGBColorSpace ) ? GPUTextureFormat.ETC2RGBA8UnormSRGB : GPUTextureFormat.ETC2RGBA8Unorm;
|
|
688
|
+
break;
|
|
661
689
|
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
690
|
+
case RGBA_ASTC_4x4_Format:
|
|
691
|
+
formatGPU = ( colorSpace === SRGBColorSpace ) ? GPUTextureFormat.ASTC4x4UnormSRGB : GPUTextureFormat.ASTC4x4Unorm;
|
|
692
|
+
break;
|
|
665
693
|
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
694
|
+
case RGBA_ASTC_5x4_Format:
|
|
695
|
+
formatGPU = ( colorSpace === SRGBColorSpace ) ? GPUTextureFormat.ASTC5x4UnormSRGB : GPUTextureFormat.ASTC5x4Unorm;
|
|
696
|
+
break;
|
|
669
697
|
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
698
|
+
case RGBA_ASTC_5x5_Format:
|
|
699
|
+
formatGPU = ( colorSpace === SRGBColorSpace ) ? GPUTextureFormat.ASTC5x5UnormSRGB : GPUTextureFormat.ASTC5x5Unorm;
|
|
700
|
+
break;
|
|
673
701
|
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
702
|
+
case RGBA_ASTC_6x5_Format:
|
|
703
|
+
formatGPU = ( colorSpace === SRGBColorSpace ) ? GPUTextureFormat.ASTC6x5UnormSRGB : GPUTextureFormat.ASTC6x5Unorm;
|
|
704
|
+
break;
|
|
677
705
|
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
706
|
+
case RGBA_ASTC_6x6_Format:
|
|
707
|
+
formatGPU = ( colorSpace === SRGBColorSpace ) ? GPUTextureFormat.ASTC6x6UnormSRGB : GPUTextureFormat.ASTC6x6Unorm;
|
|
708
|
+
break;
|
|
681
709
|
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
710
|
+
case RGBA_ASTC_8x5_Format:
|
|
711
|
+
formatGPU = ( colorSpace === SRGBColorSpace ) ? GPUTextureFormat.ASTC8x5UnormSRGB : GPUTextureFormat.ASTC8x5Unorm;
|
|
712
|
+
break;
|
|
685
713
|
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
714
|
+
case RGBA_ASTC_8x6_Format:
|
|
715
|
+
formatGPU = ( colorSpace === SRGBColorSpace ) ? GPUTextureFormat.ASTC8x6UnormSRGB : GPUTextureFormat.ASTC8x6Unorm;
|
|
716
|
+
break;
|
|
689
717
|
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
718
|
+
case RGBA_ASTC_8x8_Format:
|
|
719
|
+
formatGPU = ( colorSpace === SRGBColorSpace ) ? GPUTextureFormat.ASTC8x8UnormSRGB : GPUTextureFormat.ASTC8x8Unorm;
|
|
720
|
+
break;
|
|
693
721
|
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
722
|
+
case RGBA_ASTC_10x5_Format:
|
|
723
|
+
formatGPU = ( colorSpace === SRGBColorSpace ) ? GPUTextureFormat.ASTC10x5UnormSRGB : GPUTextureFormat.ASTC10x5Unorm;
|
|
724
|
+
break;
|
|
697
725
|
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
726
|
+
case RGBA_ASTC_10x6_Format:
|
|
727
|
+
formatGPU = ( colorSpace === SRGBColorSpace ) ? GPUTextureFormat.ASTC10x6UnormSRGB : GPUTextureFormat.ASTC10x6Unorm;
|
|
728
|
+
break;
|
|
701
729
|
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
730
|
+
case RGBA_ASTC_10x8_Format:
|
|
731
|
+
formatGPU = ( colorSpace === SRGBColorSpace ) ? GPUTextureFormat.ASTC10x8UnormSRGB : GPUTextureFormat.ASTC10x8Unorm;
|
|
732
|
+
break;
|
|
705
733
|
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
734
|
+
case RGBA_ASTC_10x10_Format:
|
|
735
|
+
formatGPU = ( colorSpace === SRGBColorSpace ) ? GPUTextureFormat.ASTC10x10UnormSRGB : GPUTextureFormat.ASTC10x10Unorm;
|
|
736
|
+
break;
|
|
709
737
|
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
738
|
+
case RGBA_ASTC_12x10_Format:
|
|
739
|
+
formatGPU = ( colorSpace === SRGBColorSpace ) ? GPUTextureFormat.ASTC12x10UnormSRGB : GPUTextureFormat.ASTC12x10Unorm;
|
|
740
|
+
break;
|
|
713
741
|
|
|
714
|
-
|
|
715
|
-
|
|
742
|
+
case RGBA_ASTC_12x12_Format:
|
|
743
|
+
formatGPU = ( colorSpace === SRGBColorSpace ) ? GPUTextureFormat.ASTC12x12UnormSRGB : GPUTextureFormat.ASTC12x12Unorm;
|
|
744
|
+
break;
|
|
716
745
|
|
|
717
|
-
|
|
746
|
+
default:
|
|
747
|
+
console.error( 'WebGPURenderer: Unsupported texture format.', format );
|
|
718
748
|
|
|
719
|
-
}
|
|
749
|
+
}
|
|
720
750
|
|
|
721
|
-
|
|
751
|
+
} else {
|
|
722
752
|
|
|
723
|
-
|
|
753
|
+
switch ( format ) {
|
|
724
754
|
|
|
725
|
-
|
|
755
|
+
case RGBAFormat:
|
|
726
756
|
|
|
727
|
-
|
|
728
|
-
formatGPU = ( colorSpace === SRGBColorSpace ) ? GPUTextureFormat.RGBA8UnormSRGB : GPUTextureFormat.RGBA8Unorm;
|
|
729
|
-
break;
|
|
757
|
+
switch ( type ) {
|
|
730
758
|
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
759
|
+
case UnsignedByteType:
|
|
760
|
+
formatGPU = ( colorSpace === SRGBColorSpace ) ? GPUTextureFormat.RGBA8UnormSRGB : GPUTextureFormat.RGBA8Unorm;
|
|
761
|
+
break;
|
|
734
762
|
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
763
|
+
case HalfFloatType:
|
|
764
|
+
formatGPU = GPUTextureFormat.RGBA16Float;
|
|
765
|
+
break;
|
|
738
766
|
|
|
739
|
-
|
|
740
|
-
|
|
767
|
+
case FloatType:
|
|
768
|
+
formatGPU = GPUTextureFormat.RGBA32Float;
|
|
769
|
+
break;
|
|
741
770
|
|
|
742
|
-
|
|
771
|
+
default:
|
|
772
|
+
console.error( 'WebGPURenderer: Unsupported texture type with RGBAFormat.', type );
|
|
743
773
|
|
|
744
|
-
|
|
774
|
+
}
|
|
745
775
|
|
|
746
|
-
|
|
776
|
+
break;
|
|
747
777
|
|
|
748
|
-
|
|
778
|
+
case RedFormat:
|
|
749
779
|
|
|
750
|
-
|
|
751
|
-
formatGPU = GPUTextureFormat.R8Unorm;
|
|
752
|
-
break;
|
|
780
|
+
switch ( type ) {
|
|
753
781
|
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
782
|
+
case UnsignedByteType:
|
|
783
|
+
formatGPU = GPUTextureFormat.R8Unorm;
|
|
784
|
+
break;
|
|
757
785
|
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
786
|
+
case HalfFloatType:
|
|
787
|
+
formatGPU = GPUTextureFormat.R16Float;
|
|
788
|
+
break;
|
|
761
789
|
|
|
762
|
-
|
|
763
|
-
|
|
790
|
+
case FloatType:
|
|
791
|
+
formatGPU = GPUTextureFormat.R32Float;
|
|
792
|
+
break;
|
|
764
793
|
|
|
765
|
-
|
|
794
|
+
default:
|
|
795
|
+
console.error( 'WebGPURenderer: Unsupported texture type with RedFormat.', type );
|
|
766
796
|
|
|
767
|
-
|
|
797
|
+
}
|
|
768
798
|
|
|
769
|
-
|
|
799
|
+
break;
|
|
770
800
|
|
|
771
|
-
|
|
801
|
+
case RGFormat:
|
|
772
802
|
|
|
773
|
-
|
|
774
|
-
formatGPU = GPUTextureFormat.RG8Unorm;
|
|
775
|
-
break;
|
|
803
|
+
switch ( type ) {
|
|
776
804
|
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
805
|
+
case UnsignedByteType:
|
|
806
|
+
formatGPU = GPUTextureFormat.RG8Unorm;
|
|
807
|
+
break;
|
|
780
808
|
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
809
|
+
case HalfFloatType:
|
|
810
|
+
formatGPU = GPUTextureFormat.RG16Float;
|
|
811
|
+
break;
|
|
784
812
|
|
|
785
|
-
|
|
786
|
-
|
|
813
|
+
case FloatType:
|
|
814
|
+
formatGPU = GPUTextureFormat.RG32Float;
|
|
815
|
+
break;
|
|
787
816
|
|
|
788
|
-
|
|
817
|
+
default:
|
|
818
|
+
console.error( 'WebGPURenderer: Unsupported texture type with RGFormat.', type );
|
|
789
819
|
|
|
790
|
-
|
|
820
|
+
}
|
|
791
821
|
|
|
792
|
-
|
|
822
|
+
break;
|
|
793
823
|
|
|
794
|
-
|
|
824
|
+
case DepthFormat:
|
|
795
825
|
|
|
796
|
-
|
|
797
|
-
formatGPU = GPUTextureFormat.Depth16Unorm;
|
|
798
|
-
break;
|
|
826
|
+
switch ( type ) {
|
|
799
827
|
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
828
|
+
case UnsignedShortType:
|
|
829
|
+
formatGPU = GPUTextureFormat.Depth16Unorm;
|
|
830
|
+
break;
|
|
803
831
|
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
832
|
+
case UnsignedIntType:
|
|
833
|
+
formatGPU = GPUTextureFormat.Depth24Plus;
|
|
834
|
+
break;
|
|
807
835
|
|
|
808
|
-
|
|
809
|
-
|
|
836
|
+
case FloatType:
|
|
837
|
+
formatGPU = GPUTextureFormat.Depth32Float;
|
|
838
|
+
break;
|
|
810
839
|
|
|
811
|
-
|
|
840
|
+
default:
|
|
841
|
+
console.error( 'WebGPURenderer: Unsupported texture type with DepthFormat.', type );
|
|
812
842
|
|
|
813
|
-
|
|
843
|
+
}
|
|
814
844
|
|
|
815
|
-
|
|
845
|
+
break;
|
|
816
846
|
|
|
817
|
-
|
|
847
|
+
case DepthStencilFormat:
|
|
818
848
|
|
|
819
|
-
|
|
820
|
-
formatGPU = GPUTextureFormat.Depth24PlusStencil8;
|
|
821
|
-
break;
|
|
849
|
+
switch ( type ) {
|
|
822
850
|
|
|
823
|
-
|
|
851
|
+
case UnsignedInt248Type:
|
|
852
|
+
formatGPU = GPUTextureFormat.Depth24PlusStencil8;
|
|
853
|
+
break;
|
|
824
854
|
|
|
825
|
-
|
|
855
|
+
case FloatType:
|
|
826
856
|
|
|
827
|
-
|
|
857
|
+
if ( device && device.features.has( GPUFeatureName.Depth32FloatStencil8 ) === false ) {
|
|
828
858
|
|
|
829
|
-
|
|
859
|
+
console.error( 'WebGPURenderer: Depth textures with DepthStencilFormat + FloatType can only be used with the "depth32float-stencil8" GPU feature.' );
|
|
830
860
|
|
|
831
|
-
|
|
861
|
+
}
|
|
832
862
|
|
|
833
|
-
|
|
863
|
+
formatGPU = GPUTextureFormat.Depth32FloatStencil8;
|
|
834
864
|
|
|
835
|
-
|
|
836
|
-
console.error( 'WebGPURenderer: Unsupported texture type with DepthStencilFormat.', type );
|
|
865
|
+
break;
|
|
837
866
|
|
|
838
|
-
|
|
867
|
+
default:
|
|
868
|
+
console.error( 'WebGPURenderer: Unsupported texture type with DepthStencilFormat.', type );
|
|
839
869
|
|
|
840
|
-
|
|
870
|
+
}
|
|
841
871
|
|
|
842
|
-
|
|
843
|
-
console.error( 'WebGPURenderer: Unsupported texture format.', format );
|
|
872
|
+
break;
|
|
844
873
|
|
|
845
|
-
|
|
874
|
+
default:
|
|
875
|
+
console.error( 'WebGPURenderer: Unsupported texture format.', format );
|
|
846
876
|
|
|
847
877
|
}
|
|
848
878
|
|
|
849
|
-
return formatGPU;
|
|
850
|
-
|
|
851
879
|
}
|
|
852
880
|
|
|
881
|
+
return formatGPU;
|
|
882
|
+
|
|
853
883
|
}
|
|
854
884
|
|
|
855
885
|
export default WebGPUTextureUtils;
|
|
@@ -27,17 +27,17 @@ struct BlinnPhongMaterial {
|
|
|
27
27
|
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in
|
|
30
|
+
void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
|
|
31
31
|
|
|
32
|
-
vec3 irradiance = getGradientIrradiance(
|
|
32
|
+
vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;
|
|
33
33
|
|
|
34
34
|
reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
|
|
35
35
|
|
|
36
|
-
reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction,
|
|
36
|
+
reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;
|
|
37
37
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in
|
|
40
|
+
void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
|
|
41
41
|
|
|
42
42
|
reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
|
|
43
43
|
|
|
@@ -57,10 +57,10 @@ const SubsurfaceScatteringShader = {
|
|
|
57
57
|
'uniform float thicknessAttenuation;',
|
|
58
58
|
'uniform vec3 thicknessColor;',
|
|
59
59
|
|
|
60
|
-
'void RE_Direct_Scattering(const in IncidentLight directLight, const in vec2 uv, const in
|
|
60
|
+
'void RE_Direct_Scattering(const in IncidentLight directLight, const in vec2 uv, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, inout ReflectedLight reflectedLight) {',
|
|
61
61
|
' vec3 thickness = thicknessColor * texture2D(thicknessMap, uv).r;',
|
|
62
|
-
' vec3 scatteringHalf = normalize(directLight.direction + (
|
|
63
|
-
' float scatteringDot = pow(saturate(dot(
|
|
62
|
+
' vec3 scatteringHalf = normalize(directLight.direction + (geometryNormal * thicknessDistortion));',
|
|
63
|
+
' float scatteringDot = pow(saturate(dot(geometryViewDir, -scatteringHalf)), thicknessPower) * thicknessScale;',
|
|
64
64
|
' vec3 scatteringIllu = (scatteringDot + thicknessAmbient) * thickness;',
|
|
65
65
|
' reflectedLight.directDiffuse += scatteringIllu * thicknessAttenuation * directLight.color;',
|
|
66
66
|
'}',
|
|
@@ -69,12 +69,12 @@ const SubsurfaceScatteringShader = {
|
|
|
69
69
|
|
|
70
70
|
replaceAll(
|
|
71
71
|
ShaderChunk[ 'lights_fragment_begin' ],
|
|
72
|
-
'RE_Direct( directLight,
|
|
72
|
+
'RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );',
|
|
73
73
|
[
|
|
74
|
-
'RE_Direct( directLight,
|
|
74
|
+
'RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );',
|
|
75
75
|
|
|
76
76
|
'#if defined( SUBSURFACE ) && defined( USE_UV )',
|
|
77
|
-
' RE_Direct_Scattering(directLight, vUv,
|
|
77
|
+
' RE_Direct_Scattering(directLight, vUv, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, reflectedLight);',
|
|
78
78
|
'#endif',
|
|
79
79
|
].join( '\n' )
|
|
80
80
|
),
|
|
@@ -555,7 +555,7 @@ export function deinterleaveGeometry( geometry ) {
|
|
|
555
555
|
}
|
|
556
556
|
|
|
557
557
|
/**
|
|
558
|
-
* @param {
|
|
558
|
+
* @param {BufferGeometry} geometry
|
|
559
559
|
* @return {number}
|
|
560
560
|
*/
|
|
561
561
|
function estimateBytesUsed( geometry ) {
|
|
@@ -631,8 +631,10 @@ function mergeVertices( geometry, tolerance = 1e-4 ) {
|
|
|
631
631
|
}
|
|
632
632
|
|
|
633
633
|
// convert the error tolerance to an amount of decimal places to truncate to
|
|
634
|
-
const
|
|
635
|
-
const
|
|
634
|
+
const halfTolerance = tolerance * 0.5;
|
|
635
|
+
const exponent = Math.log10( 1 / tolerance );
|
|
636
|
+
const hashMultiplier = Math.pow( 10, exponent );
|
|
637
|
+
const hashAdditive = halfTolerance * hashMultiplier;
|
|
636
638
|
for ( let i = 0; i < vertexCount; i ++ ) {
|
|
637
639
|
|
|
638
640
|
const index = indices ? indices.getX( i ) : i;
|
|
@@ -648,7 +650,7 @@ function mergeVertices( geometry, tolerance = 1e-4 ) {
|
|
|
648
650
|
for ( let k = 0; k < itemSize; k ++ ) {
|
|
649
651
|
|
|
650
652
|
// double tilde truncates the decimal value
|
|
651
|
-
hash += `${ ~ ~ ( attribute[ getters[ k ] ]( index ) *
|
|
653
|
+
hash += `${ ~ ~ ( attribute[ getters[ k ] ]( index ) * hashMultiplier + hashAdditive ) },`;
|
|
652
654
|
|
|
653
655
|
}
|
|
654
656
|
|