super-three 0.177.0 → 0.181.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 +1 -1
- package/build/three.cjs +1994 -749
- package/build/three.core.js +1358 -506
- package/build/three.core.min.js +1 -1
- package/build/three.module.js +631 -247
- package/build/three.module.min.js +1 -1
- package/build/three.tsl.js +113 -33
- package/build/three.tsl.min.js +1 -1
- package/build/three.webgpu.js +9571 -3424
- package/build/three.webgpu.min.js +1 -1
- package/build/three.webgpu.nodes.js +9397 -3426
- package/build/three.webgpu.nodes.min.js +1 -1
- package/examples/fonts/MPLUSRounded1c/MPLUSRounded1c-Regular.typeface.json.zip +0 -0
- package/examples/fonts/MPLUSRounded1c/OFL.txt +91 -0
- package/examples/jsm/Addons.js +2 -3
- package/examples/jsm/animation/CCDIKSolver.js +1 -1
- package/examples/jsm/capabilities/WebGL.js +0 -27
- package/examples/jsm/capabilities/WebGPU.js +1 -1
- package/examples/jsm/controls/ArcballControls.js +9 -9
- package/examples/jsm/controls/DragControls.js +7 -57
- package/examples/jsm/controls/FirstPersonControls.js +3 -3
- package/examples/jsm/controls/FlyControls.js +1 -1
- package/examples/jsm/controls/OrbitControls.js +2 -2
- package/examples/jsm/controls/PointerLockControls.js +2 -10
- package/examples/jsm/controls/TrackballControls.js +1 -1
- package/examples/jsm/controls/TransformControls.js +62 -15
- package/examples/jsm/csm/CSMShadowNode.js +4 -4
- package/examples/jsm/effects/AsciiEffect.js +8 -8
- package/examples/jsm/environments/RoomEnvironment.js +8 -3
- package/examples/jsm/exporters/DRACOExporter.js +2 -2
- package/examples/jsm/exporters/EXRExporter.js +1 -1
- package/examples/jsm/exporters/GLTFExporter.js +33 -25
- package/examples/jsm/exporters/KTX2Exporter.js +4 -2
- package/examples/jsm/exporters/PLYExporter.js +1 -1
- package/examples/jsm/exporters/USDZExporter.js +683 -299
- package/examples/jsm/geometries/DecalGeometry.js +2 -2
- package/examples/jsm/geometries/ParametricGeometry.js +1 -1
- package/examples/jsm/geometries/RoundedBoxGeometry.js +47 -8
- package/examples/jsm/geometries/TeapotGeometry.js +2 -2
- package/examples/jsm/geometries/TextGeometry.js +3 -2
- package/examples/jsm/gpgpu/BitonicSort.js +715 -0
- package/examples/jsm/helpers/ViewHelper.js +43 -5
- package/examples/jsm/inspector/Inspector.js +427 -0
- package/examples/jsm/inspector/RendererInspector.js +415 -0
- package/examples/jsm/inspector/tabs/Console.js +204 -0
- package/examples/jsm/inspector/tabs/Parameters.js +332 -0
- package/examples/jsm/inspector/tabs/Performance.js +268 -0
- package/examples/jsm/inspector/tabs/Viewer.js +166 -0
- package/examples/jsm/inspector/ui/Graph.js +95 -0
- package/examples/jsm/inspector/ui/Item.js +170 -0
- package/examples/jsm/inspector/ui/List.js +75 -0
- package/examples/jsm/inspector/ui/Profiler.js +170 -0
- package/examples/jsm/inspector/ui/Style.js +654 -0
- package/examples/jsm/inspector/ui/Tab.js +46 -0
- package/examples/jsm/inspector/ui/Values.js +423 -0
- package/examples/jsm/inspector/ui/utils.js +56 -0
- package/examples/jsm/interactive/HTMLMesh.js +11 -13
- package/examples/jsm/interactive/InteractiveGroup.js +1 -1
- package/examples/jsm/interactive/SelectionBox.js +30 -0
- package/examples/jsm/libs/ktx-parse.module.js +1 -1
- package/examples/jsm/libs/meshopt_decoder.module.js +75 -58
- package/examples/jsm/lights/LightProbeGenerator.js +14 -3
- package/examples/jsm/lights/RectAreaLightTexturesLib.js +1 -1
- package/examples/jsm/lines/Line2.js +3 -3
- package/examples/jsm/lines/LineGeometry.js +1 -1
- package/examples/jsm/lines/LineSegments2.js +2 -2
- package/examples/jsm/lines/Wireframe.js +2 -2
- package/examples/jsm/lines/WireframeGeometry2.js +1 -1
- package/examples/jsm/lines/webgpu/LineSegments2.js +1 -1
- package/examples/jsm/lines/webgpu/Wireframe.js +1 -1
- package/examples/jsm/loaders/3MFLoader.js +1 -1
- package/examples/jsm/loaders/ColladaLoader.js +4 -4
- package/examples/jsm/loaders/DDSLoader.js +1 -1
- package/examples/jsm/loaders/DRACOLoader.js +73 -22
- package/examples/jsm/loaders/EXRLoader.js +210 -22
- package/examples/jsm/loaders/FBXLoader.js +4 -4
- package/examples/jsm/loaders/FontLoader.js +23 -5
- package/examples/jsm/loaders/GLTFLoader.js +14 -8
- package/examples/jsm/loaders/HDRCubeTextureLoader.js +5 -5
- package/examples/jsm/loaders/HDRLoader.js +486 -0
- package/examples/jsm/loaders/KTX2Loader.js +136 -49
- package/examples/jsm/loaders/KTXLoader.js +2 -2
- package/examples/jsm/loaders/LDrawLoader.js +1 -1
- package/examples/jsm/loaders/LUT3dlLoader.js +2 -2
- package/examples/jsm/loaders/LUTCubeLoader.js +1 -1
- package/examples/jsm/loaders/LWOLoader.js +2 -2
- package/examples/jsm/loaders/MaterialXLoader.js +233 -34
- package/examples/jsm/loaders/OBJLoader.js +1 -1
- package/examples/jsm/loaders/PDBLoader.js +1 -1
- package/examples/jsm/loaders/RGBELoader.js +7 -473
- package/examples/jsm/loaders/SVGLoader.js +2 -2
- package/examples/jsm/loaders/TTFLoader.js +13 -1
- package/examples/jsm/loaders/USDLoader.js +219 -0
- package/examples/jsm/loaders/USDZLoader.js +4 -892
- package/examples/jsm/loaders/UltraHDRLoader.js +2 -2
- package/examples/jsm/loaders/lwo/IFFParser.js +1 -1
- package/examples/jsm/loaders/usd/USDAParser.js +741 -0
- package/examples/jsm/loaders/usd/USDCParser.js +17 -0
- package/examples/jsm/materials/WoodNodeMaterial.js +533 -0
- package/examples/jsm/math/ColorSpaces.js +19 -1
- package/examples/jsm/math/ConvexHull.js +3 -3
- package/examples/jsm/math/ImprovedNoise.js +1 -1
- package/examples/jsm/math/Lut.js +2 -2
- package/examples/jsm/math/SimplexNoise.js +1 -1
- package/examples/jsm/misc/MD2CharacterComplex.js +1 -1
- package/examples/jsm/misc/ProgressiveLightMap.js +9 -3
- package/examples/jsm/misc/ProgressiveLightMapGPU.js +7 -1
- package/examples/jsm/misc/TubePainter.js +383 -40
- package/examples/jsm/misc/Volume.js +1 -1
- package/examples/jsm/modifiers/SimplifyModifier.js +1 -1
- package/examples/jsm/objects/LensflareMesh.js +3 -3
- package/examples/jsm/objects/ReflectorForSSRPass.js +1 -0
- package/examples/jsm/objects/Sky.js +1 -1
- package/examples/jsm/objects/SkyMesh.js +3 -3
- package/examples/jsm/objects/Water.js +3 -3
- package/examples/jsm/objects/WaterMesh.js +6 -6
- package/examples/jsm/physics/RapierPhysics.js +95 -16
- package/examples/jsm/postprocessing/GTAOPass.js +10 -9
- package/examples/jsm/postprocessing/GlitchPass.js +2 -2
- package/examples/jsm/postprocessing/OutlinePass.js +17 -17
- package/examples/jsm/postprocessing/SSAOPass.js +10 -9
- package/examples/jsm/postprocessing/SSRPass.js +37 -8
- package/examples/jsm/postprocessing/UnrealBloomPass.js +8 -6
- package/examples/jsm/renderers/CSS2DRenderer.js +16 -5
- package/examples/jsm/renderers/CSS3DRenderer.js +7 -6
- package/examples/jsm/renderers/SVGRenderer.js +1 -1
- package/examples/jsm/shaders/ACESFilmicToneMappingShader.js +1 -1
- package/examples/jsm/shaders/AfterimageShader.js +1 -1
- package/examples/jsm/shaders/BleachBypassShader.js +1 -1
- package/examples/jsm/shaders/BokehShader.js +1 -1
- package/examples/jsm/shaders/BokehShader2.js +1 -1
- package/examples/jsm/shaders/DotScreenShader.js +1 -1
- package/examples/jsm/shaders/FocusShader.js +1 -1
- package/examples/jsm/shaders/GTAOShader.js +2 -2
- package/examples/jsm/shaders/GodRaysShader.js +1 -1
- package/examples/jsm/shaders/KaleidoShader.js +1 -1
- package/examples/jsm/shaders/PoissonDenoiseShader.js +2 -2
- package/examples/jsm/shaders/SSRShader.js +1 -1
- package/examples/jsm/shaders/SepiaShader.js +1 -1
- package/examples/jsm/shaders/SubsurfaceScatteringShader.js +1 -1
- package/examples/jsm/shaders/TriangleBlurShader.js +1 -1
- package/examples/jsm/shaders/UnpackDepthRGBAShader.js +11 -2
- package/examples/jsm/shaders/VignetteShader.js +1 -1
- package/examples/jsm/transpiler/AST.js +381 -30
- package/examples/jsm/transpiler/GLSLDecoder.js +247 -104
- package/examples/jsm/transpiler/Linker.js +327 -0
- package/examples/jsm/transpiler/TSLEncoder.js +196 -92
- package/examples/jsm/transpiler/Transpiler.js +17 -1
- package/examples/jsm/transpiler/TranspilerUtils.js +29 -0
- package/examples/jsm/transpiler/WGSLEncoder.js +812 -0
- package/examples/jsm/tsl/display/AfterImageNode.js +26 -24
- package/examples/jsm/tsl/display/AnamorphicNode.js +28 -4
- package/examples/jsm/tsl/display/BloomNode.js +11 -6
- package/examples/jsm/tsl/display/ChromaticAberrationNode.js +207 -0
- package/examples/jsm/tsl/display/DenoiseNode.js +2 -0
- package/examples/jsm/tsl/display/DepthOfFieldNode.js +446 -90
- package/examples/jsm/tsl/display/GTAONode.js +53 -5
- package/examples/jsm/tsl/display/GaussianBlurNode.js +55 -43
- package/examples/jsm/tsl/display/OutlineNode.js +13 -2
- package/examples/jsm/tsl/display/SSAAPassNode.js +2 -2
- package/examples/jsm/tsl/display/SSGINode.js +654 -0
- package/examples/jsm/tsl/display/SSRNode.js +182 -65
- package/examples/jsm/tsl/display/SSSNode.js +488 -0
- package/examples/jsm/tsl/display/TRAANode.js +578 -0
- package/examples/jsm/tsl/display/boxBlur.js +65 -0
- package/examples/jsm/tsl/display/hashBlur.js +18 -20
- package/examples/jsm/tsl/lighting/TiledLightsNode.js +22 -2
- package/examples/jsm/utils/BufferGeometryUtils.js +1 -1
- package/examples/jsm/utils/ShadowMapViewerGPU.js +12 -5
- package/examples/jsm/webxr/OculusHandModel.js +1 -1
- package/examples/jsm/webxr/XRControllerModelFactory.js +1 -1
- package/examples/jsm/webxr/XRHandModelFactory.js +2 -6
- package/package.json +5 -10
- package/src/Three.Core.js +5 -2
- package/src/Three.TSL.js +112 -32
- package/src/Three.WebGPU.Nodes.js +2 -0
- package/src/Three.WebGPU.js +4 -0
- package/src/animation/AnimationClip.js +20 -4
- package/src/animation/AnimationMixer.js +3 -3
- package/src/animation/AnimationObjectGroup.js +2 -1
- package/src/animation/KeyframeTrack.js +8 -7
- package/src/animation/PropertyBinding.js +12 -11
- package/src/animation/tracks/BooleanKeyframeTrack.js +1 -1
- package/src/animation/tracks/StringKeyframeTrack.js +1 -1
- package/src/audio/Audio.js +10 -9
- package/src/audio/PositionalAudio.js +1 -1
- package/src/cameras/Camera.js +14 -0
- package/src/cameras/OrthographicCamera.js +2 -2
- package/src/cameras/PerspectiveCamera.js +2 -2
- package/src/cameras/StereoCamera.js +2 -2
- package/src/constants.js +13 -5
- package/src/core/BufferAttribute.js +3 -3
- package/src/core/BufferGeometry.js +10 -10
- package/src/core/Clock.js +2 -8
- package/src/core/EventDispatcher.js +1 -1
- package/src/core/GLBufferAttribute.js +13 -1
- package/src/core/InterleavedBuffer.js +1 -1
- package/src/core/InterleavedBufferAttribute.js +3 -2
- package/src/core/Object3D.js +4 -3
- package/src/core/Raycaster.js +2 -1
- package/src/core/RenderTarget.js +10 -1
- package/{examples/jsm/misc → src/core}/Timer.js +4 -42
- package/src/extras/Controls.js +5 -4
- package/src/extras/DataUtils.js +2 -1
- package/src/extras/Earcut.js +6 -0
- package/src/extras/ImageUtils.js +2 -2
- package/src/extras/PMREMGenerator.js +279 -55
- package/src/extras/TextureUtils.js +2 -1
- package/src/extras/core/Curve.js +2 -1
- package/src/extras/core/Interpolations.js +7 -1
- package/src/extras/core/Path.js +22 -22
- package/src/extras/core/ShapePath.js +4 -4
- package/src/extras/lib/earcut.js +8 -8
- package/src/geometries/BoxGeometry.js +1 -0
- package/src/geometries/CapsuleGeometry.js +1 -0
- package/src/geometries/CircleGeometry.js +1 -0
- package/src/geometries/ConeGeometry.js +1 -0
- package/src/geometries/CylinderGeometry.js +1 -0
- package/src/geometries/DodecahedronGeometry.js +1 -0
- package/src/geometries/ExtrudeGeometry.js +8 -6
- package/src/geometries/IcosahedronGeometry.js +1 -0
- package/src/geometries/LatheGeometry.js +1 -0
- package/src/geometries/OctahedronGeometry.js +1 -0
- package/src/geometries/PlaneGeometry.js +1 -0
- package/src/geometries/RingGeometry.js +1 -0
- package/src/geometries/ShapeGeometry.js +1 -0
- package/src/geometries/SphereGeometry.js +1 -0
- package/src/geometries/TetrahedronGeometry.js +1 -0
- package/src/geometries/TorusGeometry.js +1 -0
- package/src/geometries/TorusKnotGeometry.js +1 -0
- package/src/geometries/TubeGeometry.js +1 -0
- package/src/helpers/CameraHelper.js +42 -12
- package/src/helpers/SkeletonHelper.js +35 -6
- package/src/lights/LightShadow.js +21 -8
- package/src/lights/PointLightShadow.js +1 -1
- package/src/lights/webgpu/ProjectorLight.js +1 -1
- package/src/loaders/AnimationLoader.js +2 -1
- package/src/loaders/AudioLoader.js +2 -1
- package/src/loaders/BufferGeometryLoader.js +2 -2
- package/src/loaders/Cache.js +2 -2
- package/src/loaders/DataTextureLoader.js +1 -1
- package/src/loaders/FileLoader.js +29 -5
- package/src/loaders/ImageBitmapLoader.js +32 -8
- package/src/loaders/ImageLoader.js +56 -9
- package/src/loaders/Loader.js +17 -3
- package/src/loaders/LoadingManager.js +45 -0
- package/src/loaders/MaterialLoader.js +3 -2
- package/src/loaders/ObjectLoader.js +13 -13
- package/src/loaders/TextureLoader.js +1 -1
- package/src/loaders/nodes/NodeLoader.js +3 -2
- package/src/materials/Material.js +16 -3
- package/src/materials/MeshBasicMaterial.js +2 -1
- package/src/materials/MeshDepthMaterial.js +1 -0
- package/src/materials/MeshDistanceMaterial.js +1 -1
- package/src/materials/MeshLambertMaterial.js +2 -1
- package/src/materials/MeshMatcapMaterial.js +22 -0
- package/src/materials/MeshNormalMaterial.js +1 -0
- package/src/materials/MeshPhongMaterial.js +2 -1
- package/src/materials/MeshPhysicalMaterial.js +2 -1
- package/src/materials/MeshStandardMaterial.js +8 -7
- package/src/materials/MeshToonMaterial.js +1 -0
- package/src/materials/PointsMaterial.js +1 -1
- package/src/materials/ShaderMaterial.js +2 -2
- package/src/materials/nodes/Line2NodeMaterial.js +2 -10
- package/src/materials/nodes/MeshBasicNodeMaterial.js +4 -3
- package/src/materials/nodes/MeshMatcapNodeMaterial.js +1 -1
- package/src/materials/nodes/MeshNormalNodeMaterial.js +2 -2
- package/src/materials/nodes/MeshPhysicalNodeMaterial.js +2 -1
- package/src/materials/nodes/MeshSSSNodeMaterial.js +3 -3
- package/src/materials/nodes/NodeMaterial.js +90 -27
- package/src/materials/nodes/PointsNodeMaterial.js +86 -28
- package/src/materials/nodes/SpriteNodeMaterial.js +3 -15
- package/src/materials/nodes/manager/NodeMaterialObserver.js +89 -3
- package/src/math/Color.js +6 -5
- package/src/math/ColorManagement.js +9 -3
- package/src/math/Cylindrical.js +1 -1
- package/src/math/Euler.js +2 -1
- package/src/math/Frustum.js +25 -9
- package/src/math/FrustumArray.js +10 -5
- package/src/math/Line3.js +129 -2
- package/src/math/MathUtils.js +13 -11
- package/src/math/Matrix2.js +1 -1
- package/src/math/Matrix3.js +2 -2
- package/src/math/Matrix4.js +55 -34
- package/src/math/Plane.js +1 -1
- package/src/math/Quaternion.js +69 -67
- package/src/math/Spherical.js +3 -3
- package/src/nodes/Nodes.js +6 -4
- package/src/nodes/TSL.js +9 -4
- package/src/nodes/accessors/AccessorsUtils.js +7 -8
- package/src/nodes/accessors/Bitangent.js +31 -25
- package/src/nodes/accessors/BufferNode.js +1 -1
- package/src/nodes/accessors/Camera.js +142 -16
- package/src/nodes/accessors/ClippingNode.js +6 -5
- package/src/nodes/accessors/CubeTextureNode.js +5 -4
- package/src/nodes/accessors/InstanceNode.js +25 -5
- package/src/nodes/accessors/Lights.js +10 -0
- package/src/nodes/accessors/Normal.js +97 -30
- package/src/nodes/accessors/Object3DNode.js +2 -2
- package/src/nodes/accessors/Position.js +25 -9
- package/src/nodes/accessors/ReferenceBaseNode.js +1 -1
- package/src/nodes/accessors/ReferenceNode.js +20 -4
- package/src/nodes/accessors/ReflectVector.js +3 -3
- package/src/nodes/accessors/SceneNode.js +3 -2
- package/src/nodes/accessors/StorageBufferNode.js +2 -1
- package/src/nodes/accessors/StorageTextureNode.js +23 -1
- package/src/nodes/accessors/Tangent.js +25 -17
- package/src/nodes/accessors/TangentUtils.js +46 -0
- package/src/nodes/accessors/Texture3DNode.js +14 -1
- package/src/nodes/accessors/TextureBicubic.js +21 -3
- package/src/nodes/accessors/TextureNode.js +142 -44
- package/src/nodes/accessors/UniformArrayNode.js +0 -16
- package/src/nodes/code/FunctionCallNode.js +24 -4
- package/src/nodes/code/FunctionNode.js +23 -0
- package/src/nodes/core/ArrayNode.js +13 -0
- package/src/nodes/core/AssignNode.js +6 -2
- package/src/nodes/core/AttributeNode.js +2 -1
- package/src/nodes/core/ContextNode.js +48 -10
- package/src/nodes/core/IndexNode.js +2 -2
- package/src/nodes/core/InputNode.js +2 -1
- package/src/nodes/core/InspectorNode.js +128 -0
- package/src/nodes/core/{CacheNode.js → IsolateNode.js} +36 -17
- package/src/nodes/core/Node.js +167 -34
- package/src/nodes/core/NodeBuilder.js +404 -120
- package/src/nodes/core/NodeFrame.js +21 -21
- package/src/nodes/core/NodeFunction.js +2 -1
- package/src/nodes/core/NodeParser.js +2 -1
- package/src/nodes/core/NodeUniform.js +1 -1
- package/src/nodes/core/NodeUtils.js +17 -88
- package/src/nodes/core/ParameterNode.js +31 -0
- package/src/nodes/core/PropertyNode.js +7 -0
- package/src/nodes/core/StackNode.js +77 -30
- package/src/nodes/core/StructNode.js +5 -5
- package/src/nodes/core/StructTypeNode.js +1 -0
- package/src/nodes/core/SubBuildNode.js +89 -0
- package/src/nodes/core/UniformNode.js +80 -14
- package/src/nodes/core/VarNode.js +142 -16
- package/src/nodes/core/VaryingNode.js +9 -6
- package/src/nodes/display/BlendModes.js +7 -6
- package/src/nodes/display/BumpMapNode.js +1 -1
- package/src/nodes/display/ColorAdjustment.js +1 -1
- package/src/nodes/display/FrontFacingNode.js +35 -7
- package/src/nodes/display/NormalMapNode.js +20 -50
- package/src/nodes/display/PassNode.js +206 -17
- package/src/nodes/display/RenderOutputNode.js +28 -2
- package/src/nodes/display/ScreenNode.js +44 -40
- package/src/nodes/display/ToneMappingNode.js +31 -4
- package/src/nodes/display/ToonOutlinePassNode.js +8 -0
- package/src/nodes/display/ViewportDepthTextureNode.js +16 -4
- package/src/nodes/display/ViewportSharedTextureNode.js +12 -0
- package/src/nodes/display/ViewportTextureNode.js +94 -4
- package/src/nodes/fog/Fog.js +3 -2
- package/src/nodes/functions/BSDF/BRDF_GGX.js +2 -6
- package/src/nodes/functions/BSDF/BRDF_GGX_Multiscatter.js +52 -0
- package/src/nodes/functions/BSDF/BRDF_Sheen.js +4 -4
- package/src/nodes/functions/BSDF/DFGApprox.js +60 -19
- package/src/nodes/functions/BasicLightingModel.js +2 -1
- package/src/nodes/functions/PhongLightingModel.js +3 -3
- package/src/nodes/functions/PhysicalLightingModel.js +19 -18
- package/src/nodes/functions/VolumetricLightingModel.js +5 -5
- package/src/nodes/functions/material/getGeometryRoughness.js +2 -2
- package/src/nodes/geometry/RangeNode.js +40 -4
- package/src/nodes/gpgpu/AtomicFunctionNode.js +1 -1
- package/src/nodes/gpgpu/ComputeBuiltinNode.js +2 -1
- package/src/nodes/gpgpu/ComputeNode.js +81 -25
- package/src/nodes/gpgpu/SubgroupFunctionNode.js +455 -0
- package/src/nodes/gpgpu/WorkgroupInfoNode.js +29 -3
- package/src/nodes/lighting/EnvironmentNode.js +11 -11
- package/src/nodes/lighting/LightsNode.js +7 -8
- package/src/nodes/lighting/PointShadowNode.js +6 -0
- package/src/nodes/lighting/ProjectorLightNode.js +19 -6
- package/src/nodes/lighting/ShadowFilterNode.js +3 -1
- package/src/nodes/lighting/ShadowNode.js +77 -10
- package/src/nodes/materialx/MaterialXNodes.js +131 -2
- package/src/nodes/materialx/lib/mx_noise.js +165 -1
- package/src/nodes/math/BitcastNode.js +156 -0
- package/src/nodes/math/ConditionalNode.js +25 -27
- package/src/nodes/math/MathNode.js +106 -65
- package/src/nodes/math/OperatorNode.js +28 -43
- package/src/nodes/pmrem/PMREMUtils.js +117 -2
- package/src/nodes/shapes/Shapes.js +1 -1
- package/src/nodes/tsl/TSLBase.js +6 -2
- package/src/nodes/tsl/TSLCore.js +546 -186
- package/src/nodes/utils/DebugNode.js +3 -2
- package/src/nodes/utils/EquirectUV.js +27 -0
- package/src/nodes/utils/EventNode.js +119 -0
- package/src/nodes/utils/FunctionOverloadingNode.js +37 -19
- package/src/nodes/utils/JoinNode.js +6 -3
- package/src/nodes/utils/LoopNode.js +20 -41
- package/src/nodes/utils/MatcapUV.js +22 -0
- package/src/nodes/utils/MemberNode.js +59 -7
- package/src/nodes/utils/PostProcessingUtils.js +28 -1
- package/src/nodes/utils/RTTNode.js +33 -6
- package/src/nodes/utils/ReflectorNode.js +68 -10
- package/src/nodes/utils/SampleNode.js +91 -0
- package/src/nodes/utils/SplitNode.js +11 -0
- package/src/nodes/utils/Timer.js +0 -47
- package/src/nodes/utils/TriplanarTextures.js +65 -0
- package/src/objects/BatchedMesh.js +6 -4
- package/src/objects/LOD.js +1 -1
- package/src/objects/Line.js +2 -1
- package/src/objects/LineSegments.js +2 -1
- package/src/objects/Skeleton.js +3 -2
- package/src/objects/SkinnedMesh.js +3 -1
- package/src/objects/Sprite.js +4 -3
- package/src/renderers/WebGLRenderer.js +77 -66
- package/src/renderers/common/Animation.js +13 -1
- package/src/renderers/common/Attributes.js +1 -1
- package/src/renderers/common/Backend.js +108 -27
- package/src/renderers/common/Background.js +4 -3
- package/src/renderers/common/Bindings.js +76 -19
- package/src/renderers/common/CanvasTarget.js +341 -0
- package/src/renderers/common/ChainMap.js +1 -1
- package/src/renderers/common/Color4.js +2 -2
- package/src/renderers/common/CubeRenderTarget.js +1 -1
- package/src/renderers/common/DataMap.js +1 -1
- package/src/renderers/common/Geometries.js +26 -0
- package/src/renderers/common/Info.js +4 -2
- package/src/renderers/common/InspectorBase.js +146 -0
- package/src/renderers/common/Pipelines.js +1 -1
- package/src/renderers/common/PostProcessing.js +61 -25
- package/src/renderers/common/QuadMesh.js +7 -1
- package/src/renderers/common/RenderContext.js +2 -2
- package/src/renderers/common/RenderList.js +7 -3
- package/src/renderers/common/RenderObject.js +84 -5
- package/src/renderers/common/RenderObjects.js +1 -1
- package/src/renderers/common/Renderer.js +486 -255
- package/src/renderers/common/RendererUtils.js +9 -0
- package/src/renderers/common/SampledTexture.js +8 -68
- package/src/renderers/common/Sampler.js +117 -0
- package/src/renderers/common/Storage3DTexture.js +100 -0
- package/src/renderers/common/StorageArrayTexture.js +84 -0
- package/src/renderers/common/StorageTexture.js +27 -0
- package/src/renderers/common/Textures.js +138 -46
- package/src/renderers/common/TimestampQueryPool.js +65 -3
- package/src/renderers/common/UniformsGroup.js +2 -1
- package/src/renderers/common/XRManager.js +63 -24
- package/src/renderers/common/XRRenderTarget.js +21 -4
- package/src/renderers/common/extras/PMREMGenerator.js +161 -66
- package/src/renderers/common/nodes/NodeBuilderState.js +1 -1
- package/src/renderers/common/nodes/NodeLibrary.js +9 -7
- package/src/renderers/common/nodes/NodeSampledTexture.js +0 -12
- package/src/renderers/common/nodes/NodeSampler.js +13 -1
- package/src/renderers/common/nodes/Nodes.js +38 -16
- package/src/renderers/shaders/DFGLUTData.js +64 -0
- package/src/renderers/shaders/ShaderChunk/common.glsl.js +0 -12
- package/src/renderers/shaders/ShaderChunk/envmap_common_pars_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/envmap_physical_pars_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js +52 -18
- package/src/renderers/shaders/ShaderChunk/logdepthbuf_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/logdepthbuf_pars_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/logdepthbuf_pars_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/logdepthbuf_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/shadowmap_pars_fragment.glsl.js +21 -11
- package/src/renderers/shaders/ShaderLib/depth.glsl.js +11 -2
- package/src/renderers/shaders/UniformsLib.js +1 -0
- package/src/renderers/shaders/UniformsUtils.js +25 -4
- package/src/renderers/webgl/WebGLAttributes.js +4 -0
- package/src/renderers/webgl/WebGLCapabilities.js +4 -3
- package/src/renderers/webgl/WebGLExtensions.js +2 -25
- package/src/renderers/webgl/WebGLInfo.js +3 -1
- package/src/renderers/webgl/WebGLProgram.js +25 -18
- package/src/renderers/webgl/WebGLPrograms.js +9 -6
- package/src/renderers/webgl/WebGLShadowMap.js +13 -2
- package/src/renderers/webgl/WebGLState.js +17 -16
- package/src/renderers/webgl/WebGLTextures.js +38 -21
- package/src/renderers/webgl/WebGLUniformsGroups.js +5 -3
- package/src/renderers/webgl/WebGLUtils.js +3 -2
- package/src/renderers/webgl-fallback/WebGLBackend.js +245 -182
- package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +184 -30
- package/src/renderers/webgl-fallback/utils/WebGLAttributeUtils.js +4 -0
- package/src/renderers/webgl-fallback/utils/WebGLConstants.js +2 -3
- package/src/renderers/webgl-fallback/utils/WebGLState.js +9 -8
- package/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +171 -19
- package/src/renderers/webgl-fallback/utils/WebGLTimestampQueryPool.js +51 -22
- package/src/renderers/webgl-fallback/utils/WebGLUtils.js +3 -2
- package/src/renderers/webgpu/WebGPUBackend.js +205 -128
- package/src/renderers/webgpu/WebGPURenderer.Nodes.js +2 -1
- package/src/renderers/webgpu/WebGPURenderer.js +3 -2
- package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +198 -121
- package/src/renderers/webgpu/utils/WebGPUAttributeUtils.js +8 -1
- package/src/renderers/webgpu/utils/WebGPUBindingUtils.js +49 -33
- package/src/renderers/webgpu/utils/WebGPUConstants.js +14 -3
- package/src/renderers/webgpu/utils/WebGPUPipelineUtils.js +56 -37
- package/src/renderers/webgpu/utils/WebGPUTexturePassUtils.js +6 -8
- package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +266 -158
- package/src/renderers/webgpu/utils/WebGPUTimestampQueryPool.js +32 -9
- package/src/renderers/webgpu/utils/WebGPUUtils.js +24 -19
- package/src/renderers/webxr/WebXRDepthSensing.js +6 -10
- package/src/renderers/webxr/WebXRManager.js +89 -13
- package/src/textures/ExternalTexture.js +56 -0
- package/src/textures/FramebufferTexture.js +2 -2
- package/src/textures/Source.js +14 -3
- package/src/textures/Texture.js +3 -2
- package/src/textures/VideoTexture.js +29 -2
- package/src/utils.js +67 -3
- package/examples/jsm/loaders/RGBMLoader.js +0 -1148
- package/examples/jsm/tsl/display/TRAAPassNode.js +0 -452
- package/src/nodes/utils/EquirectUVNode.js +0 -65
- package/src/nodes/utils/MatcapUVNode.js +0 -49
- package/src/nodes/utils/TriplanarTexturesNode.js +0 -148
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
2
|
+
This license is copied below, and is also available with a FAQ at:
|
|
3
|
+
https://openfontlicense.org
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
-----------------------------------------------------------
|
|
7
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
8
|
+
-----------------------------------------------------------
|
|
9
|
+
|
|
10
|
+
PREAMBLE
|
|
11
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
12
|
+
development of collaborative font projects, to support the font creation
|
|
13
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
14
|
+
open framework in which fonts may be shared and improved in partnership
|
|
15
|
+
with others.
|
|
16
|
+
|
|
17
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
18
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
19
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
20
|
+
redistributed and/or sold with any software provided that any reserved
|
|
21
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
22
|
+
however, cannot be released under any other type of license. The
|
|
23
|
+
requirement for fonts to remain under this license does not apply
|
|
24
|
+
to any document created using the fonts or their derivatives.
|
|
25
|
+
|
|
26
|
+
DEFINITIONS
|
|
27
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
28
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
29
|
+
include source files, build scripts and documentation.
|
|
30
|
+
|
|
31
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
32
|
+
copyright statement(s).
|
|
33
|
+
|
|
34
|
+
"Original Version" refers to the collection of Font Software components as
|
|
35
|
+
distributed by the Copyright Holder(s).
|
|
36
|
+
|
|
37
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
38
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
39
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
40
|
+
new environment.
|
|
41
|
+
|
|
42
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
43
|
+
writer or other person who contributed to the Font Software.
|
|
44
|
+
|
|
45
|
+
PERMISSION & CONDITIONS
|
|
46
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
47
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
48
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
49
|
+
Software, subject to the following conditions:
|
|
50
|
+
|
|
51
|
+
1) Neither the Font Software nor any of its individual components,
|
|
52
|
+
in Original or Modified Versions, may be sold by itself.
|
|
53
|
+
|
|
54
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
55
|
+
redistributed and/or sold with any software, provided that each copy
|
|
56
|
+
contains the above copyright notice and this license. These can be
|
|
57
|
+
included either as stand-alone text files, human-readable headers or
|
|
58
|
+
in the appropriate machine-readable metadata fields within text or
|
|
59
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
60
|
+
|
|
61
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
62
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
63
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
64
|
+
presented to the users.
|
|
65
|
+
|
|
66
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
67
|
+
Software shall not be used to promote, endorse or advertise any
|
|
68
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
69
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
70
|
+
permission.
|
|
71
|
+
|
|
72
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
73
|
+
must be distributed entirely under this license, and must not be
|
|
74
|
+
distributed under any other license. The requirement for fonts to
|
|
75
|
+
remain under this license does not apply to any document created
|
|
76
|
+
using the Font Software.
|
|
77
|
+
|
|
78
|
+
TERMINATION
|
|
79
|
+
This license becomes null and void if any of the above conditions are
|
|
80
|
+
not met.
|
|
81
|
+
|
|
82
|
+
DISCLAIMER
|
|
83
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
84
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
85
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
86
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
87
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
88
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
89
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
90
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
91
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
package/examples/jsm/Addons.js
CHANGED
|
@@ -89,6 +89,7 @@ export * from './loaders/FBXLoader.js';
|
|
|
89
89
|
export * from './loaders/FontLoader.js';
|
|
90
90
|
export * from './loaders/GCodeLoader.js';
|
|
91
91
|
export * from './loaders/GLTFLoader.js';
|
|
92
|
+
export * from './loaders/HDRLoader.js';
|
|
92
93
|
export * from './loaders/HDRCubeTextureLoader.js';
|
|
93
94
|
export * from './loaders/IESLoader.js';
|
|
94
95
|
export * from './loaders/KMZLoader.js';
|
|
@@ -110,14 +111,13 @@ export * from './loaders/PLYLoader.js';
|
|
|
110
111
|
export * from './loaders/PVRLoader.js';
|
|
111
112
|
export * from './loaders/RGBELoader.js';
|
|
112
113
|
export * from './loaders/UltraHDRLoader.js';
|
|
113
|
-
export * from './loaders/RGBMLoader.js';
|
|
114
114
|
export * from './loaders/STLLoader.js';
|
|
115
115
|
export * from './loaders/SVGLoader.js';
|
|
116
116
|
export * from './loaders/TDSLoader.js';
|
|
117
117
|
export * from './loaders/TGALoader.js';
|
|
118
118
|
export * from './loaders/TIFFLoader.js';
|
|
119
119
|
export * from './loaders/TTFLoader.js';
|
|
120
|
-
export * from './loaders/
|
|
120
|
+
export * from './loaders/USDLoader.js';
|
|
121
121
|
export * from './loaders/VOXLoader.js';
|
|
122
122
|
export * from './loaders/VRMLLoader.js';
|
|
123
123
|
export * from './loaders/VTKLoader.js';
|
|
@@ -146,7 +146,6 @@ export * from './misc/MorphAnimMesh.js';
|
|
|
146
146
|
export * from './misc/MorphBlendMesh.js';
|
|
147
147
|
export * from './misc/ProgressiveLightMap.js';
|
|
148
148
|
export * from './misc/RollerCoaster.js';
|
|
149
|
-
export * from './misc/Timer.js';
|
|
150
149
|
export * from './misc/TubePainter.js';
|
|
151
150
|
export * from './misc/Volume.js';
|
|
152
151
|
export * from './misc/VolumeSlice.js';
|
|
@@ -26,7 +26,7 @@ const _vector = new Vector3();
|
|
|
26
26
|
const _matrix = new Matrix4();
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
|
-
* This class solves the Inverse Kinematics Problem with a [CCD Algorithm]
|
|
29
|
+
* This class solves the Inverse Kinematics Problem with a [CCD Algorithm](https://web.archive.org/web/20221206080850/https://sites.google.com/site/auraliusproject/ccd-algorithm).
|
|
30
30
|
*
|
|
31
31
|
* `CCDIKSolver` is designed to work with instances of {@link SkinnedMesh}.
|
|
32
32
|
*
|
|
@@ -108,33 +108,6 @@ class WebGL {
|
|
|
108
108
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
// @deprecated, r168
|
|
112
|
-
|
|
113
|
-
static isWebGLAvailable() {
|
|
114
|
-
|
|
115
|
-
console.warn( 'isWebGLAvailable() has been deprecated and will be removed in r178. Use isWebGL2Available() instead.' );
|
|
116
|
-
|
|
117
|
-
try {
|
|
118
|
-
|
|
119
|
-
const canvas = document.createElement( 'canvas' );
|
|
120
|
-
return !! ( window.WebGLRenderingContext && ( canvas.getContext( 'webgl' ) || canvas.getContext( 'experimental-webgl' ) ) );
|
|
121
|
-
|
|
122
|
-
} catch ( e ) {
|
|
123
|
-
|
|
124
|
-
return false;
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
static getWebGLErrorMessage() {
|
|
131
|
-
|
|
132
|
-
console.warn( 'getWebGLErrorMessage() has been deprecated and will be removed in r178. Use getWebGL2ErrorMessage() instead.' );
|
|
133
|
-
|
|
134
|
-
return this._getErrorMessage( 1 );
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
|
|
138
111
|
}
|
|
139
112
|
|
|
140
113
|
export default WebGL;
|
|
@@ -115,7 +115,7 @@ class ArcballControls extends Controls {
|
|
|
115
115
|
* Constructs a new controls instance.
|
|
116
116
|
*
|
|
117
117
|
* @param {Camera} camera - The camera to be controlled. The camera must not be a child of another object, unless that object is the scene itself.
|
|
118
|
-
* @param {?
|
|
118
|
+
* @param {?HTMLElement} [domElement=null] - The HTML element used for event listeners.
|
|
119
119
|
* @param {?Scene} [scene=null] The scene rendered by the camera. If not given, gizmos cannot be shown.
|
|
120
120
|
*/
|
|
121
121
|
constructor( camera, domElement = null, scene = null ) {
|
|
@@ -457,7 +457,7 @@ class ArcballControls extends Controls {
|
|
|
457
457
|
this._devPxRatio = window.devicePixelRatio;
|
|
458
458
|
|
|
459
459
|
this.domElement.addEventListener( 'contextmenu', this._onContextMenu );
|
|
460
|
-
this.domElement.addEventListener( 'wheel', this._onWheel );
|
|
460
|
+
this.domElement.addEventListener( 'wheel', this._onWheel, { passive: false } );
|
|
461
461
|
this.domElement.addEventListener( 'pointerdown', this._onPointerDown );
|
|
462
462
|
this.domElement.addEventListener( 'pointercancel', this._onPointerCancel );
|
|
463
463
|
|
|
@@ -1315,7 +1315,7 @@ class ArcballControls extends Controls {
|
|
|
1315
1315
|
*
|
|
1316
1316
|
* @param {'PAN'|'ROTATE'|'ZOOM'|'FOV'} operation - The operation to be performed ('PAN', 'ROTATE', 'ZOOM', 'FOV').
|
|
1317
1317
|
* @param {0|1|2|'WHEEL'} mouse - A mouse button (0, 1, 2) or 'WHEEL' for wheel notches.
|
|
1318
|
-
* @param {'CTRL'|'SHIFT'
|
|
1318
|
+
* @param {?('CTRL'|'SHIFT')} [key=null] - The keyboard modifier ('CTRL', 'SHIFT') or null if key is not needed.
|
|
1319
1319
|
* @returns {boolean} `true` if the mouse action has been successfully added, `false` otherwise.
|
|
1320
1320
|
*/
|
|
1321
1321
|
setMouseAction( operation, mouse, key = null ) {
|
|
@@ -1396,7 +1396,7 @@ class ArcballControls extends Controls {
|
|
|
1396
1396
|
* Remove a mouse action by specifying its mouse/key combination.
|
|
1397
1397
|
*
|
|
1398
1398
|
* @param {0|1|2|'WHEEL'} mouse - A mouse button (0, 1, 2) or 'WHEEL' for wheel notches.
|
|
1399
|
-
* @param {'CTRL'|'SHIFT'
|
|
1399
|
+
* @param {?('CTRL'|'SHIFT')} key - The keyboard modifier ('CTRL', 'SHIFT') or null if key is not needed.
|
|
1400
1400
|
* @returns {boolean} `true` if the operation has been successfully removed, `false` otherwise.
|
|
1401
1401
|
*/
|
|
1402
1402
|
unsetMouseAction( mouse, key = null ) {
|
|
@@ -1421,8 +1421,8 @@ class ArcballControls extends Controls {
|
|
|
1421
1421
|
*
|
|
1422
1422
|
* @private
|
|
1423
1423
|
* @param {0|1|2|'WHEEL'} mouse - Mouse button index (0, 1, 2) or 'WHEEL' for wheel notches.
|
|
1424
|
-
* @param {'CTRL'|'SHIFT'
|
|
1425
|
-
* @returns {'PAN'|'ROTATE'|'ZOOM'|'FOV'
|
|
1424
|
+
* @param {?('CTRL'|'SHIFT')} key - Keyboard modifier.
|
|
1425
|
+
* @returns {?('PAN'|'ROTATE'|'ZOOM'|'FOV')} The operation if it has been found, `null` otherwise.
|
|
1426
1426
|
*/
|
|
1427
1427
|
getOpFromAction( mouse, key ) {
|
|
1428
1428
|
|
|
@@ -1463,7 +1463,7 @@ class ArcballControls extends Controls {
|
|
|
1463
1463
|
*
|
|
1464
1464
|
* @private
|
|
1465
1465
|
* @param {0|1|2} mouse - Mouse button index (0, 1, 2)
|
|
1466
|
-
* @param {'CTRL'|'SHIFT'
|
|
1466
|
+
* @param {?('CTRL'|'SHIFT')} key - Keyboard modifier
|
|
1467
1467
|
* @returns {?STATE} The FSA state obtained from the operation associated to mouse/keyboard combination.
|
|
1468
1468
|
*/
|
|
1469
1469
|
getOpStateFromAction( mouse, key ) {
|
|
@@ -2509,8 +2509,8 @@ class ArcballControls extends Controls {
|
|
|
2509
2509
|
* Sets values in transformation object.
|
|
2510
2510
|
*
|
|
2511
2511
|
* @private
|
|
2512
|
-
* @param {Matrix4} [camera=null] - Transformation to be applied to the camera.
|
|
2513
|
-
* @param {Matrix4} [gizmos=null] - Transformation to be applied to gizmos.
|
|
2512
|
+
* @param {?Matrix4} [camera=null] - Transformation to be applied to the camera.
|
|
2513
|
+
* @param {?Matrix4} [gizmos=null] - Transformation to be applied to gizmos.
|
|
2514
2514
|
*/
|
|
2515
2515
|
setTransformationMatrices( camera = null, gizmos = null ) {
|
|
2516
2516
|
|
|
@@ -61,7 +61,7 @@ class DragControls extends Controls {
|
|
|
61
61
|
*
|
|
62
62
|
* @param {Array<Object3D>} objects - An array of draggable 3D objects.
|
|
63
63
|
* @param {Camera} camera - The camera of the rendered scene.
|
|
64
|
-
* @param {?
|
|
64
|
+
* @param {?HTMLElement} [domElement=null] - The HTML DOM element used for event listeners.
|
|
65
65
|
*/
|
|
66
66
|
constructor( objects, camera, domElement = null ) {
|
|
67
67
|
|
|
@@ -234,56 +234,6 @@ class DragControls extends Controls {
|
|
|
234
234
|
|
|
235
235
|
}
|
|
236
236
|
|
|
237
|
-
getRaycaster() {
|
|
238
|
-
|
|
239
|
-
console.warn( 'THREE.DragControls: getRaycaster() has been deprecated. Use controls.raycaster instead.' ); // @deprecated r169
|
|
240
|
-
|
|
241
|
-
return this.raycaster;
|
|
242
|
-
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
setObjects( objects ) {
|
|
246
|
-
|
|
247
|
-
console.warn( 'THREE.DragControls: setObjects() has been deprecated. Use controls.objects instead.' ); // @deprecated r169
|
|
248
|
-
|
|
249
|
-
this.objects = objects;
|
|
250
|
-
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
getObjects() {
|
|
254
|
-
|
|
255
|
-
console.warn( 'THREE.DragControls: getObjects() has been deprecated. Use controls.objects instead.' ); // @deprecated r169
|
|
256
|
-
|
|
257
|
-
return this.objects;
|
|
258
|
-
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
activate() {
|
|
262
|
-
|
|
263
|
-
console.warn( 'THREE.DragControls: activate() has been renamed to connect().' ); // @deprecated r169
|
|
264
|
-
this.connect();
|
|
265
|
-
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
deactivate() {
|
|
269
|
-
|
|
270
|
-
console.warn( 'THREE.DragControls: deactivate() has been renamed to disconnect().' ); // @deprecated r169
|
|
271
|
-
this.disconnect();
|
|
272
|
-
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
set mode( value ) {
|
|
276
|
-
|
|
277
|
-
console.warn( 'THREE.DragControls: The .mode property has been removed. Define the type of transformation via the .mouseButtons or .touches properties.' ); // @deprecated r169
|
|
278
|
-
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
get mode() {
|
|
282
|
-
|
|
283
|
-
console.warn( 'THREE.DragControls: The .mode property has been removed. Define the type of transformation via the .mouseButtons or .touches properties.' ); // @deprecated r169
|
|
284
|
-
|
|
285
|
-
}
|
|
286
|
-
|
|
287
237
|
}
|
|
288
238
|
|
|
289
239
|
function onPointerMove( event ) {
|
|
@@ -305,6 +255,7 @@ function onPointerMove( event ) {
|
|
|
305
255
|
if ( raycaster.ray.intersectPlane( _plane, _intersection ) ) {
|
|
306
256
|
|
|
307
257
|
_selected.position.copy( _intersection.sub( _offset ).applyMatrix4( _inverseMatrix ) );
|
|
258
|
+
this.dispatchEvent( { type: 'drag', object: _selected } );
|
|
308
259
|
|
|
309
260
|
}
|
|
310
261
|
|
|
@@ -313,11 +264,10 @@ function onPointerMove( event ) {
|
|
|
313
264
|
_diff.subVectors( _pointer, _previousPointer ).multiplyScalar( this.rotateSpeed );
|
|
314
265
|
_selected.rotateOnWorldAxis( _up, _diff.x );
|
|
315
266
|
_selected.rotateOnWorldAxis( _right.normalize(), - _diff.y );
|
|
267
|
+
this.dispatchEvent( { type: 'drag', object: _selected } );
|
|
316
268
|
|
|
317
269
|
}
|
|
318
270
|
|
|
319
|
-
this.dispatchEvent( { type: 'drag', object: _selected } );
|
|
320
|
-
|
|
321
271
|
_previousPointer.copy( _pointer );
|
|
322
272
|
|
|
323
273
|
} else {
|
|
@@ -414,21 +364,21 @@ function onPointerDown( event ) {
|
|
|
414
364
|
|
|
415
365
|
_inverseMatrix.copy( _selected.parent.matrixWorld ).invert();
|
|
416
366
|
_offset.copy( _intersection ).sub( _worldPosition.setFromMatrixPosition( _selected.matrixWorld ) );
|
|
367
|
+
domElement.style.cursor = 'move';
|
|
368
|
+
this.dispatchEvent( { type: 'dragstart', object: _selected } );
|
|
417
369
|
|
|
418
370
|
} else if ( this.state === STATE.ROTATE ) {
|
|
419
371
|
|
|
420
372
|
// the controls only support Y+ up
|
|
421
373
|
_up.set( 0, 1, 0 ).applyQuaternion( camera.quaternion ).normalize();
|
|
422
374
|
_right.set( 1, 0, 0 ).applyQuaternion( camera.quaternion ).normalize();
|
|
375
|
+
domElement.style.cursor = 'move';
|
|
376
|
+
this.dispatchEvent( { type: 'dragstart', object: _selected } );
|
|
423
377
|
|
|
424
378
|
}
|
|
425
379
|
|
|
426
380
|
}
|
|
427
381
|
|
|
428
|
-
domElement.style.cursor = 'move';
|
|
429
|
-
|
|
430
|
-
this.dispatchEvent( { type: 'dragstart', object: _selected } );
|
|
431
|
-
|
|
432
382
|
}
|
|
433
383
|
|
|
434
384
|
_previousPointer.copy( _pointer );
|
|
@@ -22,7 +22,7 @@ class FirstPersonControls extends Controls {
|
|
|
22
22
|
* Constructs a new controls instance.
|
|
23
23
|
*
|
|
24
24
|
* @param {Object3D} object - The object that is managed by the controls.
|
|
25
|
-
* @param {?
|
|
25
|
+
* @param {?HTMLElement} domElement - The HTML element used for event listeners.
|
|
26
26
|
*/
|
|
27
27
|
constructor( object, domElement = null ) {
|
|
28
28
|
|
|
@@ -194,8 +194,8 @@ class FirstPersonControls extends Controls {
|
|
|
194
194
|
window.removeEventListener( 'keydown', this._onKeyDown );
|
|
195
195
|
window.removeEventListener( 'keyup', this._onKeyUp );
|
|
196
196
|
|
|
197
|
-
this.domElement.removeEventListener( '
|
|
198
|
-
this.domElement.removeEventListener( '
|
|
197
|
+
this.domElement.removeEventListener( 'pointermove', this._onPointerMove );
|
|
198
|
+
this.domElement.removeEventListener( 'pointerdown', this._onPointerDown );
|
|
199
199
|
this.domElement.removeEventListener( 'pointerup', this._onPointerUp );
|
|
200
200
|
this.domElement.removeEventListener( 'contextmenu', this._onContextMenu );
|
|
201
201
|
|
|
@@ -29,7 +29,7 @@ class FlyControls extends Controls {
|
|
|
29
29
|
* Constructs a new controls instance.
|
|
30
30
|
*
|
|
31
31
|
* @param {Object3D} object - The object that is managed by the controls.
|
|
32
|
-
* @param {?
|
|
32
|
+
* @param {?HTMLElement} domElement - The HTML element used for event listeners.
|
|
33
33
|
*/
|
|
34
34
|
constructor( object, domElement = null ) {
|
|
35
35
|
|
|
@@ -91,7 +91,7 @@ class OrbitControls extends Controls {
|
|
|
91
91
|
* Constructs a new controls instance.
|
|
92
92
|
*
|
|
93
93
|
* @param {Object3D} object - The object that is managed by the controls.
|
|
94
|
-
* @param {?
|
|
94
|
+
* @param {?HTMLElement} domElement - The HTML element used for event listeners.
|
|
95
95
|
*/
|
|
96
96
|
constructor( object, domElement = null ) {
|
|
97
97
|
|
|
@@ -541,7 +541,7 @@ class OrbitControls extends Controls {
|
|
|
541
541
|
* Adds key event listeners to the given DOM element.
|
|
542
542
|
* `window` is a recommended argument for using this method.
|
|
543
543
|
*
|
|
544
|
-
* @param {
|
|
544
|
+
* @param {HTMLElement} domElement - The DOM element
|
|
545
545
|
*/
|
|
546
546
|
listenToKeyEvents( domElement ) {
|
|
547
547
|
|
|
@@ -35,7 +35,7 @@ const _MOUSE_SENSITIVITY = 0.002;
|
|
|
35
35
|
const _PI_2 = Math.PI / 2;
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
|
-
* The implementation of this class is based on the [Pointer Lock API]
|
|
38
|
+
* The implementation of this class is based on the [Pointer Lock API](https://developer.mozilla.org/en-US/docs/Web/API/Pointer_Lock_API).
|
|
39
39
|
* `PointerLockControls` is a perfect choice for first person 3D games.
|
|
40
40
|
*
|
|
41
41
|
* ```js
|
|
@@ -64,7 +64,7 @@ class PointerLockControls extends Controls {
|
|
|
64
64
|
* Constructs a new controls instance.
|
|
65
65
|
*
|
|
66
66
|
* @param {Camera} camera - The camera that is managed by the controls.
|
|
67
|
-
* @param {?
|
|
67
|
+
* @param {?HTMLElement} domElement - The HTML element used for event listeners.
|
|
68
68
|
*/
|
|
69
69
|
constructor( camera, domElement = null ) {
|
|
70
70
|
|
|
@@ -141,14 +141,6 @@ class PointerLockControls extends Controls {
|
|
|
141
141
|
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
getObject() {
|
|
145
|
-
|
|
146
|
-
console.warn( 'THREE.PointerLockControls: getObject() has been deprecated. Use controls.object instead.' ); // @deprecated r169
|
|
147
|
-
|
|
148
|
-
return this.object;
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
|
|
152
144
|
/**
|
|
153
145
|
* Returns the look direction of the camera.
|
|
154
146
|
*
|
|
@@ -59,7 +59,7 @@ class TrackballControls extends Controls {
|
|
|
59
59
|
* Constructs a new controls instance.
|
|
60
60
|
*
|
|
61
61
|
* @param {Object3D} object - The object that is managed by the controls.
|
|
62
|
-
* @param {?
|
|
62
|
+
* @param {?HTMLElement} domElement - The HTML element used for event listeners.
|
|
63
63
|
*/
|
|
64
64
|
constructor( object, domElement = null ) {
|
|
65
65
|
|
|
@@ -80,7 +80,7 @@ class TransformControls extends Controls {
|
|
|
80
80
|
* Constructs a new controls instance.
|
|
81
81
|
*
|
|
82
82
|
* @param {Camera} camera - The camera of the rendered scene.
|
|
83
|
-
* @param {?
|
|
83
|
+
* @param {?HTMLElement} domElement - The HTML element used for event listeners.
|
|
84
84
|
*/
|
|
85
85
|
constructor( camera, domElement = null ) {
|
|
86
86
|
|
|
@@ -888,6 +888,40 @@ class TransformControls extends Controls {
|
|
|
888
888
|
|
|
889
889
|
}
|
|
890
890
|
|
|
891
|
+
/**
|
|
892
|
+
* Sets the colors of the control's gizmo.
|
|
893
|
+
*
|
|
894
|
+
* @param {number|Color|string} xAxis - The x-axis color.
|
|
895
|
+
* @param {number|Color|string} yAxis - The y-axis color.
|
|
896
|
+
* @param {number|Color|string} zAxis - The z-axis color.
|
|
897
|
+
* @param {number|Color|string} active - The color for active elements.
|
|
898
|
+
*/
|
|
899
|
+
setColors( xAxis, yAxis, zAxis, active ) {
|
|
900
|
+
|
|
901
|
+
const materialLib = this._gizmo.materialLib;
|
|
902
|
+
|
|
903
|
+
materialLib.xAxis.color.set( xAxis );
|
|
904
|
+
materialLib.yAxis.color.set( yAxis );
|
|
905
|
+
materialLib.zAxis.color.set( zAxis );
|
|
906
|
+
materialLib.active.color.set( active );
|
|
907
|
+
materialLib.xAxisTransparent.color.set( xAxis );
|
|
908
|
+
materialLib.yAxisTransparent.color.set( yAxis );
|
|
909
|
+
materialLib.zAxisTransparent.color.set( zAxis );
|
|
910
|
+
materialLib.activeTransparent.color.set( active );
|
|
911
|
+
|
|
912
|
+
// update color caches
|
|
913
|
+
|
|
914
|
+
if ( materialLib.xAxis._color ) materialLib.xAxis._color.set( xAxis );
|
|
915
|
+
if ( materialLib.yAxis._color ) materialLib.yAxis._color.set( yAxis );
|
|
916
|
+
if ( materialLib.zAxis._color ) materialLib.zAxis._color.set( zAxis );
|
|
917
|
+
if ( materialLib.active._color ) materialLib.active._color.set( active );
|
|
918
|
+
if ( materialLib.xAxisTransparent._color ) materialLib.xAxisTransparent._color.set( xAxis );
|
|
919
|
+
if ( materialLib.yAxisTransparent._color ) materialLib.yAxisTransparent._color.set( yAxis );
|
|
920
|
+
if ( materialLib.zAxisTransparent._color ) materialLib.zAxisTransparent._color.set( zAxis );
|
|
921
|
+
if ( materialLib.activeTransparent._color ) materialLib.activeTransparent._color.set( active );
|
|
922
|
+
|
|
923
|
+
}
|
|
924
|
+
|
|
891
925
|
}
|
|
892
926
|
|
|
893
927
|
// mouse / touch event handlers
|
|
@@ -1146,6 +1180,19 @@ class TransformControlsGizmo extends Object3D {
|
|
|
1146
1180
|
const matGray = gizmoMaterial.clone();
|
|
1147
1181
|
matGray.color.setHex( 0x787878 );
|
|
1148
1182
|
|
|
1183
|
+
// materials in the below property are configurable via setColors()
|
|
1184
|
+
|
|
1185
|
+
this.materialLib = {
|
|
1186
|
+
xAxis: matRed,
|
|
1187
|
+
yAxis: matGreen,
|
|
1188
|
+
zAxis: matBlue,
|
|
1189
|
+
active: matYellow,
|
|
1190
|
+
xAxisTransparent: matRedTransparent,
|
|
1191
|
+
yAxisTransparent: matGreenTransparent,
|
|
1192
|
+
zAxisTransparent: matBlueTransparent,
|
|
1193
|
+
activeTransparent: matYellowTransparent
|
|
1194
|
+
};
|
|
1195
|
+
|
|
1149
1196
|
// reusable geometry
|
|
1150
1197
|
|
|
1151
1198
|
const arrowGeometry = new CylinderGeometry( 0, 0.04, 0.1, 12 );
|
|
@@ -1200,16 +1247,16 @@ class TransformControlsGizmo extends Object3D {
|
|
|
1200
1247
|
[ new Mesh( lineGeometry2, matBlue ), null, [ Math.PI / 2, 0, 0 ]]
|
|
1201
1248
|
],
|
|
1202
1249
|
XYZ: [
|
|
1203
|
-
[ new Mesh( new OctahedronGeometry( 0.1, 0 ), matWhiteTransparent
|
|
1250
|
+
[ new Mesh( new OctahedronGeometry( 0.1, 0 ), matWhiteTransparent ), [ 0, 0, 0 ]]
|
|
1204
1251
|
],
|
|
1205
1252
|
XY: [
|
|
1206
|
-
[ new Mesh( new BoxGeometry( 0.15, 0.15, 0.01 ), matBlueTransparent
|
|
1253
|
+
[ new Mesh( new BoxGeometry( 0.15, 0.15, 0.01 ), matBlueTransparent ), [ 0.15, 0.15, 0 ]]
|
|
1207
1254
|
],
|
|
1208
1255
|
YZ: [
|
|
1209
|
-
[ new Mesh( new BoxGeometry( 0.15, 0.15, 0.01 ), matRedTransparent
|
|
1256
|
+
[ new Mesh( new BoxGeometry( 0.15, 0.15, 0.01 ), matRedTransparent ), [ 0, 0.15, 0.15 ], [ 0, Math.PI / 2, 0 ]]
|
|
1210
1257
|
],
|
|
1211
1258
|
XZ: [
|
|
1212
|
-
[ new Mesh( new BoxGeometry( 0.15, 0.15, 0.01 ), matGreenTransparent
|
|
1259
|
+
[ new Mesh( new BoxGeometry( 0.15, 0.15, 0.01 ), matGreenTransparent ), [ 0.15, 0, 0.15 ], [ - Math.PI / 2, 0, 0 ]]
|
|
1213
1260
|
]
|
|
1214
1261
|
};
|
|
1215
1262
|
|
|
@@ -1251,13 +1298,13 @@ class TransformControlsGizmo extends Object3D {
|
|
|
1251
1298
|
[ new Line( TranslateHelperGeometry(), matHelper ), null, null, null, 'helper' ]
|
|
1252
1299
|
],
|
|
1253
1300
|
X: [
|
|
1254
|
-
[ new Line( lineGeometry, matHelper
|
|
1301
|
+
[ new Line( lineGeometry, matHelper ), [ - 1e3, 0, 0 ], null, [ 1e6, 1, 1 ], 'helper' ]
|
|
1255
1302
|
],
|
|
1256
1303
|
Y: [
|
|
1257
|
-
[ new Line( lineGeometry, matHelper
|
|
1304
|
+
[ new Line( lineGeometry, matHelper ), [ 0, - 1e3, 0 ], [ 0, 0, Math.PI / 2 ], [ 1e6, 1, 1 ], 'helper' ]
|
|
1258
1305
|
],
|
|
1259
1306
|
Z: [
|
|
1260
|
-
[ new Line( lineGeometry, matHelper
|
|
1307
|
+
[ new Line( lineGeometry, matHelper ), [ 0, 0, - 1e3 ], [ 0, - Math.PI / 2, 0 ], [ 1e6, 1, 1 ], 'helper' ]
|
|
1261
1308
|
]
|
|
1262
1309
|
};
|
|
1263
1310
|
|
|
@@ -1281,7 +1328,7 @@ class TransformControlsGizmo extends Object3D {
|
|
|
1281
1328
|
|
|
1282
1329
|
const helperRotate = {
|
|
1283
1330
|
AXIS: [
|
|
1284
|
-
[ new Line( lineGeometry, matHelper
|
|
1331
|
+
[ new Line( lineGeometry, matHelper ), [ - 1e3, 0, 0 ], null, [ 1e6, 1, 1 ], 'helper' ]
|
|
1285
1332
|
]
|
|
1286
1333
|
};
|
|
1287
1334
|
|
|
@@ -1329,7 +1376,7 @@ class TransformControlsGizmo extends Object3D {
|
|
|
1329
1376
|
[ new Mesh( new BoxGeometry( 0.15, 0.15, 0.01 ), matGreenTransparent ), [ 0.15, 0, 0.15 ], [ - Math.PI / 2, 0, 0 ]]
|
|
1330
1377
|
],
|
|
1331
1378
|
XYZ: [
|
|
1332
|
-
[ new Mesh( new BoxGeometry( 0.1, 0.1, 0.1 ), matWhiteTransparent
|
|
1379
|
+
[ new Mesh( new BoxGeometry( 0.1, 0.1, 0.1 ), matWhiteTransparent ) ],
|
|
1333
1380
|
]
|
|
1334
1381
|
};
|
|
1335
1382
|
|
|
@@ -1362,13 +1409,13 @@ class TransformControlsGizmo extends Object3D {
|
|
|
1362
1409
|
|
|
1363
1410
|
const helperScale = {
|
|
1364
1411
|
X: [
|
|
1365
|
-
[ new Line( lineGeometry, matHelper
|
|
1412
|
+
[ new Line( lineGeometry, matHelper ), [ - 1e3, 0, 0 ], null, [ 1e6, 1, 1 ], 'helper' ]
|
|
1366
1413
|
],
|
|
1367
1414
|
Y: [
|
|
1368
|
-
[ new Line( lineGeometry, matHelper
|
|
1415
|
+
[ new Line( lineGeometry, matHelper ), [ 0, - 1e3, 0 ], [ 0, 0, Math.PI / 2 ], [ 1e6, 1, 1 ], 'helper' ]
|
|
1369
1416
|
],
|
|
1370
1417
|
Z: [
|
|
1371
|
-
[ new Line( lineGeometry, matHelper
|
|
1418
|
+
[ new Line( lineGeometry, matHelper ), [ 0, 0, - 1e3 ], [ 0, - Math.PI / 2, 0 ], [ 1e6, 1, 1 ], 'helper' ]
|
|
1372
1419
|
]
|
|
1373
1420
|
};
|
|
1374
1421
|
|
|
@@ -1749,7 +1796,7 @@ class TransformControlsGizmo extends Object3D {
|
|
|
1749
1796
|
|
|
1750
1797
|
if ( handle.name === this.axis ) {
|
|
1751
1798
|
|
|
1752
|
-
handle.material.color.
|
|
1799
|
+
handle.material.color.copy( this.materialLib.active.color );
|
|
1753
1800
|
handle.material.opacity = 1.0;
|
|
1754
1801
|
|
|
1755
1802
|
} else if ( this.axis.split( '' ).some( function ( a ) {
|
|
@@ -1758,7 +1805,7 @@ class TransformControlsGizmo extends Object3D {
|
|
|
1758
1805
|
|
|
1759
1806
|
} ) ) {
|
|
1760
1807
|
|
|
1761
|
-
handle.material.color.
|
|
1808
|
+
handle.material.color.copy( this.materialLib.active.color );
|
|
1762
1809
|
handle.material.opacity = 1.0;
|
|
1763
1810
|
|
|
1764
1811
|
}
|
|
@@ -374,9 +374,9 @@ class CSMShadowNode extends ShadowBaseNode {
|
|
|
374
374
|
_setupFade() {
|
|
375
375
|
|
|
376
376
|
const cameraNear = reference( 'camera.near', 'float', this ).setGroup( renderGroup );
|
|
377
|
-
const cascades = reference( '_cascades', 'vec2', this ).setGroup( renderGroup ).
|
|
377
|
+
const cascades = reference( '_cascades', 'vec2', this ).setGroup( renderGroup ).setName( 'cascades' );
|
|
378
378
|
|
|
379
|
-
const shadowFar = uniform( 'float' ).setGroup( renderGroup ).
|
|
379
|
+
const shadowFar = uniform( 'float' ).setGroup( renderGroup ).setName( 'shadowFar' )
|
|
380
380
|
.onRenderUpdate( () => Math.min( this.maxFar, this.camera.far ) );
|
|
381
381
|
|
|
382
382
|
const linearDepth = viewZToOrthographicDepth( positionView.z, cameraNear, shadowFar ).toVar( 'linearDepth' );
|
|
@@ -456,9 +456,9 @@ class CSMShadowNode extends ShadowBaseNode {
|
|
|
456
456
|
_setupStandard() {
|
|
457
457
|
|
|
458
458
|
const cameraNear = reference( 'camera.near', 'float', this ).setGroup( renderGroup );
|
|
459
|
-
const cascades = reference( '_cascades', 'vec2', this ).setGroup( renderGroup ).
|
|
459
|
+
const cascades = reference( '_cascades', 'vec2', this ).setGroup( renderGroup ).setName( 'cascades' );
|
|
460
460
|
|
|
461
|
-
const shadowFar = uniform( 'float' ).setGroup( renderGroup ).
|
|
461
|
+
const shadowFar = uniform( 'float' ).setGroup( renderGroup ).setName( 'shadowFar' )
|
|
462
462
|
.onRenderUpdate( () => Math.min( this.maxFar, this.camera.far ) );
|
|
463
463
|
|
|
464
464
|
const linearDepth = viewZToOrthographicDepth( positionView.z, cameraNear, shadowFar ).toVar( 'linearDepth' );
|