super-three 0.163.0 → 0.165.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/README.md +3 -3
- package/build/three.cjs +1127 -452
- package/build/three.module.js +1127 -452
- package/build/three.module.min.js +2 -2
- package/examples/jsm/animation/CCDIKSolver.js +4 -2
- package/examples/jsm/controls/TransformControls.js +1 -1
- package/examples/jsm/environments/RoomEnvironment.js +1 -5
- package/examples/jsm/exporters/GLTFExporter.js +45 -1
- package/examples/jsm/exporters/USDZExporter.js +13 -5
- package/examples/jsm/helpers/ViewHelper.js +32 -67
- package/examples/jsm/libs/draco/README.md +2 -2
- package/examples/jsm/libs/tween.module.js +75 -64
- package/examples/jsm/lines/LineMaterial.js +1 -15
- package/examples/jsm/lines/LineSegments2.js +15 -0
- package/examples/jsm/lines/Wireframe.js +16 -1
- package/examples/jsm/loaders/DRACOLoader.js +1 -1
- package/examples/jsm/loaders/EXRLoader.js +283 -99
- package/examples/jsm/loaders/FBXLoader.js +24 -13
- package/examples/jsm/loaders/GLTFLoader.js +55 -0
- package/examples/jsm/loaders/KTX2Loader.js +3 -6
- package/examples/jsm/loaders/LDrawLoader.js +3 -2
- package/examples/jsm/loaders/MMDLoader.js +31 -12
- package/examples/jsm/loaders/VRMLLoader.js +1 -1
- package/examples/jsm/loaders/lwo/IFFParser.js +8 -5
- package/examples/jsm/materials/MeshGouraudMaterial.js +7 -1
- package/examples/jsm/math/Octree.js +26 -20
- package/examples/jsm/modifiers/CurveModifier.js +11 -9
- package/examples/jsm/nodes/Nodes.js +15 -13
- package/examples/jsm/nodes/accessors/AccessorsUtils.js +16 -1
- package/examples/jsm/nodes/accessors/BitangentNode.js +7 -83
- package/examples/jsm/nodes/accessors/BufferNode.js +6 -0
- package/examples/jsm/nodes/accessors/CameraNode.js +12 -119
- package/examples/jsm/nodes/accessors/ClippingNode.js +3 -2
- package/examples/jsm/nodes/accessors/MaterialNode.js +109 -3
- package/examples/jsm/nodes/accessors/ModelNode.js +3 -0
- package/examples/jsm/nodes/accessors/NormalNode.js +9 -101
- package/examples/jsm/nodes/accessors/PositionNode.js +6 -100
- package/examples/jsm/nodes/accessors/ReferenceNode.js +6 -0
- package/examples/jsm/nodes/accessors/ReflectVectorNode.js +2 -31
- package/examples/jsm/nodes/accessors/StorageBufferNode.js +9 -0
- package/examples/jsm/nodes/accessors/{TextureStoreNode.js → StorageTextureNode.js} +19 -6
- package/examples/jsm/nodes/accessors/TangentNode.js +11 -97
- package/examples/jsm/nodes/accessors/Texture3DNode.js +100 -0
- package/examples/jsm/nodes/accessors/TextureNode.js +21 -3
- package/examples/jsm/nodes/accessors/TextureSizeNode.js +1 -1
- package/examples/jsm/nodes/accessors/UVNode.js +2 -46
- package/examples/jsm/nodes/code/FunctionNode.js +0 -8
- package/examples/jsm/nodes/core/AttributeNode.js +15 -3
- package/examples/jsm/nodes/core/ContextNode.js +6 -0
- package/examples/jsm/nodes/core/Node.js +23 -2
- package/examples/jsm/nodes/core/NodeBuilder.js +25 -18
- package/examples/jsm/nodes/core/NodeKeywords.js +1 -1
- package/examples/jsm/nodes/core/OutputStructNode.js +3 -6
- package/examples/jsm/nodes/core/PropertyNode.js +11 -0
- package/examples/jsm/nodes/core/VaryingNode.js +40 -9
- package/examples/jsm/nodes/display/AfterImageNode.js +14 -2
- package/examples/jsm/nodes/display/BumpMapNode.js +7 -26
- package/examples/jsm/nodes/display/FrontFacingNode.js +13 -0
- package/examples/jsm/nodes/display/PassNode.js +3 -1
- package/examples/jsm/nodes/display/ViewportDepthNode.js +1 -1
- package/examples/jsm/nodes/display/ViewportNode.js +5 -3
- package/examples/jsm/nodes/display/ViewportTextureNode.js +4 -1
- package/examples/jsm/nodes/functions/BSDF/BRDF_GGX.js +26 -7
- package/examples/jsm/nodes/functions/BSDF/D_GGX_Anisotropic.js +28 -0
- package/examples/jsm/nodes/functions/BSDF/V_GGX_SmithCorrelated.js +1 -3
- package/examples/jsm/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.js +29 -0
- package/examples/jsm/nodes/functions/PhongLightingModel.js +1 -1
- package/examples/jsm/nodes/functions/PhysicalLightingModel.js +210 -12
- package/examples/jsm/nodes/functions/ShadowMaskModel.js +31 -0
- package/examples/jsm/nodes/functions/ToonLightingModel.js +49 -0
- package/examples/jsm/nodes/lighting/AnalyticLightNode.js +20 -5
- package/examples/jsm/nodes/lighting/DirectionalLightNode.js +2 -1
- package/examples/jsm/nodes/lighting/EnvironmentNode.js +11 -2
- package/examples/jsm/nodes/lighting/IrradianceNode.js +24 -0
- package/examples/jsm/nodes/lighting/LightsNode.js +28 -1
- package/examples/jsm/nodes/lighting/PointLightNode.js +2 -1
- package/examples/jsm/nodes/lighting/SpotLightNode.js +2 -1
- package/examples/jsm/nodes/materials/Line2NodeMaterial.js +11 -7
- package/examples/jsm/nodes/materials/Materials.js +4 -0
- package/examples/jsm/nodes/materials/MeshMatcapNodeMaterial.js +52 -0
- package/examples/jsm/nodes/materials/MeshNormalNodeMaterial.js +0 -2
- package/examples/jsm/nodes/materials/MeshPhongNodeMaterial.js +2 -2
- package/examples/jsm/nodes/materials/MeshPhysicalNodeMaterial.js +94 -6
- package/examples/jsm/nodes/materials/MeshStandardNodeMaterial.js +11 -4
- package/examples/jsm/nodes/materials/MeshToonNodeMaterial.js +34 -0
- package/examples/jsm/nodes/materials/NodeMaterial.js +43 -45
- package/examples/jsm/nodes/materials/ShadowNodeMaterial.js +34 -0
- package/examples/jsm/nodes/materials/VolumeNodeMaterial.js +106 -0
- package/examples/jsm/nodes/math/HashNode.js +2 -2
- package/examples/jsm/nodes/pmrem/PMREMUtils.js +1 -1
- package/examples/jsm/nodes/shadernode/ShaderNode.js +57 -41
- package/examples/jsm/nodes/utils/ArrayElementNode.js +1 -1
- package/examples/jsm/nodes/utils/MatcapUVNode.js +1 -1
- package/examples/jsm/nodes/utils/TimerNode.js +1 -1
- package/examples/jsm/objects/Lensflare.js +2 -2
- package/examples/jsm/physics/JoltPhysics.js +281 -0
- package/examples/jsm/postprocessing/RenderPass.js +1 -1
- package/examples/jsm/postprocessing/RenderTransitionPass.js +193 -0
- package/examples/jsm/renderers/CSS2DRenderer.js +25 -5
- package/examples/jsm/renderers/CSS3DRenderer.js +24 -3
- package/examples/jsm/renderers/common/Attributes.js +2 -0
- package/examples/jsm/renderers/common/Background.js +3 -3
- package/examples/jsm/renderers/common/Bindings.js +17 -0
- package/examples/jsm/renderers/common/ChainMap.js +18 -48
- package/examples/jsm/renderers/common/ClippingContext.js +5 -5
- package/examples/jsm/renderers/common/Pipelines.js +2 -2
- package/examples/jsm/renderers/common/RenderBundle.js +18 -0
- package/examples/jsm/renderers/common/RenderBundles.js +38 -0
- package/examples/jsm/renderers/common/RenderList.js +10 -1
- package/examples/jsm/renderers/common/RenderObject.js +49 -1
- package/examples/jsm/renderers/common/Renderer.js +268 -25
- package/examples/jsm/renderers/common/Textures.js +1 -1
- package/examples/jsm/renderers/common/Uniform.js +1 -1
- package/examples/jsm/renderers/common/extras/PMREMGenerator.js +13 -17
- package/examples/jsm/renderers/common/nodes/NodeSampledTexture.js +18 -4
- package/examples/jsm/renderers/common/nodes/NodeSampler.js +6 -0
- package/examples/jsm/renderers/common/nodes/Nodes.js +31 -47
- package/examples/jsm/renderers/webgl/WebGLBackend.js +7 -21
- package/examples/jsm/renderers/webgl/WebGLBufferRenderer.js +5 -1
- package/examples/jsm/renderers/webgl/nodes/GLSLNodeBuilder.js +23 -5
- package/examples/jsm/renderers/webgl/utils/WebGLTextureUtils.js +114 -13
- package/examples/jsm/renderers/webgl/utils/WebGLUtils.js +3 -21
- package/examples/jsm/renderers/webgpu/WebGPUBackend.js +80 -46
- package/examples/jsm/renderers/webgpu/nodes/WGSLNodeBuilder.js +85 -12
- package/examples/jsm/renderers/webgpu/utils/WebGPUAttributeUtils.js +4 -1
- package/examples/jsm/renderers/webgpu/utils/WebGPUBindingUtils.js +10 -1
- package/examples/jsm/renderers/webgpu/utils/WebGPUConstants.js +6 -0
- package/examples/jsm/renderers/webgpu/utils/WebGPUPipelineUtils.js +62 -19
- package/examples/jsm/renderers/webgpu/utils/WebGPUTextureUtils.js +62 -3
- package/examples/jsm/transpiler/GLSLDecoder.js +1 -1
- package/examples/jsm/transpiler/ShaderToyDecoder.js +1 -1
- package/examples/jsm/utils/BufferGeometryUtils.js +18 -16
- package/examples/jsm/utils/GPUStatsPanel.js +2 -0
- package/examples/jsm/utils/SceneUtils.js +60 -1
- package/examples/jsm/utils/SortUtils.js +8 -5
- package/examples/jsm/webxr/OculusHandModel.js +3 -2
- package/examples/jsm/webxr/XRHandModelFactory.js +4 -2
- package/package.json +3 -2
- package/src/animation/tracks/BooleanKeyframeTrack.js +10 -1
- package/src/animation/tracks/QuaternionKeyframeTrack.js +1 -2
- package/src/animation/tracks/StringKeyframeTrack.js +10 -1
- package/src/constants.js +1 -1
- package/src/core/Object3D.js +2 -0
- package/src/core/Raycaster.js +6 -2
- package/src/core/RenderTarget.js +8 -0
- package/src/extras/PMREMGenerator.js +12 -11
- package/src/loaders/FileLoader.js +5 -1
- package/src/loaders/LoaderUtils.js +3 -1
- package/src/loaders/MaterialLoader.js +1 -0
- package/src/loaders/ObjectLoader.js +1 -0
- package/src/materials/Material.js +2 -0
- package/src/materials/MeshPhysicalMaterial.js +20 -0
- package/src/objects/BatchedMesh.js +114 -1
- package/src/objects/Line.js +66 -43
- package/src/renderers/WebGLRenderer.js +371 -109
- package/src/renderers/shaders/ShaderChunk/batching_pars_vertex.glsl.js +15 -0
- package/src/renderers/shaders/ShaderChunk/color_pars_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/color_vertex.glsl.js +9 -1
- package/src/renderers/shaders/ShaderChunk/lights_pars_begin.glsl.js +8 -22
- package/src/renderers/shaders/ShaderChunk/lights_physical_fragment.glsl.js +6 -0
- package/src/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js +1 -0
- package/src/renderers/shaders/ShaderChunk/morphcolor_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/morphinstance_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/morphnormal_vertex.glsl.js +3 -14
- package/src/renderers/shaders/ShaderChunk/morphtarget_pars_vertex.glsl.js +10 -31
- package/src/renderers/shaders/ShaderChunk/morphtarget_vertex.glsl.js +3 -23
- package/src/renderers/shaders/ShaderChunk/tonemapping_pars_fragment.glsl.js +17 -9
- package/src/renderers/shaders/ShaderChunk/transmission_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/transmission_pars_fragment.glsl.js +47 -13
- package/src/renderers/shaders/ShaderChunk.js +0 -2
- package/src/renderers/shaders/ShaderLib/meshphysical.glsl.js +4 -0
- package/src/renderers/shaders/ShaderLib.js +1 -0
- package/src/renderers/webgl/WebGLBackground.js +24 -3
- package/src/renderers/webgl/WebGLBufferRenderer.js +36 -0
- package/src/renderers/webgl/WebGLCapabilities.js +33 -1
- package/src/renderers/webgl/WebGLExtensions.js +3 -1
- package/src/renderers/webgl/WebGLIndexedBufferRenderer.js +36 -0
- package/src/renderers/webgl/WebGLLights.js +9 -12
- package/src/renderers/webgl/WebGLMaterials.js +7 -5
- package/src/renderers/webgl/WebGLMorphtargets.js +1 -2
- package/src/renderers/webgl/WebGLProgram.js +5 -36
- package/src/renderers/webgl/WebGLPrograms.js +19 -14
- package/src/renderers/webgl/WebGLRenderStates.js +8 -4
- package/src/renderers/webgl/WebGLShadowMap.js +25 -25
- package/src/renderers/webgl/WebGLTextures.js +206 -129
- package/src/renderers/webgl/WebGLUtils.js +3 -21
- package/src/renderers/webxr/WebXRDepthSensing.js +3 -3
- package/src/renderers/webxr/WebXRManager.js +8 -6
- package/src/textures/CompressedArrayTexture.js +14 -0
- package/src/textures/DataArrayTexture.js +14 -0
- package/src/textures/DepthTexture.js +1 -3
- package/src/utils.js +30 -1
- package/examples/jsm/renderers/webgl-legacy/nodes/GLSL1NodeBuilder.js +0 -318
- package/examples/jsm/renderers/webgl-legacy/nodes/SlotNode.js +0 -26
- package/examples/jsm/renderers/webgl-legacy/nodes/WebGLNodeBuilder.js +0 -792
- package/examples/jsm/renderers/webgl-legacy/nodes/WebGLNodes.js +0 -51
- package/src/renderers/shaders/ShaderChunk/lightmap_fragment.glsl.js +0 -10
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from './WebGPUConstants.js';
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
|
-
CubeTexture, Texture,
|
|
6
|
+
ByteType, ShortType, CubeTexture, Texture,
|
|
7
7
|
NearestFilter, NearestMipmapNearestFilter, NearestMipmapLinearFilter,
|
|
8
8
|
RepeatWrapping, MirroredRepeatWrapping,
|
|
9
9
|
RGB_ETC2_Format, RGBA_ETC2_EAC_Format,
|
|
@@ -327,11 +327,11 @@ class WebGPUTextureUtils {
|
|
|
327
327
|
|
|
328
328
|
// transfer texture data
|
|
329
329
|
|
|
330
|
-
if ( texture.isDataTexture
|
|
330
|
+
if ( texture.isDataTexture ) {
|
|
331
331
|
|
|
332
332
|
this._copyBufferToTexture( options.image, textureData.texture, textureDescriptorGPU, 0, texture.flipY );
|
|
333
333
|
|
|
334
|
-
} else if ( texture.isDataArrayTexture ) {
|
|
334
|
+
} else if ( texture.isDataArrayTexture || texture.isData3DTexture ) {
|
|
335
335
|
|
|
336
336
|
for ( let i = 0; i < options.image.depth; i ++ ) {
|
|
337
337
|
|
|
@@ -913,6 +913,25 @@ export function getFormat( texture, device = null ) {
|
|
|
913
913
|
|
|
914
914
|
switch ( type ) {
|
|
915
915
|
|
|
916
|
+
case ByteType:
|
|
917
|
+
formatGPU = GPUTextureFormat.RGBA8Snorm;
|
|
918
|
+
break;
|
|
919
|
+
|
|
920
|
+
case ShortType:
|
|
921
|
+
formatGPU = GPUTextureFormat.RGBA16Sint;
|
|
922
|
+
break;
|
|
923
|
+
|
|
924
|
+
case UnsignedShortType:
|
|
925
|
+
formatGPU = GPUTextureFormat.RGBA16Uint;
|
|
926
|
+
break;
|
|
927
|
+
case UnsignedIntType:
|
|
928
|
+
formatGPU = GPUTextureFormat.RGBA32Uint;
|
|
929
|
+
break;
|
|
930
|
+
|
|
931
|
+
case IntType:
|
|
932
|
+
formatGPU = GPUTextureFormat.RGBA32Sint;
|
|
933
|
+
break;
|
|
934
|
+
|
|
916
935
|
case UnsignedByteType:
|
|
917
936
|
formatGPU = ( colorSpace === SRGBColorSpace ) ? GPUTextureFormat.RGBA8UnormSRGB : GPUTextureFormat.RGBA8Unorm;
|
|
918
937
|
break;
|
|
@@ -951,6 +970,26 @@ export function getFormat( texture, device = null ) {
|
|
|
951
970
|
|
|
952
971
|
switch ( type ) {
|
|
953
972
|
|
|
973
|
+
case ByteType:
|
|
974
|
+
formatGPU = GPUTextureFormat.R8Snorm;
|
|
975
|
+
break;
|
|
976
|
+
|
|
977
|
+
case ShortType:
|
|
978
|
+
formatGPU = GPUTextureFormat.R16Sint;
|
|
979
|
+
break;
|
|
980
|
+
|
|
981
|
+
case UnsignedShortType:
|
|
982
|
+
formatGPU = GPUTextureFormat.R16Uint;
|
|
983
|
+
break;
|
|
984
|
+
|
|
985
|
+
case UnsignedIntType:
|
|
986
|
+
formatGPU = GPUTextureFormat.R32Uint;
|
|
987
|
+
break;
|
|
988
|
+
|
|
989
|
+
case IntType:
|
|
990
|
+
formatGPU = GPUTextureFormat.R32Sint;
|
|
991
|
+
break;
|
|
992
|
+
|
|
954
993
|
case UnsignedByteType:
|
|
955
994
|
formatGPU = GPUTextureFormat.R8Unorm;
|
|
956
995
|
break;
|
|
@@ -974,6 +1013,26 @@ export function getFormat( texture, device = null ) {
|
|
|
974
1013
|
|
|
975
1014
|
switch ( type ) {
|
|
976
1015
|
|
|
1016
|
+
case ByteType:
|
|
1017
|
+
formatGPU = GPUTextureFormat.RG8Snorm;
|
|
1018
|
+
break;
|
|
1019
|
+
|
|
1020
|
+
case ShortType:
|
|
1021
|
+
formatGPU = GPUTextureFormat.RG16Sint;
|
|
1022
|
+
break;
|
|
1023
|
+
|
|
1024
|
+
case UnsignedShortType:
|
|
1025
|
+
formatGPU = GPUTextureFormat.RG16Uint;
|
|
1026
|
+
break;
|
|
1027
|
+
|
|
1028
|
+
case UnsignedIntType:
|
|
1029
|
+
formatGPU = GPUTextureFormat.RG32Uint;
|
|
1030
|
+
break;
|
|
1031
|
+
|
|
1032
|
+
case IntType:
|
|
1033
|
+
formatGPU = GPUTextureFormat.RG32Sint;
|
|
1034
|
+
break;
|
|
1035
|
+
|
|
977
1036
|
case UnsignedByteType:
|
|
978
1037
|
formatGPU = GPUTextureFormat.RG8Unorm;
|
|
979
1038
|
break;
|
|
@@ -218,7 +218,7 @@ class GLSLDecoder {
|
|
|
218
218
|
|
|
219
219
|
this._currentFunction = null;
|
|
220
220
|
|
|
221
|
-
this.addPolyfill( 'gl_FragCoord', '
|
|
221
|
+
this.addPolyfill( 'gl_FragCoord', 'vec3 gl_FragCoord = vec3( viewportCoordinate.x, viewportCoordinate.y.oneMinus(), viewportCoordinate.z );' );
|
|
222
222
|
|
|
223
223
|
}
|
|
224
224
|
|
|
@@ -9,7 +9,7 @@ class ShaderToyDecoder extends GLSLDecoder {
|
|
|
9
9
|
|
|
10
10
|
this.addPolyfill( 'iTime', 'float iTime = timerGlobal();' );
|
|
11
11
|
this.addPolyfill( 'iResolution', 'vec2 iResolution = viewportResolution;' );
|
|
12
|
-
this.addPolyfill( 'fragCoord', '
|
|
12
|
+
this.addPolyfill( 'fragCoord', 'vec3 fragCoord = vec3( viewportCoordinate.x, viewportResolution.y - viewportCoordinate.y, viewportCoordinate.z );' );
|
|
13
13
|
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -623,20 +623,22 @@ function mergeVertices( geometry, tolerance = 1e-4 ) {
|
|
|
623
623
|
const name = attributeNames[ i ];
|
|
624
624
|
const attr = geometry.attributes[ name ];
|
|
625
625
|
|
|
626
|
-
tmpAttributes[ name ] = new
|
|
626
|
+
tmpAttributes[ name ] = new attr.constructor(
|
|
627
627
|
new attr.array.constructor( attr.count * attr.itemSize ),
|
|
628
628
|
attr.itemSize,
|
|
629
629
|
attr.normalized
|
|
630
630
|
);
|
|
631
631
|
|
|
632
|
-
const
|
|
633
|
-
if (
|
|
632
|
+
const morphAttributes = geometry.morphAttributes[ name ];
|
|
633
|
+
if ( morphAttributes ) {
|
|
634
634
|
|
|
635
|
-
tmpMorphAttributes[ name ] =
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
morphAttr.
|
|
639
|
-
|
|
635
|
+
if ( ! tmpMorphAttributes[ name ] ) tmpMorphAttributes[ name ] = [];
|
|
636
|
+
morphAttributes.forEach( ( morphAttr, i ) => {
|
|
637
|
+
|
|
638
|
+
const array = new morphAttr.array.constructor( morphAttr.count * morphAttr.itemSize );
|
|
639
|
+
tmpMorphAttributes[ name ][ i ] = new morphAttr.constructor( array, morphAttr.itemSize, morphAttr.normalized );
|
|
640
|
+
|
|
641
|
+
} );
|
|
640
642
|
|
|
641
643
|
}
|
|
642
644
|
|
|
@@ -681,22 +683,22 @@ function mergeVertices( geometry, tolerance = 1e-4 ) {
|
|
|
681
683
|
|
|
682
684
|
const name = attributeNames[ j ];
|
|
683
685
|
const attribute = geometry.getAttribute( name );
|
|
684
|
-
const
|
|
686
|
+
const morphAttributes = geometry.morphAttributes[ name ];
|
|
685
687
|
const itemSize = attribute.itemSize;
|
|
686
|
-
const
|
|
688
|
+
const newArray = tmpAttributes[ name ];
|
|
687
689
|
const newMorphArrays = tmpMorphAttributes[ name ];
|
|
688
690
|
|
|
689
691
|
for ( let k = 0; k < itemSize; k ++ ) {
|
|
690
692
|
|
|
691
693
|
const getterFunc = getters[ k ];
|
|
692
694
|
const setterFunc = setters[ k ];
|
|
693
|
-
|
|
695
|
+
newArray[ setterFunc ]( nextIndex, attribute[ getterFunc ]( index ) );
|
|
694
696
|
|
|
695
|
-
if (
|
|
697
|
+
if ( morphAttributes ) {
|
|
696
698
|
|
|
697
|
-
for ( let m = 0, ml =
|
|
699
|
+
for ( let m = 0, ml = morphAttributes.length; m < ml; m ++ ) {
|
|
698
700
|
|
|
699
|
-
newMorphArrays[ m ][ setterFunc ]( nextIndex,
|
|
701
|
+
newMorphArrays[ m ][ setterFunc ]( nextIndex, morphAttributes[ m ][ getterFunc ]( index ) );
|
|
700
702
|
|
|
701
703
|
}
|
|
702
704
|
|
|
@@ -720,7 +722,7 @@ function mergeVertices( geometry, tolerance = 1e-4 ) {
|
|
|
720
722
|
|
|
721
723
|
const tmpAttribute = tmpAttributes[ name ];
|
|
722
724
|
|
|
723
|
-
result.setAttribute( name, new
|
|
725
|
+
result.setAttribute( name, new tmpAttribute.constructor(
|
|
724
726
|
tmpAttribute.array.slice( 0, nextIndex * tmpAttribute.itemSize ),
|
|
725
727
|
tmpAttribute.itemSize,
|
|
726
728
|
tmpAttribute.normalized,
|
|
@@ -732,7 +734,7 @@ function mergeVertices( geometry, tolerance = 1e-4 ) {
|
|
|
732
734
|
|
|
733
735
|
const tmpMorphAttribute = tmpMorphAttributes[ name ][ j ];
|
|
734
736
|
|
|
735
|
-
result.morphAttributes[ name ][ j ] = new
|
|
737
|
+
result.morphAttributes[ name ][ j ] = new tmpMorphAttribute.constructor(
|
|
736
738
|
tmpMorphAttribute.array.slice( 0, nextIndex * tmpMorphAttribute.itemSize ),
|
|
737
739
|
tmpMorphAttribute.itemSize,
|
|
738
740
|
tmpMorphAttribute.normalized,
|
|
@@ -245,10 +245,69 @@ function sortInstancedMesh( mesh, compareFn ) {
|
|
|
245
245
|
|
|
246
246
|
}
|
|
247
247
|
|
|
248
|
+
/**
|
|
249
|
+
* @param {Object3D} object Object to traverse.
|
|
250
|
+
* @yields {Object3D} Objects that passed the filter condition.
|
|
251
|
+
*/
|
|
252
|
+
function* traverseGenerator( object ) {
|
|
253
|
+
|
|
254
|
+
yield object;
|
|
255
|
+
|
|
256
|
+
const children = object.children;
|
|
257
|
+
|
|
258
|
+
for ( let i = 0, l = children.length; i < l; i ++ ) {
|
|
259
|
+
|
|
260
|
+
yield* traverseGenerator( children[ i ] );
|
|
261
|
+
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* @param {Object3D} object Object to traverse.
|
|
268
|
+
* @yields {Object3D} Objects that passed the filter condition.
|
|
269
|
+
*/
|
|
270
|
+
function* traverseVisibleGenerator( object ) {
|
|
271
|
+
|
|
272
|
+
if ( object.visible === false ) return;
|
|
273
|
+
|
|
274
|
+
yield object;
|
|
275
|
+
|
|
276
|
+
const children = object.children;
|
|
277
|
+
|
|
278
|
+
for ( let i = 0, l = children.length; i < l; i ++ ) {
|
|
279
|
+
|
|
280
|
+
yield* traverseVisibleGenerator( children[ i ] );
|
|
281
|
+
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* @param {Object3D} object Object to traverse.
|
|
288
|
+
* @yields {Object3D} Objects that passed the filter condition.
|
|
289
|
+
*/
|
|
290
|
+
function* traverseAncestorsGenerator( object ) {
|
|
291
|
+
|
|
292
|
+
const parent = object.parent;
|
|
293
|
+
|
|
294
|
+
if ( parent !== null ) {
|
|
295
|
+
|
|
296
|
+
yield parent;
|
|
297
|
+
|
|
298
|
+
yield* traverseAncestorsGenerator( parent );
|
|
299
|
+
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
}
|
|
303
|
+
|
|
248
304
|
export {
|
|
249
305
|
createMeshesFromInstancedMesh,
|
|
250
306
|
createMeshesFromMultiMaterialMesh,
|
|
251
307
|
createMultiMaterialObject,
|
|
252
308
|
reduceVertices,
|
|
253
|
-
sortInstancedMesh
|
|
309
|
+
sortInstancedMesh,
|
|
310
|
+
traverseGenerator,
|
|
311
|
+
traverseVisibleGenerator,
|
|
312
|
+
traverseAncestorsGenerator
|
|
254
313
|
};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
// Hybrid radix sort from
|
|
2
2
|
// - https://gist.github.com/sciecode/93ed864dd77c5c8803c6a86698d68dab
|
|
3
3
|
// - https://github.com/mrdoob/three.js/pull/27202#issuecomment-1817640271
|
|
4
|
+
//
|
|
5
|
+
// expects unsigned 32b integer values
|
|
6
|
+
|
|
4
7
|
const POWER = 3;
|
|
5
8
|
const BIT_MAX = 32;
|
|
6
9
|
const BIN_BITS = 1 << POWER;
|
|
@@ -102,11 +105,11 @@ export const radixSort = ( arr, opt ) => {
|
|
|
102
105
|
|
|
103
106
|
for ( let j = start + 1; j < start + len; j ++ ) {
|
|
104
107
|
|
|
105
|
-
const p = a[ j ], t = get( p );
|
|
108
|
+
const p = a[ j ], t = get( p ) >>> 0;
|
|
106
109
|
let i = j;
|
|
107
|
-
while ( i >
|
|
110
|
+
while ( i > start ) {
|
|
108
111
|
|
|
109
|
-
if ( compare( get( a[ i - 1 ] ), t ) )
|
|
112
|
+
if ( compare( get( a[ i - 1 ] ) >>> 0, t ) )
|
|
110
113
|
a[ i ] = a[ -- i ];
|
|
111
114
|
else
|
|
112
115
|
break;
|
|
@@ -140,14 +143,14 @@ export const radixSort = ( arr, opt ) => {
|
|
|
140
143
|
bin.fill( 0 );
|
|
141
144
|
|
|
142
145
|
for ( let j = start; j < end; j ++ )
|
|
143
|
-
bin[ ( get( a[ j ] )
|
|
146
|
+
bin[ ( get( a[ j ] ) >>> shift ) & BIN_MAX ] ++;
|
|
144
147
|
|
|
145
148
|
accumulate( bin );
|
|
146
149
|
|
|
147
150
|
cache.set( bin );
|
|
148
151
|
|
|
149
152
|
for ( let j = end - 1; j >= start; j -- )
|
|
150
|
-
b[ start + -- bin[ ( get( a[ j ] )
|
|
153
|
+
b[ start + -- bin[ ( get( a[ j ] ) >>> shift ) & BIN_MAX ] ] = a[ j ];
|
|
151
154
|
|
|
152
155
|
if ( depth == ITERATIONS - 1 ) return;
|
|
153
156
|
|
|
@@ -6,7 +6,7 @@ const POINTING_JOINT = 'index-finger-tip';
|
|
|
6
6
|
|
|
7
7
|
class OculusHandModel extends Object3D {
|
|
8
8
|
|
|
9
|
-
constructor( controller, loader = null ) {
|
|
9
|
+
constructor( controller, loader = null, onLoad = null ) {
|
|
10
10
|
|
|
11
11
|
super();
|
|
12
12
|
|
|
@@ -14,6 +14,7 @@ class OculusHandModel extends Object3D {
|
|
|
14
14
|
this.motionController = null;
|
|
15
15
|
this.envMap = null;
|
|
16
16
|
this.loader = loader;
|
|
17
|
+
this.onLoad = onLoad;
|
|
17
18
|
|
|
18
19
|
this.mesh = null;
|
|
19
20
|
|
|
@@ -25,7 +26,7 @@ class OculusHandModel extends Object3D {
|
|
|
25
26
|
|
|
26
27
|
this.xrInputSource = xrInputSource;
|
|
27
28
|
|
|
28
|
-
this.motionController = new XRHandMeshModel( this, controller, this.path, xrInputSource.handedness, this.loader );
|
|
29
|
+
this.motionController = new XRHandMeshModel( this, controller, this.path, xrInputSource.handedness, this.loader, this.onLoad );
|
|
29
30
|
|
|
30
31
|
}
|
|
31
32
|
|
|
@@ -40,9 +40,11 @@ class XRHandModel extends Object3D {
|
|
|
40
40
|
|
|
41
41
|
class XRHandModelFactory {
|
|
42
42
|
|
|
43
|
-
constructor() {
|
|
43
|
+
constructor( gltfLoader = null, onLoad = null ) {
|
|
44
44
|
|
|
45
|
+
this.gltfLoader = gltfLoader;
|
|
45
46
|
this.path = null;
|
|
47
|
+
this.onLoad = onLoad;
|
|
46
48
|
|
|
47
49
|
}
|
|
48
50
|
|
|
@@ -77,7 +79,7 @@ class XRHandModelFactory {
|
|
|
77
79
|
|
|
78
80
|
} else if ( profile === 'mesh' ) {
|
|
79
81
|
|
|
80
|
-
handModel.motionController = new XRHandMeshModel( handModel, controller, this.path, xrInputSource.handedness );
|
|
82
|
+
handModel.motionController = new XRHandMeshModel( handModel, controller, this.path, xrInputSource.handedness, this.gltfLoader, this.onLoad );
|
|
81
83
|
|
|
82
84
|
}
|
|
83
85
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "super-three",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.165.0",
|
|
4
4
|
"description": "JavaScript 3D library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./build/three.cjs",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
],
|
|
42
42
|
"scripts": {
|
|
43
43
|
"start": "npm run dev",
|
|
44
|
-
"test": "npm run lint && npm run test-unit",
|
|
44
|
+
"test": "npm run lint && npm run test-unit && npm run test-unit-addons",
|
|
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\"",
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
"lint": "npm run lint-core",
|
|
59
59
|
"lint-fix": "npm run lint-core -- --fix && npm run lint-addons -- --fix && npm run lint-examples -- --fix && npm run lint-docs -- --fix && npm run lint-editor -- --fix && npm run lint-playground -- --fix && npm run lint-manual -- --fix && npm run lint-test -- --fix && npm run lint-utils -- --fix",
|
|
60
60
|
"test-unit": "qunit -r failonlyreporter -f !-webonly test/unit/three.source.unit.js",
|
|
61
|
+
"test-unit-addons": "qunit -r failonlyreporter -f !-webonly test/unit/three.addons.unit.js",
|
|
61
62
|
"test-e2e": "node test/e2e/puppeteer.js",
|
|
62
63
|
"test-e2e-cov": "node test/e2e/check-coverage.js",
|
|
63
64
|
"test-treeshake": "rollup -c test/rollup.treeshake.config.js",
|
|
@@ -4,7 +4,16 @@ import { KeyframeTrack } from '../KeyframeTrack.js';
|
|
|
4
4
|
/**
|
|
5
5
|
* A Track of Boolean keyframe values.
|
|
6
6
|
*/
|
|
7
|
-
class BooleanKeyframeTrack extends KeyframeTrack {
|
|
7
|
+
class BooleanKeyframeTrack extends KeyframeTrack {
|
|
8
|
+
|
|
9
|
+
// No interpolation parameter because only InterpolateDiscrete is valid.
|
|
10
|
+
constructor( name, times, values ) {
|
|
11
|
+
|
|
12
|
+
super( name, times, values );
|
|
13
|
+
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
}
|
|
8
17
|
|
|
9
18
|
BooleanKeyframeTrack.prototype.ValueTypeName = 'bool';
|
|
10
19
|
BooleanKeyframeTrack.prototype.ValueBufferType = Array;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { InterpolateLinear } from '../../constants.js';
|
|
2
1
|
import { KeyframeTrack } from '../KeyframeTrack.js';
|
|
3
2
|
import { QuaternionLinearInterpolant } from '../../math/interpolants/QuaternionLinearInterpolant.js';
|
|
4
3
|
|
|
@@ -17,7 +16,7 @@ class QuaternionKeyframeTrack extends KeyframeTrack {
|
|
|
17
16
|
|
|
18
17
|
QuaternionKeyframeTrack.prototype.ValueTypeName = 'quaternion';
|
|
19
18
|
// ValueBufferType is inherited
|
|
20
|
-
|
|
19
|
+
// DefaultInterpolation is inherited;
|
|
21
20
|
QuaternionKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = undefined;
|
|
22
21
|
|
|
23
22
|
export { QuaternionKeyframeTrack };
|
|
@@ -4,7 +4,16 @@ import { KeyframeTrack } from '../KeyframeTrack.js';
|
|
|
4
4
|
/**
|
|
5
5
|
* A Track that interpolates Strings
|
|
6
6
|
*/
|
|
7
|
-
class StringKeyframeTrack extends KeyframeTrack {
|
|
7
|
+
class StringKeyframeTrack extends KeyframeTrack {
|
|
8
|
+
|
|
9
|
+
// No interpolation parameter because only InterpolateDiscrete is valid.
|
|
10
|
+
constructor( name, times, values ) {
|
|
11
|
+
|
|
12
|
+
super( name, times, values );
|
|
13
|
+
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
}
|
|
8
17
|
|
|
9
18
|
StringKeyframeTrack.prototype.ValueTypeName = 'string';
|
|
10
19
|
StringKeyframeTrack.prototype.ValueBufferType = Array;
|
package/src/constants.js
CHANGED
package/src/core/Object3D.js
CHANGED
|
@@ -761,6 +761,8 @@ class Object3D extends EventDispatcher {
|
|
|
761
761
|
|
|
762
762
|
object.matricesTexture = this._matricesTexture.toJSON( meta );
|
|
763
763
|
|
|
764
|
+
if ( this._colorsTexture !== null ) object.colorsTexture = this._colorsTexture.toJSON( meta );
|
|
765
|
+
|
|
764
766
|
if ( this.boundingSphere !== null ) {
|
|
765
767
|
|
|
766
768
|
object.boundingSphere = {
|
package/src/core/Raycaster.js
CHANGED
|
@@ -101,13 +101,17 @@ function ascSort( a, b ) {
|
|
|
101
101
|
|
|
102
102
|
function intersect( object, raycaster, intersects, recursive ) {
|
|
103
103
|
|
|
104
|
+
let propagate = true;
|
|
105
|
+
|
|
104
106
|
if ( object.layers.test( raycaster.layers ) ) {
|
|
105
107
|
|
|
106
|
-
object.raycast( raycaster, intersects );
|
|
108
|
+
const result = object.raycast( raycaster, intersects );
|
|
109
|
+
|
|
110
|
+
if ( result === false ) propagate = false;
|
|
107
111
|
|
|
108
112
|
}
|
|
109
113
|
|
|
110
|
-
if ( recursive === true ) {
|
|
114
|
+
if ( propagate === true && recursive === true ) {
|
|
111
115
|
|
|
112
116
|
const children = object.children;
|
|
113
117
|
|
package/src/core/RenderTarget.js
CHANGED
|
@@ -34,6 +34,8 @@ class RenderTarget extends EventDispatcher {
|
|
|
34
34
|
minFilter: LinearFilter,
|
|
35
35
|
depthBuffer: true,
|
|
36
36
|
stencilBuffer: false,
|
|
37
|
+
resolveDepthBuffer: true,
|
|
38
|
+
resolveStencilBuffer: true,
|
|
37
39
|
depthTexture: null,
|
|
38
40
|
samples: 0,
|
|
39
41
|
count: 1
|
|
@@ -58,6 +60,9 @@ class RenderTarget extends EventDispatcher {
|
|
|
58
60
|
this.depthBuffer = options.depthBuffer;
|
|
59
61
|
this.stencilBuffer = options.stencilBuffer;
|
|
60
62
|
|
|
63
|
+
this.resolveDepthBuffer = options.resolveDepthBuffer;
|
|
64
|
+
this.resolveStencilBuffer = options.resolveStencilBuffer;
|
|
65
|
+
|
|
61
66
|
this.depthTexture = options.depthTexture;
|
|
62
67
|
|
|
63
68
|
this.samples = options.samples;
|
|
@@ -135,6 +140,9 @@ class RenderTarget extends EventDispatcher {
|
|
|
135
140
|
this.depthBuffer = source.depthBuffer;
|
|
136
141
|
this.stencilBuffer = source.stencilBuffer;
|
|
137
142
|
|
|
143
|
+
this.resolveDepthBuffer = source.resolveDepthBuffer;
|
|
144
|
+
this.resolveStencilBuffer = source.resolveStencilBuffer;
|
|
145
|
+
|
|
138
146
|
if ( source.depthTexture !== null ) this.depthTexture = source.depthTexture.clone();
|
|
139
147
|
|
|
140
148
|
this.samples = source.samples;
|
|
@@ -49,16 +49,16 @@ const INV_PHI = 1 / PHI;
|
|
|
49
49
|
// Vertices of a dodecahedron (except the opposites, which represent the
|
|
50
50
|
// same axis), used as axis directions evenly spread on a sphere.
|
|
51
51
|
const _axisDirections = [
|
|
52
|
-
/*@__PURE__*/ new Vector3(
|
|
53
|
-
/*@__PURE__*/ new Vector3( - 1, 1, 1 ),
|
|
54
|
-
/*@__PURE__*/ new Vector3( 1, 1, - 1 ),
|
|
55
|
-
/*@__PURE__*/ new Vector3( - 1, 1, - 1 ),
|
|
56
|
-
/*@__PURE__*/ new Vector3( 0, PHI, INV_PHI ),
|
|
57
|
-
/*@__PURE__*/ new Vector3( 0, PHI, - INV_PHI ),
|
|
58
|
-
/*@__PURE__*/ new Vector3( INV_PHI, 0, PHI ),
|
|
59
|
-
/*@__PURE__*/ new Vector3( - INV_PHI, 0, PHI ),
|
|
52
|
+
/*@__PURE__*/ new Vector3( - PHI, INV_PHI, 0 ),
|
|
60
53
|
/*@__PURE__*/ new Vector3( PHI, INV_PHI, 0 ),
|
|
61
|
-
/*@__PURE__*/ new Vector3( -
|
|
54
|
+
/*@__PURE__*/ new Vector3( - INV_PHI, 0, PHI ),
|
|
55
|
+
/*@__PURE__*/ new Vector3( INV_PHI, 0, PHI ),
|
|
56
|
+
/*@__PURE__*/ new Vector3( 0, PHI, - INV_PHI ),
|
|
57
|
+
/*@__PURE__*/ new Vector3( 0, PHI, INV_PHI ),
|
|
58
|
+
/*@__PURE__*/ new Vector3( - 1, 1, - 1 ),
|
|
59
|
+
/*@__PURE__*/ new Vector3( 1, 1, - 1 ),
|
|
60
|
+
/*@__PURE__*/ new Vector3( - 1, 1, 1 ),
|
|
61
|
+
/*@__PURE__*/ new Vector3( 1, 1, 1 ) ];
|
|
62
62
|
|
|
63
63
|
/**
|
|
64
64
|
* This class generates a Prefiltered, Mipmapped Radiance Environment Map
|
|
@@ -444,12 +444,13 @@ class PMREMGenerator {
|
|
|
444
444
|
const renderer = this._renderer;
|
|
445
445
|
const autoClear = renderer.autoClear;
|
|
446
446
|
renderer.autoClear = false;
|
|
447
|
+
const n = this._lodPlanes.length;
|
|
447
448
|
|
|
448
|
-
for ( let i = 1; i <
|
|
449
|
+
for ( let i = 1; i < n; i ++ ) {
|
|
449
450
|
|
|
450
451
|
const sigma = Math.sqrt( this._sigmas[ i ] * this._sigmas[ i ] - this._sigmas[ i - 1 ] * this._sigmas[ i - 1 ] );
|
|
451
452
|
|
|
452
|
-
const poleAxis = _axisDirections[ ( i - 1 ) % _axisDirections.length ];
|
|
453
|
+
const poleAxis = _axisDirections[ ( n - i - 1 ) % _axisDirections.length ];
|
|
453
454
|
|
|
454
455
|
this._blur( cubeUVRenderTarget, i - 1, i, sigma, poleAxis );
|
|
455
456
|
|
|
@@ -112,7 +112,7 @@ class FileLoader extends Loader {
|
|
|
112
112
|
|
|
113
113
|
// Nginx needs X-File-Size check
|
|
114
114
|
// https://serverfault.com/questions/482875/why-does-nginx-remove-content-length-header-for-chunked-content
|
|
115
|
-
const contentLength = response.headers.get( '
|
|
115
|
+
const contentLength = response.headers.get( 'X-File-Size' ) || response.headers.get( 'Content-Length' );
|
|
116
116
|
const total = contentLength ? parseInt( contentLength ) : 0;
|
|
117
117
|
const lengthComputable = total !== 0;
|
|
118
118
|
let loaded = 0;
|
|
@@ -148,6 +148,10 @@ class FileLoader extends Loader {
|
|
|
148
148
|
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
+
}, ( e ) => {
|
|
152
|
+
|
|
153
|
+
controller.error( e );
|
|
154
|
+
|
|
151
155
|
} );
|
|
152
156
|
|
|
153
157
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
class LoaderUtils {
|
|
2
2
|
|
|
3
|
-
static decodeText( array ) {
|
|
3
|
+
static decodeText( array ) { // @deprecated, r165
|
|
4
|
+
|
|
5
|
+
console.warn( 'THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead.' );
|
|
4
6
|
|
|
5
7
|
if ( typeof TextDecoder !== 'undefined' ) {
|
|
6
8
|
|
|
@@ -103,6 +103,7 @@ class MaterialLoader extends Loader {
|
|
|
103
103
|
if ( json.shininess !== undefined ) material.shininess = json.shininess;
|
|
104
104
|
if ( json.clearcoat !== undefined ) material.clearcoat = json.clearcoat;
|
|
105
105
|
if ( json.clearcoatRoughness !== undefined ) material.clearcoatRoughness = json.clearcoatRoughness;
|
|
106
|
+
if ( json.dispersion !== undefined ) material.dispersion = json.dispersion;
|
|
106
107
|
if ( json.iridescence !== undefined ) material.iridescence = json.iridescence;
|
|
107
108
|
if ( json.iridescenceIOR !== undefined ) material.iridescenceIOR = json.iridescenceIOR;
|
|
108
109
|
if ( json.iridescenceThicknessRange !== undefined ) material.iridescenceThicknessRange = json.iridescenceThicknessRange;
|
|
@@ -961,6 +961,7 @@ class ObjectLoader extends Loader {
|
|
|
961
961
|
object._geometryCount = data.geometryCount;
|
|
962
962
|
|
|
963
963
|
object._matricesTexture = getTexture( data.matricesTexture.uuid );
|
|
964
|
+
if ( data.colorsTexture !== undefined ) object._colorsTexture = getTexture( data.colorsTexture.uuid );
|
|
964
965
|
|
|
965
966
|
break;
|
|
966
967
|
|
|
@@ -218,6 +218,8 @@ class Material extends EventDispatcher {
|
|
|
218
218
|
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
+
if ( this.dispersion !== undefined ) data.dispersion = this.dispersion;
|
|
222
|
+
|
|
221
223
|
if ( this.iridescence !== undefined ) data.iridescence = this.iridescence;
|
|
222
224
|
if ( this.iridescenceIOR !== undefined ) data.iridescenceIOR = this.iridescenceIOR;
|
|
223
225
|
if ( this.iridescenceThicknessRange !== undefined ) data.iridescenceThicknessRange = this.iridescenceThicknessRange;
|
|
@@ -68,6 +68,7 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
|
|
|
68
68
|
|
|
69
69
|
this._anisotropy = 0;
|
|
70
70
|
this._clearcoat = 0;
|
|
71
|
+
this._dispersion = 0;
|
|
71
72
|
this._iridescence = 0;
|
|
72
73
|
this._sheen = 0.0;
|
|
73
74
|
this._transmission = 0;
|
|
@@ -130,6 +131,24 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
|
|
|
130
131
|
|
|
131
132
|
}
|
|
132
133
|
|
|
134
|
+
get dispersion() {
|
|
135
|
+
|
|
136
|
+
return this._dispersion;
|
|
137
|
+
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
set dispersion( value ) {
|
|
141
|
+
|
|
142
|
+
if ( this._dispersion > 0 !== value > 0 ) {
|
|
143
|
+
|
|
144
|
+
this.version ++;
|
|
145
|
+
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
this._dispersion = value;
|
|
149
|
+
|
|
150
|
+
}
|
|
151
|
+
|
|
133
152
|
get sheen() {
|
|
134
153
|
|
|
135
154
|
return this._sheen;
|
|
@@ -188,6 +207,7 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
|
|
|
188
207
|
this.clearcoatNormalMap = source.clearcoatNormalMap;
|
|
189
208
|
this.clearcoatNormalScale.copy( source.clearcoatNormalScale );
|
|
190
209
|
|
|
210
|
+
this.dispersion = source.dispersion;
|
|
191
211
|
this.ior = source.ior;
|
|
192
212
|
|
|
193
213
|
this.iridescence = source.iridescence;
|