super-three 0.167.0 → 0.169.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 +532 -173
- package/build/three.module.js +532 -174
- package/build/three.module.min.js +1 -1
- package/build/three.webgpu.js +18173 -14266
- package/build/three.webgpu.min.js +1 -1
- package/build/three.webgpu.nodes.js +79941 -0
- package/build/three.webgpu.nodes.min.js +6 -0
- package/examples/jsm/Addons.js +0 -4
- package/examples/jsm/animation/AnimationClipCreator.js +1 -1
- package/examples/jsm/capabilities/WebGL.js +27 -21
- package/examples/jsm/controls/ArcballControls.js +174 -158
- package/examples/jsm/controls/DragControls.js +260 -132
- package/examples/jsm/controls/FirstPersonControls.js +175 -163
- package/examples/jsm/controls/FlyControls.js +194 -188
- package/examples/jsm/controls/OrbitControls.js +777 -786
- package/examples/jsm/controls/PointerLockControls.js +24 -15
- package/examples/jsm/controls/TrackballControls.js +469 -448
- package/examples/jsm/controls/TransformControls.js +97 -62
- package/examples/jsm/effects/AnaglyphEffect.js +6 -13
- package/examples/jsm/effects/ParallaxBarrierEffect.js +17 -11
- package/examples/jsm/effects/StereoEffect.js +6 -1
- package/examples/jsm/environments/RoomEnvironment.js +1 -1
- package/examples/jsm/exporters/DRACOExporter.js +4 -2
- package/examples/jsm/exporters/EXRExporter.js +19 -11
- package/examples/jsm/exporters/GLTFExporter.js +6 -1
- package/examples/jsm/exporters/KTX2Exporter.js +21 -13
- package/examples/jsm/exporters/OBJExporter.js +5 -1
- package/examples/jsm/exporters/PLYExporter.js +9 -7
- package/examples/jsm/exporters/USDZExporter.js +29 -8
- package/examples/jsm/geometries/DecalGeometry.js +4 -1
- package/examples/jsm/geometries/InstancedPointsGeometry.js +1 -1
- package/examples/jsm/helpers/LightProbeHelper.js +43 -44
- package/examples/jsm/helpers/LightProbeHelperGPU.js +65 -0
- package/examples/jsm/libs/basis/basis_transcoder.js +8 -10
- package/examples/jsm/libs/basis/basis_transcoder.wasm +0 -0
- package/examples/jsm/libs/ktx-parse.module.js +1 -1
- package/examples/jsm/lights/LightProbeGenerator.js +24 -10
- package/examples/jsm/loaders/ColladaLoader.js +9 -6
- package/examples/jsm/loaders/DRACOLoader.js +3 -1
- package/examples/jsm/loaders/FBXLoader.js +30 -20
- package/examples/jsm/loaders/GLTFLoader.js +5 -10
- package/examples/jsm/loaders/KTX2Loader.js +27 -12
- package/examples/jsm/loaders/MTLLoader.js +4 -3
- package/examples/jsm/loaders/MaterialXLoader.js +40 -14
- package/examples/jsm/loaders/OBJLoader.js +5 -3
- package/examples/jsm/loaders/PCDLoader.js +14 -13
- package/examples/jsm/loaders/PDBLoader.js +3 -2
- package/examples/jsm/loaders/PLYLoader.js +8 -5
- package/examples/jsm/loaders/STLLoader.js +3 -2
- package/examples/jsm/loaders/VRMLLoader.js +10 -10
- package/examples/jsm/loaders/VTKLoader.js +4 -3
- package/examples/jsm/loaders/XYZLoader.js +3 -2
- package/examples/jsm/misc/Timer.js +1 -1
- package/examples/jsm/modifiers/CurveModifierGPU.js +233 -0
- package/examples/jsm/objects/LensflareMesh.js +322 -0
- package/examples/jsm/objects/SkyMesh.js +187 -0
- package/examples/jsm/objects/Water2Mesh.js +158 -0
- package/examples/jsm/objects/WaterMesh.js +101 -0
- package/examples/jsm/physics/JoltPhysics.js +1 -1
- package/examples/jsm/physics/RapierPhysics.js +21 -1
- package/examples/jsm/postprocessing/OutlinePass.js +31 -46
- package/examples/jsm/postprocessing/SSAARenderPass.js +3 -1
- package/examples/jsm/shaders/BleachBypassShader.js +1 -2
- package/examples/jsm/shaders/OutputShader.js +1 -1
- package/examples/jsm/transpiler/GLSLDecoder.js +1 -1
- package/examples/jsm/transpiler/ShaderToyDecoder.js +2 -2
- package/examples/jsm/transpiler/TSLEncoder.js +8 -8
- package/examples/jsm/utils/GeometryCompressionUtils.js +37 -122
- package/examples/jsm/utils/ShadowMapViewer.js +3 -8
- package/examples/jsm/utils/ShadowMapViewerGPU.js +201 -0
- package/examples/jsm/utils/SkeletonUtils.js +84 -66
- package/examples/jsm/utils/TextureUtils.js +2 -1
- package/examples/jsm/utils/TextureUtilsGPU.js +63 -0
- package/examples/jsm/webxr/XRControllerModelFactory.js +1 -1
- package/package.json +3 -2
- package/src/Three.WebGPU.Nodes.js +200 -0
- package/src/Three.WebGPU.js +7 -0
- package/src/Three.js +1 -0
- package/src/audio/Audio.js +2 -2
- package/src/constants.js +1 -1
- package/src/core/BufferAttribute.js +0 -9
- package/src/core/Clock.js +1 -1
- package/src/core/InterleavedBuffer.js +0 -9
- package/src/extras/Controls.js +32 -0
- package/src/geometries/CylinderGeometry.js +11 -4
- package/src/loaders/MaterialLoader.js +7 -1
- package/src/loaders/ObjectLoader.js +3 -3
- package/src/{nodes/loaders → loaders/nodes}/NodeLoader.js +25 -5
- package/src/{nodes/loaders → loaders/nodes}/NodeMaterialLoader.js +21 -18
- package/src/{nodes/loaders → loaders/nodes}/NodeObjectLoader.js +19 -0
- package/src/materials/Material.js +4 -7
- package/src/materials/nodes/InstancedPointsNodeMaterial.js +156 -0
- package/src/{nodes/materials → materials/nodes}/Line2NodeMaterial.js +56 -59
- package/src/{nodes/materials → materials/nodes}/LineBasicNodeMaterial.js +8 -5
- package/src/{nodes/materials → materials/nodes}/LineDashedNodeMaterial.js +12 -10
- package/src/{nodes/materials → materials/nodes}/MeshBasicNodeMaterial.js +16 -12
- package/src/{nodes/materials → materials/nodes}/MeshLambertNodeMaterial.js +10 -6
- package/src/{nodes/materials → materials/nodes}/MeshMatcapNodeMaterial.js +13 -9
- package/src/{nodes/materials → materials/nodes}/MeshNormalNodeMaterial.js +13 -9
- package/src/{nodes/materials → materials/nodes}/MeshPhongNodeMaterial.js +14 -9
- package/src/{nodes/materials → materials/nodes}/MeshPhysicalNodeMaterial.js +22 -18
- package/src/{nodes/materials → materials/nodes}/MeshSSSNodeMaterial.js +10 -7
- package/src/{nodes/materials → materials/nodes}/MeshStandardNodeMaterial.js +22 -12
- package/src/{nodes/materials → materials/nodes}/MeshToonNodeMaterial.js +9 -5
- package/src/{nodes/materials → materials/nodes}/NodeMaterial.js +71 -115
- package/src/{nodes/materials/Materials.js → materials/nodes/NodeMaterials.js} +3 -1
- package/src/{nodes/materials → materials/nodes}/PointsNodeMaterial.js +8 -5
- package/src/{nodes/materials → materials/nodes}/ShadowNodeMaterial.js +9 -5
- package/src/{nodes/materials → materials/nodes}/SpriteNodeMaterial.js +47 -14
- package/src/{nodes/materials → materials/nodes}/VolumeNodeMaterial.js +24 -22
- package/src/materials/nodes/manager/NodeMaterialObserver.js +302 -0
- package/src/math/Triangle.js +24 -0
- package/src/nodes/Nodes.js +103 -159
- package/src/nodes/TSL.js +179 -0
- package/src/nodes/accessors/AccessorsUtils.js +8 -8
- package/src/nodes/accessors/BatchNode.js +53 -21
- package/src/nodes/accessors/{BitangentNode.js → Bitangent.js} +9 -9
- package/src/nodes/accessors/BufferAttributeNode.js +8 -5
- package/src/nodes/accessors/BufferNode.js +7 -4
- package/src/nodes/accessors/Camera.js +13 -0
- package/src/nodes/accessors/ClippingNode.js +19 -13
- package/src/nodes/accessors/CubeTextureNode.js +9 -8
- package/src/nodes/accessors/InstanceNode.js +19 -15
- package/src/nodes/accessors/InstancedPointsMaterialNode.js +8 -5
- package/src/nodes/accessors/Lights.js +51 -0
- package/src/nodes/accessors/MaterialNode.js +56 -55
- package/src/nodes/accessors/MaterialProperties.js +3 -0
- package/src/nodes/accessors/MaterialReferenceNode.js +9 -4
- package/src/nodes/accessors/ModelNode.js +47 -12
- package/src/nodes/accessors/ModelViewProjectionNode.js +12 -9
- package/src/nodes/accessors/MorphNode.js +17 -13
- package/src/nodes/accessors/Normal.js +88 -0
- package/src/nodes/accessors/Object3DNode.js +17 -33
- package/src/nodes/accessors/PointUVNode.js +9 -5
- package/src/nodes/accessors/Position.js +10 -0
- package/src/nodes/accessors/ReferenceBaseNode.js +171 -0
- package/src/nodes/accessors/ReferenceNode.js +50 -7
- package/src/nodes/accessors/ReflectVector.js +10 -0
- package/src/nodes/accessors/RendererReferenceNode.js +12 -6
- package/src/nodes/accessors/SceneNode.js +9 -6
- package/src/nodes/accessors/SkinningNode.js +88 -21
- package/src/nodes/accessors/StorageBufferNode.js +22 -5
- package/src/nodes/accessors/StorageTextureNode.js +9 -6
- package/src/nodes/accessors/Tangent.js +22 -0
- package/src/nodes/accessors/Texture3DNode.js +16 -13
- package/src/nodes/accessors/{TextureBicubicNode.js → TextureBicubic.js} +3 -32
- package/src/nodes/accessors/TextureNode.js +29 -23
- package/src/nodes/accessors/TextureSizeNode.js +10 -9
- package/src/nodes/accessors/{UniformsNode.js → UniformArrayNode.js} +26 -14
- package/src/nodes/accessors/UserDataNode.js +10 -7
- package/src/nodes/accessors/VelocityNode.js +134 -0
- package/src/nodes/accessors/VertexColorNode.js +7 -4
- package/src/nodes/code/CodeNode.js +9 -5
- package/src/nodes/code/ExpressionNode.js +10 -6
- package/src/nodes/code/FunctionCallNode.js +8 -5
- package/src/nodes/code/FunctionNode.js +8 -23
- package/src/nodes/code/ScriptableNode.js +13 -10
- package/src/nodes/code/ScriptableValueNode.js +9 -7
- package/src/nodes/core/AssignNode.js +12 -9
- package/src/nodes/core/AttributeNode.js +12 -21
- package/src/nodes/core/BypassNode.js +11 -7
- package/src/nodes/core/CacheNode.js +10 -6
- package/src/nodes/core/ConstNode.js +6 -3
- package/src/nodes/core/ContextNode.js +21 -11
- package/src/nodes/core/IndexNode.js +35 -8
- package/src/nodes/core/InputNode.js +7 -3
- package/src/nodes/core/MRTNode.js +16 -7
- package/src/nodes/core/Node.js +19 -40
- package/src/nodes/core/NodeBuilder.js +117 -38
- package/src/nodes/core/NodeUtils.js +49 -6
- package/src/nodes/core/OutputStructNode.js +10 -6
- package/src/nodes/core/ParameterNode.js +7 -4
- package/src/nodes/core/PropertyNode.js +36 -32
- package/src/nodes/core/StackNode.js +31 -11
- package/src/nodes/core/StructTypeNode.js +7 -3
- package/src/nodes/core/TempNode.js +8 -4
- package/src/nodes/core/UniformGroupNode.js +14 -11
- package/src/nodes/core/UniformNode.js +7 -4
- package/src/nodes/core/VarNode.js +12 -8
- package/src/nodes/core/VaryingNode.js +10 -6
- package/src/nodes/display/AfterImageNode.js +15 -9
- package/src/nodes/display/AnaglyphPassNode.js +67 -0
- package/src/nodes/display/AnamorphicNode.js +17 -11
- package/src/nodes/display/BleachBypass.js +26 -0
- package/src/nodes/display/BlendMode.js +54 -0
- package/src/nodes/display/BloomNode.js +27 -19
- package/src/nodes/display/BumpMapNode.js +13 -12
- package/src/nodes/display/ColorAdjustment.js +46 -0
- package/src/nodes/display/ColorSpaceFunctions.js +38 -0
- package/src/nodes/display/ColorSpaceNode.js +67 -61
- package/src/nodes/display/DenoiseNode.js +23 -17
- package/src/nodes/display/DepthOfFieldNode.js +12 -7
- package/src/nodes/display/DotScreenNode.js +13 -22
- package/src/nodes/display/FXAANode.js +21 -16
- package/src/nodes/display/FilmNode.js +11 -7
- package/src/nodes/display/FrontFacingNode.js +10 -6
- package/src/nodes/display/GTAONode.js +22 -15
- package/src/nodes/display/GaussianBlurNode.js +14 -8
- package/src/nodes/display/Lut3DNode.js +10 -6
- package/src/nodes/display/MotionBlur.js +25 -0
- package/src/nodes/display/NormalMapNode.js +13 -13
- package/src/nodes/display/ParallaxBarrierPassNode.js +58 -0
- package/src/nodes/display/PassNode.js +95 -8
- package/src/nodes/display/PixelationPassNode.js +20 -8
- package/src/nodes/display/PosterizeNode.js +8 -7
- package/src/nodes/display/RGBShiftNode.js +11 -7
- package/src/nodes/display/RenderOutputNode.js +15 -11
- package/src/nodes/display/SSAAPassNode.js +287 -0
- package/src/nodes/display/ScreenNode.js +181 -0
- package/src/nodes/display/Sepia.js +17 -0
- package/src/nodes/display/SobelOperatorNode.js +13 -8
- package/src/nodes/display/StereoCompositePassNode.js +110 -0
- package/src/nodes/display/StereoPassNode.js +83 -0
- package/src/nodes/display/ToneMappingFunctions.js +190 -0
- package/src/nodes/display/ToneMappingNode.js +15 -175
- package/src/nodes/display/ToonOutlinePassNode.js +111 -0
- package/src/nodes/display/TransitionNode.js +12 -8
- package/src/nodes/display/ViewportDepthNode.js +34 -29
- package/src/nodes/display/ViewportDepthTextureNode.js +10 -9
- package/src/nodes/display/ViewportSharedTextureNode.js +10 -9
- package/src/nodes/display/ViewportTextureNode.js +11 -11
- package/src/nodes/fog/FogExp2Node.js +8 -7
- package/src/nodes/fog/FogNode.js +10 -8
- package/src/nodes/fog/FogRangeNode.js +8 -7
- package/src/nodes/functions/BSDF/BRDF_GGX.js +4 -4
- package/src/nodes/functions/BSDF/BRDF_Lambert.js +2 -2
- package/src/nodes/functions/BSDF/BRDF_Sheen.js +6 -6
- package/src/nodes/functions/BSDF/DFGApprox.js +2 -2
- package/src/nodes/functions/BSDF/D_GGX.js +2 -2
- package/src/nodes/functions/BSDF/D_GGX_Anisotropic.js +3 -3
- package/src/nodes/functions/BSDF/EnvironmentBRDF.js +2 -2
- package/src/nodes/functions/BSDF/F_Schlick.js +2 -2
- package/src/nodes/functions/BSDF/LTC.js +6 -6
- package/src/nodes/functions/BSDF/Schlick_to_F0.js +2 -2
- package/src/nodes/functions/BSDF/V_GGX_SmithCorrelated.js +2 -2
- package/src/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.js +2 -2
- package/src/nodes/functions/BasicLightingModel.js +1 -1
- package/src/nodes/functions/PhongLightingModel.js +5 -5
- package/src/nodes/functions/PhysicalLightingModel.js +34 -33
- package/src/nodes/functions/ShadowMaskModel.js +1 -1
- package/src/nodes/functions/ToonLightingModel.js +3 -3
- package/src/nodes/functions/material/getGeometryRoughness.js +4 -4
- package/src/nodes/functions/material/getRoughness.js +2 -2
- package/src/nodes/functions/material/getShIrradianceAt.js +28 -0
- package/src/nodes/geometry/RangeNode.js +9 -5
- package/src/nodes/gpgpu/AtomicFunctionNode.js +99 -0
- package/src/nodes/gpgpu/BarrierNode.js +40 -0
- package/src/nodes/gpgpu/ComputeBuiltinNode.js +98 -0
- package/src/nodes/gpgpu/ComputeNode.js +10 -6
- package/src/nodes/gpgpu/WorkgroupInfoNode.js +100 -0
- package/src/nodes/lighting/AONode.js +6 -3
- package/src/nodes/lighting/AmbientLightNode.js +6 -8
- package/src/nodes/lighting/AnalyticLightNode.js +225 -36
- package/src/nodes/lighting/BasicEnvironmentNode.js +8 -4
- package/src/nodes/lighting/BasicLightMapNode.js +7 -4
- package/src/nodes/lighting/DirectionalLightNode.js +7 -9
- package/src/nodes/lighting/EnvironmentNode.js +23 -19
- package/src/nodes/lighting/HemisphereLightNode.js +11 -11
- package/src/nodes/lighting/IESSpotLightNode.js +7 -9
- package/src/nodes/lighting/IrradianceNode.js +6 -3
- package/src/nodes/lighting/LightProbeNode.js +53 -0
- package/src/nodes/lighting/LightUtils.js +3 -3
- package/src/nodes/lighting/LightingContextNode.js +19 -18
- package/src/nodes/lighting/LightingNode.js +7 -3
- package/src/nodes/lighting/LightsNode.js +112 -75
- package/src/nodes/lighting/PointLightNode.js +12 -13
- package/src/nodes/lighting/RectAreaLightNode.js +11 -11
- package/src/nodes/lighting/SpotLightNode.js +14 -16
- package/src/nodes/materialx/MaterialXNodes.js +2 -2
- package/src/nodes/materialx/lib/mx_hsv.js +36 -31
- package/src/nodes/materialx/lib/mx_noise.js +96 -96
- package/src/nodes/materialx/lib/mx_transform_color.js +2 -2
- package/src/nodes/math/{CondNode.js → ConditionalNode.js} +38 -10
- package/src/nodes/math/Hash.js +13 -0
- package/src/nodes/math/MathNode.js +127 -124
- package/src/nodes/math/MathUtils.js +0 -7
- package/src/nodes/math/OperatorNode.js +97 -52
- package/src/nodes/math/TriNoise3D.js +19 -29
- package/src/nodes/pmrem/PMREMNode.js +61 -15
- package/src/nodes/pmrem/PMREMUtils.js +46 -46
- package/src/nodes/procedural/Checker.js +14 -0
- package/src/nodes/tsl/TSLBase.js +30 -0
- package/src/nodes/{shadernode/ShaderNode.js → tsl/TSLCore.js} +105 -97
- package/src/nodes/utils/ArrayElementNode.js +8 -4
- package/src/nodes/utils/ConvertNode.js +7 -3
- package/src/nodes/utils/CubeMapNode.js +160 -0
- package/src/nodes/utils/Discard.js +8 -0
- package/src/nodes/utils/EquirectUVNode.js +9 -6
- package/src/nodes/utils/FlipNode.js +68 -0
- package/src/nodes/utils/FunctionOverloadingNode.js +9 -5
- package/src/nodes/utils/JoinNode.js +6 -3
- package/src/nodes/utils/LoopNode.js +16 -6
- package/src/nodes/utils/MatcapUVNode.js +10 -7
- package/src/nodes/utils/MaxMipLevelNode.js +8 -5
- package/src/nodes/utils/OscNode.js +12 -8
- package/src/nodes/utils/Packing.js +4 -0
- package/src/nodes/utils/RTTNode.js +11 -8
- package/src/nodes/utils/ReflectorNode.js +12 -4
- package/src/nodes/utils/RemapNode.js +12 -8
- package/src/nodes/utils/RotateNode.js +8 -13
- package/src/nodes/utils/SetNode.js +7 -4
- package/src/nodes/utils/SplitNode.js +7 -3
- package/src/nodes/utils/SpriteSheetUVNode.js +10 -6
- package/src/nodes/utils/SpriteUtils.js +47 -0
- package/src/nodes/utils/StorageArrayElementNode.js +11 -12
- package/src/nodes/utils/TimerNode.js +8 -5
- package/src/nodes/utils/TriplanarTexturesNode.js +11 -9
- package/src/nodes/utils/UVUtils.js +19 -0
- package/src/nodes/utils/ViewportUtils.js +14 -0
- package/src/objects/BatchedMesh.js +78 -13
- package/src/objects/LOD.js +21 -0
- package/src/objects/Line.js +1 -0
- package/src/objects/Mesh.js +7 -23
- package/src/objects/Points.js +2 -0
- package/src/renderers/WebGLRenderer.js +88 -41
- package/src/renderers/common/Backend.js +2 -2
- package/src/renderers/common/Background.js +3 -1
- package/src/renderers/common/BindGroup.js +3 -1
- package/src/renderers/common/Bindings.js +13 -15
- package/src/renderers/common/BundleGroup.js +26 -0
- package/src/renderers/common/ClippingContext.js +15 -5
- package/src/renderers/common/CubeRenderTarget.js +9 -3
- package/src/renderers/common/PostProcessing.js +4 -1
- package/src/renderers/common/QuadMesh.js +2 -0
- package/src/renderers/common/RenderContext.js +23 -0
- package/src/renderers/common/RenderList.js +1 -1
- package/src/renderers/common/RenderObject.js +117 -6
- package/src/renderers/common/RenderObjects.js +8 -1
- package/src/renderers/common/Renderer.js +128 -94
- package/src/renderers/common/SampledTexture.js +12 -3
- package/src/renderers/common/Textures.js +8 -12
- package/src/renderers/common/extras/PMREMGenerator.js +19 -22
- package/src/renderers/common/nodes/NodeBuilderState.js +4 -4
- package/src/renderers/common/nodes/NodeLibrary.js +118 -0
- package/src/renderers/common/nodes/NodeSampledTexture.js +2 -2
- package/src/renderers/common/nodes/Nodes.js +65 -19
- package/src/renderers/shaders/ShaderChunk/tonemapping_pars_fragment.glsl.js +2 -2
- package/src/renderers/shaders/ShaderLib/sprite.glsl.js +2 -4
- package/src/renderers/webgl/WebGLAttributes.js +45 -14
- package/src/renderers/webgl/WebGLCapabilities.js +9 -0
- package/src/renderers/webgl/WebGLProgram.js +3 -1
- package/src/renderers/webgl/WebGLPrograms.js +21 -17
- package/src/renderers/webgl/WebGLProperties.js +7 -0
- package/src/renderers/webgl/WebGLState.js +21 -0
- package/src/renderers/webgl/WebGLTextures.js +83 -4
- package/src/renderers/webgl-fallback/WebGLBackend.js +135 -110
- package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +60 -12
- package/src/renderers/webgl-fallback/utils/WebGLAttributeUtils.js +6 -0
- package/src/renderers/webgl-fallback/utils/WebGLState.js +20 -2
- package/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +89 -37
- package/src/renderers/webgpu/WebGPUBackend.js +112 -86
- package/src/renderers/webgpu/WebGPURenderer.Nodes.js +42 -0
- package/src/renderers/webgpu/WebGPURenderer.js +9 -6
- package/src/renderers/webgpu/nodes/BasicNodeLibrary.js +59 -0
- package/src/renderers/webgpu/nodes/StandardNodeLibrary.js +105 -0
- package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +189 -73
- package/src/renderers/webgpu/utils/WebGPUAttributeUtils.js +6 -16
- package/src/renderers/webgpu/utils/WebGPUBindingUtils.js +45 -21
- package/src/renderers/webgpu/utils/WebGPUConstants.js +2 -1
- package/src/renderers/webgpu/utils/WebGPUPipelineUtils.js +7 -16
- package/src/renderers/webgpu/utils/WebGPUTexturePassUtils.js +62 -5
- package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +43 -26
- package/src/renderers/webgpu/utils/WebGPUUtils.js +19 -2
- package/src/renderers/webxr/WebXRManager.js +32 -25
- package/src/utils.js +33 -1
- package/examples/jsm/geometries/SDFGeometryGenerator.js +0 -144
- package/examples/jsm/loaders/LogLuvLoader.js +0 -606
- package/examples/jsm/loaders/TiltLoader.js +0 -520
- package/examples/jsm/utils/GPUStatsPanel.js +0 -95
- package/examples/jsm/utils/PackedPhongMaterial.js +0 -178
- package/src/nodes/accessors/CameraNode.js +0 -19
- package/src/nodes/accessors/NormalNode.js +0 -14
- package/src/nodes/accessors/PositionNode.js +0 -10
- package/src/nodes/accessors/ReflectVectorNode.js +0 -10
- package/src/nodes/accessors/TangentNode.js +0 -23
- package/src/nodes/core/NodeKeywords.js +0 -80
- package/src/nodes/display/BlendModeNode.js +0 -128
- package/src/nodes/display/ColorAdjustmentNode.js +0 -104
- package/src/nodes/display/ViewportNode.js +0 -137
- package/src/nodes/lighting/LightNode.js +0 -57
- package/src/nodes/materials/InstancedPointsNodeMaterial.js +0 -162
- package/src/nodes/math/HashNode.js +0 -34
- package/src/nodes/procedural/CheckerNode.js +0 -42
- package/src/nodes/utils/DiscardNode.js +0 -28
- package/src/nodes/utils/PackingNode.js +0 -55
- package/src/nodes/utils/RotateUVNode.js +0 -35
- /package/src/nodes/accessors/{UVNode.js → UV.js} +0 -0
package/src/audio/Audio.js
CHANGED
|
@@ -158,7 +158,7 @@ class Audio extends Object3D {
|
|
|
158
158
|
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
stop() {
|
|
161
|
+
stop( delay = 0 ) {
|
|
162
162
|
|
|
163
163
|
if ( this.hasPlaybackControl === false ) {
|
|
164
164
|
|
|
@@ -171,7 +171,7 @@ class Audio extends Object3D {
|
|
|
171
171
|
|
|
172
172
|
if ( this.source !== null ) {
|
|
173
173
|
|
|
174
|
-
this.source.stop();
|
|
174
|
+
this.source.stop( this.context.currentTime + delay );
|
|
175
175
|
this.source.onended = null;
|
|
176
176
|
|
|
177
177
|
}
|
package/src/constants.js
CHANGED
|
@@ -3,7 +3,6 @@ import { Vector2 } from '../math/Vector2.js';
|
|
|
3
3
|
import { denormalize, normalize } from '../math/MathUtils.js';
|
|
4
4
|
import { StaticDrawUsage, FloatType } from '../constants.js';
|
|
5
5
|
import { fromHalfFloat, toHalfFloat } from '../extras/DataUtils.js';
|
|
6
|
-
import { warnOnce } from '../utils.js';
|
|
7
6
|
|
|
8
7
|
const _vector = /*@__PURE__*/ new Vector3();
|
|
9
8
|
const _vector2 = /*@__PURE__*/ new Vector2();
|
|
@@ -28,7 +27,6 @@ class BufferAttribute {
|
|
|
28
27
|
this.normalized = normalized;
|
|
29
28
|
|
|
30
29
|
this.usage = StaticDrawUsage;
|
|
31
|
-
this._updateRange = { offset: 0, count: - 1 };
|
|
32
30
|
this.updateRanges = [];
|
|
33
31
|
this.gpuType = FloatType;
|
|
34
32
|
|
|
@@ -44,13 +42,6 @@ class BufferAttribute {
|
|
|
44
42
|
|
|
45
43
|
}
|
|
46
44
|
|
|
47
|
-
get updateRange() {
|
|
48
|
-
|
|
49
|
-
warnOnce( 'THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead.' ); // @deprecated, r159
|
|
50
|
-
return this._updateRange;
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
45
|
setUsage( value ) {
|
|
55
46
|
|
|
56
47
|
this.usage = value;
|
package/src/core/Clock.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as MathUtils from '../math/MathUtils.js';
|
|
2
2
|
import { StaticDrawUsage } from '../constants.js';
|
|
3
|
-
import { warnOnce } from '../utils.js';
|
|
4
3
|
|
|
5
4
|
class InterleavedBuffer {
|
|
6
5
|
|
|
@@ -13,7 +12,6 @@ class InterleavedBuffer {
|
|
|
13
12
|
this.count = array !== undefined ? array.length / stride : 0;
|
|
14
13
|
|
|
15
14
|
this.usage = StaticDrawUsage;
|
|
16
|
-
this._updateRange = { offset: 0, count: - 1 };
|
|
17
15
|
this.updateRanges = [];
|
|
18
16
|
|
|
19
17
|
this.version = 0;
|
|
@@ -30,13 +28,6 @@ class InterleavedBuffer {
|
|
|
30
28
|
|
|
31
29
|
}
|
|
32
30
|
|
|
33
|
-
get updateRange() {
|
|
34
|
-
|
|
35
|
-
warnOnce( 'THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead.' ); // @deprecated, r159
|
|
36
|
-
return this._updateRange;
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
31
|
setUsage( value ) {
|
|
41
32
|
|
|
42
33
|
this.usage = value;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { EventDispatcher } from '../core/EventDispatcher.js';
|
|
2
|
+
|
|
3
|
+
class Controls extends EventDispatcher {
|
|
4
|
+
|
|
5
|
+
constructor( object, domElement = null ) {
|
|
6
|
+
|
|
7
|
+
super();
|
|
8
|
+
|
|
9
|
+
this.object = object;
|
|
10
|
+
this.domElement = domElement;
|
|
11
|
+
|
|
12
|
+
this.enabled = true;
|
|
13
|
+
|
|
14
|
+
this.state = - 1;
|
|
15
|
+
|
|
16
|
+
this.keys = {};
|
|
17
|
+
this.mouseButtons = { LEFT: null, MIDDLE: null, RIGHT: null };
|
|
18
|
+
this.touches = { ONE: null, TWO: null };
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
connect() {}
|
|
23
|
+
|
|
24
|
+
disconnect() {}
|
|
25
|
+
|
|
26
|
+
dispose() {}
|
|
27
|
+
|
|
28
|
+
update( /* delta */ ) {}
|
|
29
|
+
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { Controls };
|
|
@@ -133,12 +133,19 @@ class CylinderGeometry extends BufferGeometry {
|
|
|
133
133
|
|
|
134
134
|
// faces
|
|
135
135
|
|
|
136
|
-
|
|
137
|
-
indices.push( b, c, d );
|
|
136
|
+
if ( radiusTop > 0 ) {
|
|
138
137
|
|
|
139
|
-
|
|
138
|
+
indices.push( a, b, d );
|
|
139
|
+
groupCount += 3;
|
|
140
140
|
|
|
141
|
-
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
if ( radiusBottom > 0 ) {
|
|
144
|
+
|
|
145
|
+
indices.push( b, c, d );
|
|
146
|
+
groupCount += 3;
|
|
147
|
+
|
|
148
|
+
}
|
|
142
149
|
|
|
143
150
|
}
|
|
144
151
|
|
|
@@ -86,7 +86,7 @@ class MaterialLoader extends Loader {
|
|
|
86
86
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
const material =
|
|
89
|
+
const material = this.createMaterialFromType( json.type );
|
|
90
90
|
|
|
91
91
|
if ( json.uuid !== undefined ) material.uuid = json.uuid;
|
|
92
92
|
if ( json.name !== undefined ) material.name = json.name;
|
|
@@ -342,6 +342,12 @@ class MaterialLoader extends Loader {
|
|
|
342
342
|
|
|
343
343
|
}
|
|
344
344
|
|
|
345
|
+
createMaterialFromType( type ) {
|
|
346
|
+
|
|
347
|
+
return MaterialLoader.createMaterialFromType( type );
|
|
348
|
+
|
|
349
|
+
}
|
|
350
|
+
|
|
345
351
|
static createMaterialFromType( type ) {
|
|
346
352
|
|
|
347
353
|
const materialLib = {
|
|
@@ -851,7 +851,7 @@ class ObjectLoader extends Loader {
|
|
|
851
851
|
case 'DirectionalLight':
|
|
852
852
|
|
|
853
853
|
object = new DirectionalLight( data.color, data.intensity );
|
|
854
|
-
object.target = data.target ||
|
|
854
|
+
object.target = data.target || '';
|
|
855
855
|
|
|
856
856
|
break;
|
|
857
857
|
|
|
@@ -870,7 +870,7 @@ class ObjectLoader extends Loader {
|
|
|
870
870
|
case 'SpotLight':
|
|
871
871
|
|
|
872
872
|
object = new SpotLight( data.color, data.intensity, data.distance, data.angle, data.penumbra, data.decay );
|
|
873
|
-
object.target = data.target ||
|
|
873
|
+
object.target = data.target || '';
|
|
874
874
|
|
|
875
875
|
break;
|
|
876
876
|
|
|
@@ -1147,7 +1147,7 @@ class ObjectLoader extends Loader {
|
|
|
1147
1147
|
|
|
1148
1148
|
object.traverse( function ( child ) {
|
|
1149
1149
|
|
|
1150
|
-
if ( child.isDirectionalLight ||
|
|
1150
|
+
if ( child.isDirectionalLight || child.isSpotLight ) {
|
|
1151
1151
|
|
|
1152
1152
|
const uuid = child.target;
|
|
1153
1153
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { nodeObject } from '../shadernode/ShaderNode.js';
|
|
1
|
+
import { nodeObject, float } from '../../nodes/tsl/TSLBase.js';
|
|
3
2
|
|
|
4
|
-
import { Loader } from '
|
|
3
|
+
import { Loader } from '../Loader.js';
|
|
5
4
|
import { FileLoader } from '../../loaders/FileLoader.js';
|
|
6
5
|
|
|
7
6
|
class NodeLoader extends Loader {
|
|
@@ -11,6 +10,7 @@ class NodeLoader extends Loader {
|
|
|
11
10
|
super( manager );
|
|
12
11
|
|
|
13
12
|
this.textures = {};
|
|
13
|
+
this.nodes = {};
|
|
14
14
|
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -56,7 +56,7 @@ class NodeLoader extends Loader {
|
|
|
56
56
|
|
|
57
57
|
const { uuid, type } = nodeJSON;
|
|
58
58
|
|
|
59
|
-
nodes[ uuid ] =
|
|
59
|
+
nodes[ uuid ] = this.createNodeFromType( type );
|
|
60
60
|
nodes[ uuid ].uuid = uuid;
|
|
61
61
|
|
|
62
62
|
}
|
|
@@ -82,7 +82,7 @@ class NodeLoader extends Loader {
|
|
|
82
82
|
|
|
83
83
|
parse( json ) {
|
|
84
84
|
|
|
85
|
-
const node =
|
|
85
|
+
const node = this.createNodeFromType( json.type );
|
|
86
86
|
node.uuid = json.uuid;
|
|
87
87
|
|
|
88
88
|
const nodes = this.parseNodes( json.nodes );
|
|
@@ -105,6 +105,26 @@ class NodeLoader extends Loader {
|
|
|
105
105
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
+
setNodes( value ) {
|
|
109
|
+
|
|
110
|
+
this.nodes = value;
|
|
111
|
+
return this;
|
|
112
|
+
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
createNodeFromType( type ) {
|
|
116
|
+
|
|
117
|
+
if ( this.nodes[ type ] === undefined ) {
|
|
118
|
+
|
|
119
|
+
console.error( 'THREE.NodeLoader: Node type not found:', type );
|
|
120
|
+
return float();
|
|
121
|
+
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return nodeObject( new this.nodes[ type ]() );
|
|
125
|
+
|
|
126
|
+
}
|
|
127
|
+
|
|
108
128
|
}
|
|
109
129
|
|
|
110
130
|
export default NodeLoader;
|
|
@@ -1,23 +1,5 @@
|
|
|
1
|
-
import { createNodeMaterialFromType } from '../materials/Materials.js';
|
|
2
|
-
|
|
3
1
|
import { MaterialLoader } from '../../loaders/MaterialLoader.js';
|
|
4
2
|
|
|
5
|
-
const superFromTypeFunction = MaterialLoader.createMaterialFromType;
|
|
6
|
-
|
|
7
|
-
MaterialLoader.createMaterialFromType = function ( type ) {
|
|
8
|
-
|
|
9
|
-
const material = createNodeMaterialFromType( type );
|
|
10
|
-
|
|
11
|
-
if ( material !== undefined ) {
|
|
12
|
-
|
|
13
|
-
return material;
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
return superFromTypeFunction.call( this, type );
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
|
|
21
3
|
class NodeMaterialLoader extends MaterialLoader {
|
|
22
4
|
|
|
23
5
|
constructor( manager ) {
|
|
@@ -25,6 +7,7 @@ class NodeMaterialLoader extends MaterialLoader {
|
|
|
25
7
|
super( manager );
|
|
26
8
|
|
|
27
9
|
this.nodes = {};
|
|
10
|
+
this.nodeMaterials = {};
|
|
28
11
|
|
|
29
12
|
}
|
|
30
13
|
|
|
@@ -50,11 +33,31 @@ class NodeMaterialLoader extends MaterialLoader {
|
|
|
50
33
|
setNodes( value ) {
|
|
51
34
|
|
|
52
35
|
this.nodes = value;
|
|
36
|
+
return this;
|
|
53
37
|
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
setNodeMaterials( value ) {
|
|
41
|
+
|
|
42
|
+
this.nodeMaterials = value;
|
|
54
43
|
return this;
|
|
55
44
|
|
|
56
45
|
}
|
|
57
46
|
|
|
47
|
+
createMaterialFromType( type ) {
|
|
48
|
+
|
|
49
|
+
const materialClass = this.nodeMaterials[ type ];
|
|
50
|
+
|
|
51
|
+
if ( materialClass !== undefined ) {
|
|
52
|
+
|
|
53
|
+
return new materialClass();
|
|
54
|
+
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return super.createMaterialFromType( type );
|
|
58
|
+
|
|
59
|
+
}
|
|
60
|
+
|
|
58
61
|
}
|
|
59
62
|
|
|
60
63
|
export default NodeMaterialLoader;
|
|
@@ -9,10 +9,27 @@ class NodeObjectLoader extends ObjectLoader {
|
|
|
9
9
|
|
|
10
10
|
super( manager );
|
|
11
11
|
|
|
12
|
+
this.nodes = {};
|
|
13
|
+
this.nodeMaterials = {};
|
|
14
|
+
|
|
12
15
|
this._nodesJSON = null;
|
|
13
16
|
|
|
14
17
|
}
|
|
15
18
|
|
|
19
|
+
setNodes( value ) {
|
|
20
|
+
|
|
21
|
+
this.nodes = value;
|
|
22
|
+
return this;
|
|
23
|
+
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
setNodeMaterials( value ) {
|
|
27
|
+
|
|
28
|
+
this.nodeMaterials = value;
|
|
29
|
+
return this;
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
|
|
16
33
|
parse( json, onLoad ) {
|
|
17
34
|
|
|
18
35
|
this._nodesJSON = json.nodes;
|
|
@@ -30,6 +47,7 @@ class NodeObjectLoader extends ObjectLoader {
|
|
|
30
47
|
if ( json !== undefined ) {
|
|
31
48
|
|
|
32
49
|
const loader = new NodeLoader();
|
|
50
|
+
loader.setNodes( this.nodes );
|
|
33
51
|
loader.setTextures( textures );
|
|
34
52
|
|
|
35
53
|
return loader.parseNodes( json );
|
|
@@ -51,6 +69,7 @@ class NodeObjectLoader extends ObjectLoader {
|
|
|
51
69
|
const loader = new NodeMaterialLoader();
|
|
52
70
|
loader.setTextures( textures );
|
|
53
71
|
loader.setNodes( nodes );
|
|
72
|
+
loader.setNodeMaterials( this.nodeMaterials );
|
|
54
73
|
|
|
55
74
|
for ( let i = 0, l = json.length; i < l; i ++ ) {
|
|
56
75
|
|
|
@@ -100,6 +100,10 @@ class Material extends EventDispatcher {
|
|
|
100
100
|
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
+
// onBeforeRender and onBeforeCompile only supported in WebGLRenderer
|
|
104
|
+
|
|
105
|
+
onBeforeRender( /* renderer, scene, camera, geometry, object, group */ ) {}
|
|
106
|
+
|
|
103
107
|
onBeforeCompile( /* shaderobject, renderer */ ) {}
|
|
104
108
|
|
|
105
109
|
customProgramCacheKey() {
|
|
@@ -522,13 +526,6 @@ class Material extends EventDispatcher {
|
|
|
522
526
|
|
|
523
527
|
}
|
|
524
528
|
|
|
525
|
-
onBeforeRender( /* renderer, scene, camera, geometry, object, group */ ) {
|
|
526
|
-
|
|
527
|
-
console.warn( 'Material: onBeforeRender() has been removed.' ); // @deprecated, r166
|
|
528
|
-
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
|
|
532
529
|
}
|
|
533
530
|
|
|
534
531
|
export { Material };
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import NodeMaterial from './NodeMaterial.js';
|
|
2
|
+
import { attribute } from '../../nodes/core/AttributeNode.js';
|
|
3
|
+
import { cameraProjectionMatrix } from '../../nodes/accessors/Camera.js';
|
|
4
|
+
import { materialColor, materialOpacity, materialPointWidth } from '../../nodes/accessors/MaterialNode.js'; // or should this be a property, instead?
|
|
5
|
+
import { modelViewMatrix } from '../../nodes/accessors/ModelNode.js';
|
|
6
|
+
import { positionGeometry } from '../../nodes/accessors/Position.js';
|
|
7
|
+
import { smoothstep, lengthSq } from '../../nodes/math/MathNode.js';
|
|
8
|
+
import { Fn, vec4, float } from '../../nodes/tsl/TSLBase.js';
|
|
9
|
+
import { uv } from '../../nodes/accessors/UV.js';
|
|
10
|
+
import { viewport } from '../../nodes/display/ScreenNode.js';
|
|
11
|
+
|
|
12
|
+
import { PointsMaterial } from '../PointsMaterial.js';
|
|
13
|
+
|
|
14
|
+
const _defaultValues = /*@__PURE__*/ new PointsMaterial();
|
|
15
|
+
|
|
16
|
+
class InstancedPointsNodeMaterial extends NodeMaterial {
|
|
17
|
+
|
|
18
|
+
static get type() {
|
|
19
|
+
|
|
20
|
+
return 'InstancedPointsNodeMaterial';
|
|
21
|
+
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
constructor( params = {} ) {
|
|
25
|
+
|
|
26
|
+
super();
|
|
27
|
+
|
|
28
|
+
this.lights = false;
|
|
29
|
+
|
|
30
|
+
this.useAlphaToCoverage = true;
|
|
31
|
+
|
|
32
|
+
this.useColor = params.vertexColors;
|
|
33
|
+
|
|
34
|
+
this.pointWidth = 1;
|
|
35
|
+
|
|
36
|
+
this.pointColorNode = null;
|
|
37
|
+
|
|
38
|
+
this.pointWidthNode = null;
|
|
39
|
+
|
|
40
|
+
this.setDefaultValues( _defaultValues );
|
|
41
|
+
|
|
42
|
+
this.setValues( params );
|
|
43
|
+
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
setup( builder ) {
|
|
47
|
+
|
|
48
|
+
this.setupShaders( builder );
|
|
49
|
+
|
|
50
|
+
super.setup( builder );
|
|
51
|
+
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
setupShaders( { renderer } ) {
|
|
55
|
+
|
|
56
|
+
const useAlphaToCoverage = this.alphaToCoverage;
|
|
57
|
+
const useColor = this.useColor;
|
|
58
|
+
|
|
59
|
+
this.vertexNode = Fn( () => {
|
|
60
|
+
|
|
61
|
+
const instancePosition = attribute( 'instancePosition' ).xyz;
|
|
62
|
+
|
|
63
|
+
// camera space
|
|
64
|
+
const mvPos = vec4( modelViewMatrix.mul( vec4( instancePosition, 1.0 ) ) );
|
|
65
|
+
|
|
66
|
+
const aspect = viewport.z.div( viewport.w );
|
|
67
|
+
|
|
68
|
+
// clip space
|
|
69
|
+
const clipPos = cameraProjectionMatrix.mul( mvPos );
|
|
70
|
+
|
|
71
|
+
// offset in ndc space
|
|
72
|
+
const offset = positionGeometry.xy.toVar();
|
|
73
|
+
|
|
74
|
+
offset.mulAssign( this.pointWidthNode ? this.pointWidthNode : materialPointWidth );
|
|
75
|
+
|
|
76
|
+
offset.assign( offset.div( viewport.z ) );
|
|
77
|
+
offset.y.assign( offset.y.mul( aspect ) );
|
|
78
|
+
|
|
79
|
+
// back to clip space
|
|
80
|
+
offset.assign( offset.mul( clipPos.w ) );
|
|
81
|
+
|
|
82
|
+
//clipPos.xy += offset;
|
|
83
|
+
clipPos.addAssign( vec4( offset, 0, 0 ) );
|
|
84
|
+
|
|
85
|
+
return clipPos;
|
|
86
|
+
|
|
87
|
+
} )();
|
|
88
|
+
|
|
89
|
+
this.fragmentNode = Fn( () => {
|
|
90
|
+
|
|
91
|
+
const alpha = float( 1 ).toVar();
|
|
92
|
+
|
|
93
|
+
const len2 = lengthSq( uv().mul( 2 ).sub( 1 ) );
|
|
94
|
+
|
|
95
|
+
if ( useAlphaToCoverage && renderer.samples > 1 ) {
|
|
96
|
+
|
|
97
|
+
const dlen = float( len2.fwidth() ).toVar();
|
|
98
|
+
|
|
99
|
+
alpha.assign( smoothstep( dlen.oneMinus(), dlen.add( 1 ), len2 ).oneMinus() );
|
|
100
|
+
|
|
101
|
+
} else {
|
|
102
|
+
|
|
103
|
+
len2.greaterThan( 1.0 ).discard();
|
|
104
|
+
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
let pointColorNode;
|
|
108
|
+
|
|
109
|
+
if ( this.pointColorNode ) {
|
|
110
|
+
|
|
111
|
+
pointColorNode = this.pointColorNode;
|
|
112
|
+
|
|
113
|
+
} else {
|
|
114
|
+
|
|
115
|
+
if ( useColor ) {
|
|
116
|
+
|
|
117
|
+
const instanceColor = attribute( 'instanceColor' );
|
|
118
|
+
|
|
119
|
+
pointColorNode = instanceColor.mul( materialColor );
|
|
120
|
+
|
|
121
|
+
} else {
|
|
122
|
+
|
|
123
|
+
pointColorNode = materialColor;
|
|
124
|
+
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
alpha.mulAssign( materialOpacity );
|
|
130
|
+
|
|
131
|
+
return vec4( pointColorNode, alpha );
|
|
132
|
+
|
|
133
|
+
} )();
|
|
134
|
+
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
get alphaToCoverage() {
|
|
138
|
+
|
|
139
|
+
return this.useAlphaToCoverage;
|
|
140
|
+
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
set alphaToCoverage( value ) {
|
|
144
|
+
|
|
145
|
+
if ( this.useAlphaToCoverage !== value ) {
|
|
146
|
+
|
|
147
|
+
this.useAlphaToCoverage = value;
|
|
148
|
+
this.needsUpdate = true;
|
|
149
|
+
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export default InstancedPointsNodeMaterial;
|