super-three 0.165.0 → 0.168.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 +854 -410
- package/build/three.module.js +849 -411
- package/build/three.module.min.js +1 -1
- package/build/three.webgpu.js +77755 -0
- package/build/three.webgpu.min.js +6 -0
- package/examples/jsm/Addons.js +5 -2
- 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 +453 -452
- package/examples/jsm/csm/CSMShader.js +4 -4
- 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/GLTFExporter.js +13 -4
- package/examples/jsm/exporters/USDZExporter.js +29 -8
- package/examples/jsm/geometries/TeapotGeometry.js +1 -1
- package/examples/jsm/helpers/LightProbeHelper.js +42 -43
- package/examples/jsm/helpers/ViewHelper.js +51 -2
- package/examples/jsm/libs/tween.module.js +64 -75
- package/examples/jsm/lights/RectAreaLightTexturesLib.js +91 -0
- package/examples/jsm/lights/RectAreaLightUniformsLib.js +8 -63
- package/examples/jsm/lines/webgpu/Line2.js +20 -0
- package/examples/jsm/lines/webgpu/LineSegments2.js +376 -0
- package/examples/jsm/loaders/FBXLoader.js +23 -45
- package/examples/jsm/loaders/GLTFLoader.js +10 -4
- package/examples/jsm/loaders/KTX2Loader.js +19 -7
- package/examples/jsm/loaders/MaterialXLoader.js +10 -10
- package/examples/jsm/loaders/PCDLoader.js +9 -9
- package/examples/jsm/loaders/USDZLoader.js +124 -76
- package/examples/jsm/loaders/UltraHDRLoader.js +583 -0
- package/examples/jsm/loaders/VTKLoader.js +76 -3
- package/examples/jsm/misc/GPUComputationRenderer.js +9 -19
- package/examples/jsm/modifiers/SimplifyModifier.js +2 -1
- package/examples/jsm/objects/InstancedPoints.js +2 -2
- package/examples/jsm/objects/SkyMesh.js +188 -0
- package/examples/jsm/objects/Water2Mesh.js +159 -0
- package/examples/jsm/objects/WaterMesh.js +102 -0
- package/examples/jsm/physics/RapierPhysics.js +20 -0
- package/examples/jsm/postprocessing/OutlinePass.js +31 -46
- package/examples/jsm/postprocessing/RenderTransitionPass.js +13 -38
- package/examples/jsm/postprocessing/SSAARenderPass.js +3 -1
- package/examples/jsm/postprocessing/SSAOPass.js +6 -9
- package/examples/jsm/postprocessing/UnrealBloomPass.js +4 -4
- package/examples/jsm/shaders/BleachBypassShader.js +1 -2
- package/examples/jsm/shaders/ColorifyShader.js +1 -2
- package/examples/jsm/shaders/FXAAShader.js +0 -2
- package/examples/jsm/shaders/GTAOShader.js +1 -1
- package/examples/jsm/shaders/LuminosityHighPassShader.js +1 -3
- package/examples/jsm/shaders/OutputShader.js +1 -1
- package/examples/jsm/transpiler/GLSLDecoder.js +46 -4
- package/examples/jsm/transpiler/TSLEncoder.js +24 -22
- package/examples/jsm/utils/TextureUtils.js +1 -1
- package/package.json +8 -6
- package/src/Three.WebGPU.js +200 -0
- package/src/Three.js +3 -0
- package/src/constants.js +4 -1
- package/src/core/Object3D.js +22 -22
- package/src/extras/Controls.js +32 -0
- package/src/extras/TextureUtils.js +210 -0
- package/src/lights/Light.js +1 -0
- package/src/lights/LightShadow.js +5 -0
- package/{examples/jsm/lights → src/lights/webgpu}/IESSpotLight.js +1 -1
- package/src/loaders/ObjectLoader.js +33 -2
- package/{examples/jsm/nodes/loaders → src/loaders/nodes}/NodeLoader.js +6 -4
- package/{examples/jsm/nodes/loaders → src/loaders/nodes}/NodeMaterialLoader.js +2 -2
- package/{examples/jsm/nodes/loaders → src/loaders/nodes}/NodeObjectLoader.js +2 -1
- package/src/materials/Material.js +7 -1
- package/{examples/jsm/nodes/materials → src/materials/nodes}/InstancedPointsNodeMaterial.js +36 -27
- package/{examples/jsm/nodes/materials → src/materials/nodes}/Line2NodeMaterial.js +37 -40
- package/src/materials/nodes/LineBasicNodeMaterial.js +27 -0
- package/{examples/jsm/nodes/materials → src/materials/nodes}/LineDashedNodeMaterial.js +10 -11
- package/src/materials/nodes/MeshBasicNodeMaterial.js +73 -0
- package/src/materials/nodes/MeshLambertNodeMaterial.js +43 -0
- package/src/materials/nodes/MeshMatcapNodeMaterial.js +53 -0
- package/src/materials/nodes/MeshNormalNodeMaterial.js +40 -0
- package/src/materials/nodes/MeshPhongNodeMaterial.js +74 -0
- package/{examples/jsm/nodes/materials → src/materials/nodes}/MeshPhysicalNodeMaterial.js +22 -20
- package/{examples/jsm/nodes/materials → src/materials/nodes}/MeshSSSNodeMaterial.js +6 -6
- package/{examples/jsm/nodes/materials → src/materials/nodes}/MeshStandardNodeMaterial.js +28 -11
- package/src/materials/nodes/MeshToonNodeMaterial.js +34 -0
- package/{examples/jsm/nodes/materials → src/materials/nodes}/NodeMaterial.js +142 -96
- package/{examples/jsm/nodes/materials/Materials.js → src/materials/nodes/NodeMaterials.js} +1 -1
- package/{examples/jsm/nodes/materials → src/materials/nodes}/PointsNodeMaterial.js +5 -6
- package/src/materials/nodes/ShadowNodeMaterial.js +34 -0
- package/{examples/jsm/nodes/materials → src/materials/nodes}/SpriteNodeMaterial.js +13 -13
- package/{examples/jsm/nodes/materials → src/materials/nodes}/VolumeNodeMaterial.js +14 -16
- package/src/math/Box2.js +4 -4
- package/src/math/Box3.js +6 -6
- package/src/math/ColorManagement.js +10 -0
- package/src/math/Matrix2.js +54 -0
- package/src/math/Vector4.js +13 -0
- package/src/nodes/Nodes.js +164 -0
- package/src/nodes/TSL.js +176 -0
- package/{examples/jsm → src}/nodes/accessors/AccessorsUtils.js +8 -8
- package/src/nodes/accessors/BatchNode.js +124 -0
- package/{examples/jsm/nodes/accessors/BitangentNode.js → src/nodes/accessors/Bitangent.js} +9 -9
- package/{examples/jsm → src}/nodes/accessors/BufferAttributeNode.js +41 -6
- package/{examples/jsm → src}/nodes/accessors/BufferNode.js +4 -4
- package/src/nodes/accessors/Camera.js +19 -0
- package/{examples/jsm → src}/nodes/accessors/ClippingNode.js +16 -14
- package/src/nodes/accessors/CubeTextureNode.js +76 -0
- package/src/nodes/accessors/InstanceNode.js +144 -0
- package/src/nodes/accessors/InstancedPointsMaterialNode.js +21 -0
- package/{examples/jsm → src}/nodes/accessors/MaterialNode.js +66 -49
- package/src/nodes/accessors/MaterialProperties.js +3 -0
- package/{examples/jsm → src}/nodes/accessors/MaterialReferenceNode.js +6 -4
- package/src/nodes/accessors/ModelNode.js +37 -0
- package/{examples/jsm → src}/nodes/accessors/ModelViewProjectionNode.js +6 -7
- package/{examples/jsm → src}/nodes/accessors/MorphNode.js +35 -31
- package/src/nodes/accessors/Normal.js +62 -0
- package/{examples/jsm → src}/nodes/accessors/Object3DNode.js +11 -11
- package/src/nodes/accessors/PointUVNode.js +26 -0
- package/src/nodes/accessors/Position.js +10 -0
- package/src/nodes/accessors/ReferenceBaseNode.js +143 -0
- package/{examples/jsm → src}/nodes/accessors/ReferenceNode.js +14 -8
- package/src/nodes/accessors/ReflectVector.js +10 -0
- package/{examples/jsm → src}/nodes/accessors/RendererReferenceNode.js +6 -6
- package/{examples/jsm → src}/nodes/accessors/SceneNode.js +5 -6
- package/src/nodes/accessors/SkinningNode.js +187 -0
- package/{examples/jsm → src}/nodes/accessors/StorageBufferNode.js +54 -6
- package/{examples/jsm → src}/nodes/accessors/StorageTextureNode.js +16 -7
- package/src/nodes/accessors/Tangent.js +22 -0
- package/{examples/jsm → src}/nodes/accessors/Texture3DNode.js +11 -11
- package/{examples/jsm/nodes/accessors/TextureBicubicNode.js → src/nodes/accessors/TextureBicubic.js} +3 -32
- package/{examples/jsm → src}/nodes/accessors/TextureNode.js +69 -37
- package/{examples/jsm → src}/nodes/accessors/TextureSizeNode.js +4 -6
- package/{examples/jsm/nodes/accessors/UniformsNode.js → src/nodes/accessors/UniformArrayNode.js} +24 -9
- package/{examples/jsm → src}/nodes/accessors/UserDataNode.js +4 -4
- package/src/nodes/accessors/VelocityNode.js +83 -0
- package/{examples/jsm → src}/nodes/accessors/VertexColorNode.js +6 -5
- package/{examples/jsm → src}/nodes/code/CodeNode.js +5 -5
- package/{examples/jsm → src}/nodes/code/ExpressionNode.js +4 -4
- package/{examples/jsm → src}/nodes/code/FunctionCallNode.js +5 -5
- package/{examples/jsm → src}/nodes/code/FunctionNode.js +5 -23
- package/{examples/jsm → src}/nodes/code/ScriptableNode.js +18 -6
- package/{examples/jsm → src}/nodes/code/ScriptableValueNode.js +6 -7
- package/{examples/jsm → src}/nodes/core/AssignNode.js +5 -5
- package/{examples/jsm → src}/nodes/core/AttributeNode.js +22 -21
- package/{examples/jsm → src}/nodes/core/BypassNode.js +5 -5
- package/src/nodes/core/CacheNode.js +46 -0
- package/{examples/jsm → src}/nodes/core/ConstNode.js +2 -2
- package/{examples/jsm → src}/nodes/core/ContextNode.js +17 -11
- package/{examples/jsm → src}/nodes/core/IndexNode.js +17 -6
- package/{examples/jsm → src}/nodes/core/InputNode.js +2 -2
- package/{examples/jsm → src}/nodes/core/LightingModel.js +2 -2
- package/src/nodes/core/MRTNode.js +82 -0
- package/{examples/jsm → src}/nodes/core/Node.js +57 -31
- package/{examples/jsm → src}/nodes/core/NodeBuilder.js +216 -65
- package/src/nodes/core/NodeCache.js +36 -0
- package/{examples/jsm → src}/nodes/core/NodeFrame.js +42 -0
- package/{examples/jsm → src}/nodes/core/NodeFunction.js +2 -2
- package/{examples/jsm → src}/nodes/core/NodeUniform.js +1 -2
- package/{examples/jsm → src}/nodes/core/NodeUtils.js +7 -1
- package/{examples/jsm → src}/nodes/core/OutputStructNode.js +4 -4
- package/{examples/jsm → src}/nodes/core/ParameterNode.js +4 -4
- package/src/nodes/core/PropertyNode.js +84 -0
- package/{examples/jsm → src}/nodes/core/StackNode.js +26 -10
- package/{examples/jsm → src}/nodes/core/StructTypeNode.js +2 -2
- package/{examples/jsm → src}/nodes/core/TempNode.js +4 -4
- package/src/nodes/core/UniformGroupNode.js +55 -0
- package/{examples/jsm → src}/nodes/core/UniformNode.js +14 -5
- package/{examples/jsm → src}/nodes/core/VarNode.js +8 -12
- package/{examples/jsm → src}/nodes/core/VaryingNode.js +13 -5
- package/{examples/jsm → src}/nodes/display/AfterImageNode.js +27 -35
- package/src/nodes/display/AnaglyphPassNode.js +61 -0
- package/{examples/jsm → src}/nodes/display/AnamorphicNode.js +27 -30
- package/src/nodes/display/BleachBypass.js +26 -0
- package/src/nodes/display/BlendMode.js +54 -0
- package/src/nodes/display/BloomNode.js +335 -0
- package/{examples/jsm → src}/nodes/display/BumpMapNode.js +7 -12
- package/src/nodes/display/ColorAdjustment.js +46 -0
- package/src/nodes/display/ColorSpaceFunctions.js +38 -0
- package/src/nodes/display/ColorSpaceNode.js +85 -0
- package/src/nodes/display/DenoiseNode.js +201 -0
- package/src/nodes/display/DepthOfFieldNode.js +121 -0
- package/src/nodes/display/DotScreenNode.js +63 -0
- package/src/nodes/display/FXAANode.js +329 -0
- package/src/nodes/display/FilmNode.js +53 -0
- package/src/nodes/display/FrontFacingNode.js +41 -0
- package/src/nodes/display/GTAONode.js +328 -0
- package/{examples/jsm → src}/nodes/display/GaussianBlurNode.js +44 -24
- package/src/nodes/display/Lut3DNode.js +54 -0
- package/src/nodes/display/MotionBlur.js +25 -0
- package/{examples/jsm → src}/nodes/display/NormalMapNode.js +9 -11
- package/src/nodes/display/ParallaxBarrierPassNode.js +55 -0
- package/src/nodes/display/PassNode.js +367 -0
- package/src/nodes/display/PixelationPassNode.js +206 -0
- package/{examples/jsm → src}/nodes/display/PosterizeNode.js +4 -6
- package/src/nodes/display/RGBShiftNode.js +50 -0
- package/src/nodes/display/RenderOutputNode.js +56 -0
- package/src/nodes/display/SSAAPassNode.js +284 -0
- package/src/nodes/display/Sepia.js +17 -0
- package/src/nodes/display/SobelOperatorNode.js +123 -0
- package/src/nodes/display/StereoCompositePassNode.js +107 -0
- package/src/nodes/display/StereoPassNode.js +80 -0
- package/src/nodes/display/ToneMappingFunctions.js +190 -0
- package/src/nodes/display/ToneMappingNode.js +66 -0
- package/src/nodes/display/TransitionNode.js +77 -0
- package/src/nodes/display/ViewportDepthNode.js +121 -0
- package/src/nodes/display/ViewportDepthTextureNode.js +30 -0
- package/{examples/jsm → src}/nodes/display/ViewportNode.js +28 -26
- package/src/nodes/display/ViewportSharedTextureNode.js +36 -0
- package/{examples/jsm → src}/nodes/display/ViewportTextureNode.js +12 -12
- package/{examples/jsm → src}/nodes/fog/FogExp2Node.js +4 -6
- package/{examples/jsm → src}/nodes/fog/FogNode.js +5 -7
- package/{examples/jsm → src}/nodes/fog/FogRangeNode.js +4 -6
- package/{examples/jsm → src}/nodes/functions/BSDF/BRDF_GGX.js +4 -4
- package/{examples/jsm → src}/nodes/functions/BSDF/BRDF_Lambert.js +2 -2
- package/{examples/jsm → src}/nodes/functions/BSDF/BRDF_Sheen.js +6 -6
- package/{examples/jsm → src}/nodes/functions/BSDF/DFGApprox.js +2 -2
- package/{examples/jsm → src}/nodes/functions/BSDF/D_GGX.js +2 -2
- package/{examples/jsm → src}/nodes/functions/BSDF/D_GGX_Anisotropic.js +3 -3
- package/{examples/jsm → src}/nodes/functions/BSDF/EnvironmentBRDF.js +2 -2
- package/{examples/jsm → src}/nodes/functions/BSDF/F_Schlick.js +2 -2
- package/src/nodes/functions/BSDF/LTC.js +131 -0
- package/{examples/jsm → src}/nodes/functions/BSDF/Schlick_to_F0.js +2 -2
- package/{examples/jsm → src}/nodes/functions/BSDF/V_GGX_SmithCorrelated.js +2 -2
- package/{examples/jsm → src}/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.js +2 -2
- package/src/nodes/functions/BasicLightingModel.js +78 -0
- package/{examples/jsm → src}/nodes/functions/PhongLightingModel.js +10 -8
- package/{examples/jsm → src}/nodes/functions/PhysicalLightingModel.js +73 -31
- package/{examples/jsm → src}/nodes/functions/ShadowMaskModel.js +1 -1
- package/{examples/jsm → src}/nodes/functions/ToonLightingModel.js +6 -4
- package/src/nodes/functions/material/getGeometryRoughness.js +13 -0
- package/{examples/jsm → src}/nodes/functions/material/getRoughness.js +2 -2
- package/{examples/jsm → src}/nodes/geometry/RangeNode.js +23 -10
- package/{examples/jsm → src}/nodes/gpgpu/ComputeNode.js +5 -5
- package/src/nodes/lighting/AONode.js +24 -0
- package/{examples/jsm → src}/nodes/lighting/AmbientLightNode.js +2 -7
- package/src/nodes/lighting/AnalyticLightNode.js +354 -0
- package/src/nodes/lighting/BasicEnvironmentNode.js +27 -0
- package/src/nodes/lighting/BasicLightMapNode.js +29 -0
- package/{examples/jsm → src}/nodes/lighting/DirectionalLightNode.js +3 -9
- package/{examples/jsm → src}/nodes/lighting/EnvironmentNode.js +23 -21
- package/{examples/jsm → src}/nodes/lighting/HemisphereLightNode.js +4 -7
- package/{examples/jsm → src}/nodes/lighting/IESSpotLightNode.js +3 -8
- package/{examples/jsm → src}/nodes/lighting/IrradianceNode.js +2 -2
- package/{examples/jsm → src}/nodes/lighting/LightNode.js +5 -5
- package/src/nodes/lighting/LightProbeNode.js +76 -0
- package/{examples/jsm → src}/nodes/lighting/LightUtils.js +3 -3
- package/src/nodes/lighting/LightingContextNode.js +64 -0
- package/{examples/jsm → src}/nodes/lighting/LightingNode.js +4 -2
- package/src/nodes/lighting/LightsNode.js +231 -0
- package/{examples/jsm → src}/nodes/lighting/PointLightNode.js +4 -10
- package/src/nodes/lighting/RectAreaLightNode.js +93 -0
- package/{examples/jsm → src}/nodes/lighting/SpotLightNode.js +4 -10
- package/{examples/jsm → src}/nodes/materialx/MaterialXNodes.js +2 -2
- package/{examples/jsm → src}/nodes/materialx/lib/mx_hsv.js +43 -46
- package/{examples/jsm → src}/nodes/materialx/lib/mx_noise.js +500 -603
- package/{examples/jsm → src}/nodes/materialx/lib/mx_transform_color.js +3 -9
- package/{examples/jsm/nodes/math/CondNode.js → src/nodes/math/ConditionalNode.js} +31 -13
- package/src/nodes/math/Hash.js +13 -0
- package/src/nodes/math/MathNode.js +404 -0
- package/{examples/jsm → src}/nodes/math/MathUtils.js +0 -7
- package/{examples/jsm → src}/nodes/math/OperatorNode.js +100 -58
- package/{examples/jsm → src}/nodes/math/TriNoise3D.js +19 -29
- package/{examples/jsm → src}/nodes/parsers/GLSLNodeFunction.js +7 -7
- package/{examples/jsm → src}/nodes/pmrem/PMREMNode.js +60 -16
- package/{examples/jsm → src}/nodes/pmrem/PMREMUtils.js +46 -46
- package/src/nodes/procedural/Checker.js +14 -0
- package/src/nodes/tsl/TSLBase.js +30 -0
- package/{examples/jsm/nodes/shadernode/ShaderNode.js → src/nodes/tsl/TSLCore.js} +106 -96
- package/{examples/jsm → src}/nodes/utils/ArrayElementNode.js +2 -2
- package/{examples/jsm → src}/nodes/utils/ConvertNode.js +2 -2
- package/src/nodes/utils/CubeMapNode.js +157 -0
- package/src/nodes/utils/Discard.js +8 -0
- package/{examples/jsm → src}/nodes/utils/EquirectUVNode.js +5 -5
- package/src/nodes/utils/FlipNode.js +65 -0
- package/{examples/jsm → src}/nodes/utils/FunctionOverloadingNode.js +7 -5
- package/{examples/jsm → src}/nodes/utils/JoinNode.js +2 -2
- package/{examples/jsm → src}/nodes/utils/LoopNode.js +19 -12
- package/{examples/jsm → src}/nodes/utils/MatcapUVNode.js +6 -6
- package/{examples/jsm → src}/nodes/utils/MaxMipLevelNode.js +12 -6
- package/{examples/jsm → src}/nodes/utils/OscNode.js +7 -7
- package/src/nodes/utils/Packing.js +4 -0
- package/src/nodes/utils/RTTNode.js +130 -0
- package/{examples/jsm → src}/nodes/utils/ReflectorNode.js +17 -4
- package/{examples/jsm → src}/nodes/utils/RemapNode.js +7 -7
- package/{examples/jsm → src}/nodes/utils/RotateNode.js +4 -12
- package/{examples/jsm → src}/nodes/utils/SetNode.js +2 -2
- package/{examples/jsm → src}/nodes/utils/SplitNode.js +2 -2
- package/{examples/jsm → src}/nodes/utils/SpriteSheetUVNode.js +5 -5
- package/src/nodes/utils/SpriteUtils.js +47 -0
- package/{examples/jsm → src}/nodes/utils/StorageArrayElementNode.js +4 -6
- package/{examples/jsm → src}/nodes/utils/TimerNode.js +5 -5
- package/{examples/jsm → src}/nodes/utils/TriplanarTexturesNode.js +7 -9
- package/src/nodes/utils/UVUtils.js +19 -0
- package/src/nodes/utils/ViewportUtils.js +14 -0
- package/src/objects/BatchedMesh.js +169 -190
- package/src/objects/InstancedMesh.js +1 -1
- package/src/renderers/WebGLRenderer.js +60 -23
- package/{examples/jsm → src}/renderers/common/Attributes.js +2 -1
- package/{examples/jsm → src}/renderers/common/Backend.js +30 -27
- package/{examples/jsm → src}/renderers/common/Background.js +12 -4
- package/src/renderers/common/BindGroup.js +18 -0
- package/{examples/jsm → src}/renderers/common/Bindings.js +45 -32
- package/{examples/jsm → src}/renderers/common/ClippingContext.js +18 -7
- package/{examples/jsm → src}/renderers/common/Color4.js +1 -1
- package/{examples/jsm → src}/renderers/common/CubeRenderTarget.js +16 -4
- package/{examples/jsm → src}/renderers/common/Geometries.js +37 -5
- package/{examples/jsm → src}/renderers/common/Info.js +34 -6
- package/src/renderers/common/PostProcessing.js +90 -0
- package/{examples/jsm/objects → src/renderers/common}/QuadMesh.js +8 -3
- package/{examples/jsm → src}/renderers/common/RenderContext.js +25 -1
- package/{examples/jsm → src}/renderers/common/RenderContexts.js +1 -1
- package/{examples/jsm → src}/renderers/common/RenderList.js +1 -1
- package/{examples/jsm → src}/renderers/common/RenderObject.js +45 -12
- package/{examples/jsm → src}/renderers/common/Renderer.js +151 -73
- package/{examples/jsm → src}/renderers/common/SampledTexture.js +14 -5
- package/src/renderers/common/StandardRenderer.js +18 -0
- package/{examples/jsm → src}/renderers/common/StorageBufferAttribute.js +1 -1
- package/{examples/jsm → src}/renderers/common/StorageInstancedBufferAttribute.js +1 -1
- package/{examples/jsm → src}/renderers/common/StorageTexture.js +2 -1
- package/{examples/jsm → src}/renderers/common/Textures.js +14 -14
- package/{examples/jsm → src}/renderers/common/Uniform.js +9 -4
- package/{examples/jsm → src}/renderers/common/UniformsGroup.js +69 -31
- package/{examples/jsm → src}/renderers/common/extras/PMREMGenerator.js +25 -25
- package/src/renderers/common/nodes/NodeBuilderState.js +58 -0
- package/src/renderers/common/nodes/NodeLibrary.js +118 -0
- package/{examples/jsm → src}/renderers/common/nodes/NodeSampledTexture.js +8 -7
- package/{examples/jsm → src}/renderers/common/nodes/NodeSampler.js +2 -1
- package/{examples/jsm → src}/renderers/common/nodes/NodeStorageBuffer.js +5 -1
- package/{examples/jsm → src}/renderers/common/nodes/NodeUniform.js +3 -3
- package/{examples/jsm → src}/renderers/common/nodes/NodeUniformBuffer.js +2 -1
- package/{examples/jsm → src}/renderers/common/nodes/NodeUniformsGroup.js +2 -8
- package/{examples/jsm → src}/renderers/common/nodes/Nodes.js +69 -21
- package/src/renderers/common/nodes/StandardNodeLibrary.js +105 -0
- package/src/renderers/shaders/ShaderChunk/batching_pars_vertex.glsl.js +16 -1
- package/src/renderers/shaders/ShaderChunk/batching_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/color_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/colorspace_pars_fragment.glsl.js +0 -9
- package/src/renderers/shaders/ShaderChunk/common.glsl.js +0 -10
- package/src/renderers/shaders/ShaderChunk/lights_fragment_begin.glsl.js +3 -3
- package/src/renderers/shaders/ShaderChunk/packing.glsl.js +45 -13
- package/src/renderers/shaders/ShaderChunk/shadowmap_pars_fragment.glsl.js +7 -4
- package/src/renderers/shaders/ShaderChunk/shadowmap_pars_vertex.glsl.js +3 -0
- package/src/renderers/shaders/ShaderChunk/shadowmask_pars_fragment.glsl.js +3 -3
- package/src/renderers/shaders/ShaderChunk/tonemapping_pars_fragment.glsl.js +2 -2
- package/src/renderers/shaders/ShaderLib/depth.glsl.js +8 -0
- package/src/renderers/shaders/UniformsLib.js +3 -0
- package/src/renderers/webgl/WebGLAttributes.js +2 -2
- package/src/renderers/webgl/WebGLBufferRenderer.js +6 -19
- package/src/renderers/webgl/WebGLIndexedBufferRenderer.js +6 -18
- package/src/renderers/webgl/WebGLLights.js +6 -0
- package/src/renderers/webgl/WebGLProgram.js +27 -1
- package/src/renderers/webgl/WebGLPrograms.js +1 -1
- package/src/renderers/webgl/WebGLProperties.js +7 -0
- package/src/renderers/webgl/WebGLTextures.js +75 -57
- package/src/renderers/webgl/WebGLUniforms.js +12 -2
- package/src/renderers/webgl/WebGLUniformsGroups.js +7 -7
- package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/WebGLBackend.js +242 -120
- package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/nodes/GLSLNodeBuilder.js +227 -44
- package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/utils/WebGLAttributeUtils.js +2 -2
- package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/utils/WebGLConstants.js +1 -0
- package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/utils/WebGLExtensions.js +2 -0
- package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/utils/WebGLState.js +22 -1
- package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/utils/WebGLTextureUtils.js +62 -23
- package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/utils/WebGLUtils.js +1 -1
- package/{examples/jsm → src}/renderers/webgpu/WebGPUBackend.js +242 -136
- package/{examples/jsm → src}/renderers/webgpu/WebGPURenderer.js +9 -9
- package/{examples/jsm → src}/renderers/webgpu/nodes/WGSLNodeBuilder.js +281 -107
- package/src/renderers/webgpu/nodes/WGSLNodeFunction.js +159 -0
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUAttributeUtils.js +2 -1
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUBindingUtils.js +64 -33
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUConstants.js +4 -1
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUPipelineUtils.js +34 -36
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUTexturePassUtils.js +62 -5
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUTextureUtils.js +76 -44
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUUtils.js +42 -4
- package/src/renderers/webxr/WebXRDepthSensing.js +6 -0
- package/src/renderers/webxr/WebXRManager.js +37 -24
- package/src/textures/CompressedArrayTexture.js +1 -1
- package/examples/jsm/loaders/LogLuvLoader.js +0 -606
- package/examples/jsm/nodes/Nodes.js +0 -202
- package/examples/jsm/nodes/accessors/BatchNode.js +0 -78
- package/examples/jsm/nodes/accessors/CameraNode.js +0 -12
- package/examples/jsm/nodes/accessors/CubeTextureNode.js +0 -61
- package/examples/jsm/nodes/accessors/InstanceNode.js +0 -94
- package/examples/jsm/nodes/accessors/InstancedPointsMaterialNode.js +0 -21
- package/examples/jsm/nodes/accessors/ModelNode.js +0 -36
- package/examples/jsm/nodes/accessors/NormalNode.js +0 -14
- package/examples/jsm/nodes/accessors/PointUVNode.js +0 -26
- package/examples/jsm/nodes/accessors/PositionNode.js +0 -10
- package/examples/jsm/nodes/accessors/ReflectVectorNode.js +0 -6
- package/examples/jsm/nodes/accessors/SkinningNode.js +0 -124
- package/examples/jsm/nodes/accessors/TangentNode.js +0 -23
- package/examples/jsm/nodes/core/CacheNode.js +0 -49
- package/examples/jsm/nodes/core/NodeCache.js +0 -26
- package/examples/jsm/nodes/core/NodeKeywords.js +0 -80
- package/examples/jsm/nodes/core/PropertyNode.js +0 -83
- package/examples/jsm/nodes/core/UniformGroupNode.js +0 -36
- package/examples/jsm/nodes/display/BlendModeNode.js +0 -128
- package/examples/jsm/nodes/display/ColorAdjustmentNode.js +0 -99
- package/examples/jsm/nodes/display/ColorSpaceNode.js +0 -108
- package/examples/jsm/nodes/display/FrontFacingNode.js +0 -40
- package/examples/jsm/nodes/display/PassNode.js +0 -201
- package/examples/jsm/nodes/display/ToneMappingNode.js +0 -188
- package/examples/jsm/nodes/display/ViewportDepthNode.js +0 -97
- package/examples/jsm/nodes/display/ViewportDepthTextureNode.js +0 -31
- package/examples/jsm/nodes/display/ViewportSharedTextureNode.js +0 -37
- package/examples/jsm/nodes/functions/material/getGeometryRoughness.js +0 -13
- package/examples/jsm/nodes/lighting/AONode.js +0 -27
- package/examples/jsm/nodes/lighting/AnalyticLightNode.js +0 -256
- package/examples/jsm/nodes/lighting/LightingContextNode.js +0 -66
- package/examples/jsm/nodes/lighting/LightsNode.js +0 -215
- package/examples/jsm/nodes/materials/LineBasicNodeMaterial.js +0 -28
- package/examples/jsm/nodes/materials/MeshBasicNodeMaterial.js +0 -28
- package/examples/jsm/nodes/materials/MeshLambertNodeMaterial.js +0 -34
- package/examples/jsm/nodes/materials/MeshMatcapNodeMaterial.js +0 -52
- package/examples/jsm/nodes/materials/MeshNormalNodeMaterial.js +0 -38
- package/examples/jsm/nodes/materials/MeshPhongNodeMaterial.js +0 -65
- package/examples/jsm/nodes/materials/MeshToonNodeMaterial.js +0 -34
- package/examples/jsm/nodes/materials/ShadowNodeMaterial.js +0 -34
- package/examples/jsm/nodes/math/HashNode.js +0 -34
- package/examples/jsm/nodes/math/MathNode.js +0 -391
- package/examples/jsm/nodes/procedural/CheckerNode.js +0 -42
- package/examples/jsm/nodes/utils/DiscardNode.js +0 -27
- package/examples/jsm/nodes/utils/PackingNode.js +0 -55
- package/examples/jsm/nodes/utils/RotateUVNode.js +0 -35
- package/examples/jsm/renderers/common/PostProcessing.js +0 -33
- package/examples/jsm/renderers/common/nodes/NodeBuilderState.js +0 -44
- package/examples/jsm/renderers/webgpu/nodes/WGSLNodeFunction.js +0 -104
- /package/{examples/jsm/nodes/accessors/UVNode.js → src/nodes/accessors/UV.js} +0 -0
- /package/{examples/jsm → src}/nodes/core/NodeAttribute.js +0 -0
- /package/{examples/jsm → src}/nodes/core/NodeCode.js +0 -0
- /package/{examples/jsm → src}/nodes/core/NodeFunctionInput.js +0 -0
- /package/{examples/jsm → src}/nodes/core/NodeParser.js +0 -0
- /package/{examples/jsm → src}/nodes/core/NodeVar.js +0 -0
- /package/{examples/jsm → src}/nodes/core/NodeVarying.js +0 -0
- /package/{examples/jsm → src}/nodes/core/UniformGroup.js +0 -0
- /package/{examples/jsm → src}/nodes/core/constants.js +0 -0
- /package/{examples/jsm → src}/nodes/materialx/DISCLAIMER.md +0 -0
- /package/{examples/jsm → src}/nodes/parsers/GLSLNodeParser.js +0 -0
- /package/{examples/jsm → src}/renderers/common/Animation.js +0 -0
- /package/{examples/jsm → src}/renderers/common/Binding.js +0 -0
- /package/{examples/jsm → src}/renderers/common/Buffer.js +0 -0
- /package/{examples/jsm → src}/renderers/common/BufferUtils.js +0 -0
- /package/{examples/jsm → src}/renderers/common/ChainMap.js +0 -0
- /package/{examples/jsm → src}/renderers/common/ComputePipeline.js +0 -0
- /package/{examples/jsm → src}/renderers/common/Constants.js +0 -0
- /package/{examples/jsm → src}/renderers/common/DataMap.js +0 -0
- /package/{examples/jsm → src}/renderers/common/Pipeline.js +0 -0
- /package/{examples/jsm → src}/renderers/common/Pipelines.js +0 -0
- /package/{examples/jsm → src}/renderers/common/ProgrammableStage.js +0 -0
- /package/{examples/jsm → src}/renderers/common/RenderBundle.js +0 -0
- /package/{examples/jsm → src}/renderers/common/RenderBundles.js +0 -0
- /package/{examples/jsm → src}/renderers/common/RenderLists.js +0 -0
- /package/{examples/jsm → src}/renderers/common/RenderObjects.js +0 -0
- /package/{examples/jsm → src}/renderers/common/RenderPipeline.js +0 -0
- /package/{examples/jsm → src}/renderers/common/Sampler.js +0 -0
- /package/{examples/jsm → src}/renderers/common/StorageBuffer.js +0 -0
- /package/{examples/jsm → src}/renderers/common/UniformBuffer.js +0 -0
- /package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/WebGLBufferRenderer.js +0 -0
- /package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/utils/WebGLCapabilities.js +0 -0
- /package/{examples/jsm → src}/renderers/webgpu/nodes/WGSLNodeParser.js +0 -0
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { REVISION } from './constants.js';
|
|
2
|
+
|
|
3
|
+
export { WebGLArrayRenderTarget } from './renderers/WebGLArrayRenderTarget.js';
|
|
4
|
+
export { WebGL3DRenderTarget } from './renderers/WebGL3DRenderTarget.js';
|
|
5
|
+
export { WebGLCubeRenderTarget } from './renderers/WebGLCubeRenderTarget.js';
|
|
6
|
+
export { WebGLRenderTarget } from './renderers/WebGLRenderTarget.js';
|
|
7
|
+
//export { WebGLRenderer } from './renderers/WebGLRenderer.js';
|
|
8
|
+
//export { ShaderLib } from './renderers/shaders/ShaderLib.js';
|
|
9
|
+
//export { UniformsLib } from './renderers/shaders/UniformsLib.js';
|
|
10
|
+
//export { UniformsUtils } from './renderers/shaders/UniformsUtils.js';
|
|
11
|
+
//export { ShaderChunk } from './renderers/shaders/ShaderChunk.js';
|
|
12
|
+
export { FogExp2 } from './scenes/FogExp2.js';
|
|
13
|
+
export { Fog } from './scenes/Fog.js';
|
|
14
|
+
export { Scene } from './scenes/Scene.js';
|
|
15
|
+
export { Sprite } from './objects/Sprite.js';
|
|
16
|
+
export { LOD } from './objects/LOD.js';
|
|
17
|
+
export { SkinnedMesh } from './objects/SkinnedMesh.js';
|
|
18
|
+
export { Skeleton } from './objects/Skeleton.js';
|
|
19
|
+
export { Bone } from './objects/Bone.js';
|
|
20
|
+
export { Mesh } from './objects/Mesh.js';
|
|
21
|
+
export { InstancedMesh } from './objects/InstancedMesh.js';
|
|
22
|
+
export { BatchedMesh } from './objects/BatchedMesh.js';
|
|
23
|
+
export { LineSegments } from './objects/LineSegments.js';
|
|
24
|
+
export { LineLoop } from './objects/LineLoop.js';
|
|
25
|
+
export { Line } from './objects/Line.js';
|
|
26
|
+
export { Points } from './objects/Points.js';
|
|
27
|
+
export { Group } from './objects/Group.js';
|
|
28
|
+
export { VideoTexture } from './textures/VideoTexture.js';
|
|
29
|
+
export { FramebufferTexture } from './textures/FramebufferTexture.js';
|
|
30
|
+
export { Source } from './textures/Source.js';
|
|
31
|
+
export { DataTexture } from './textures/DataTexture.js';
|
|
32
|
+
export { DataArrayTexture } from './textures/DataArrayTexture.js';
|
|
33
|
+
export { Data3DTexture } from './textures/Data3DTexture.js';
|
|
34
|
+
export { CompressedTexture } from './textures/CompressedTexture.js';
|
|
35
|
+
export { CompressedArrayTexture } from './textures/CompressedArrayTexture.js';
|
|
36
|
+
export { CompressedCubeTexture } from './textures/CompressedCubeTexture.js';
|
|
37
|
+
export { CubeTexture } from './textures/CubeTexture.js';
|
|
38
|
+
export { CanvasTexture } from './textures/CanvasTexture.js';
|
|
39
|
+
export { DepthTexture } from './textures/DepthTexture.js';
|
|
40
|
+
export { Texture } from './textures/Texture.js';
|
|
41
|
+
export * from './geometries/Geometries.js';
|
|
42
|
+
export * from './materials/Materials.js';
|
|
43
|
+
export * from './materials/nodes/NodeMaterials.js';
|
|
44
|
+
export { Material } from './materials/Material.js';
|
|
45
|
+
export { AnimationLoader } from './loaders/AnimationLoader.js';
|
|
46
|
+
export { CompressedTextureLoader } from './loaders/CompressedTextureLoader.js';
|
|
47
|
+
export { CubeTextureLoader } from './loaders/CubeTextureLoader.js';
|
|
48
|
+
export { DataTextureLoader } from './loaders/DataTextureLoader.js';
|
|
49
|
+
export { TextureLoader } from './loaders/TextureLoader.js';
|
|
50
|
+
export { ObjectLoader } from './loaders/ObjectLoader.js';
|
|
51
|
+
export { MaterialLoader } from './loaders/MaterialLoader.js';
|
|
52
|
+
export { BufferGeometryLoader } from './loaders/BufferGeometryLoader.js';
|
|
53
|
+
export { DefaultLoadingManager, LoadingManager } from './loaders/LoadingManager.js';
|
|
54
|
+
export { ImageLoader } from './loaders/ImageLoader.js';
|
|
55
|
+
export { ImageBitmapLoader } from './loaders/ImageBitmapLoader.js';
|
|
56
|
+
export { FileLoader } from './loaders/FileLoader.js';
|
|
57
|
+
export { Loader } from './loaders/Loader.js';
|
|
58
|
+
export { LoaderUtils } from './loaders/LoaderUtils.js';
|
|
59
|
+
export { Cache } from './loaders/Cache.js';
|
|
60
|
+
export { AudioLoader } from './loaders/AudioLoader.js';
|
|
61
|
+
export { SpotLight } from './lights/SpotLight.js';
|
|
62
|
+
export { PointLight } from './lights/PointLight.js';
|
|
63
|
+
export { RectAreaLight } from './lights/RectAreaLight.js';
|
|
64
|
+
export { HemisphereLight } from './lights/HemisphereLight.js';
|
|
65
|
+
export { DirectionalLight } from './lights/DirectionalLight.js';
|
|
66
|
+
export { AmbientLight } from './lights/AmbientLight.js';
|
|
67
|
+
export { Light } from './lights/Light.js';
|
|
68
|
+
export { LightProbe } from './lights/LightProbe.js';
|
|
69
|
+
export { StereoCamera } from './cameras/StereoCamera.js';
|
|
70
|
+
export { PerspectiveCamera } from './cameras/PerspectiveCamera.js';
|
|
71
|
+
export { OrthographicCamera } from './cameras/OrthographicCamera.js';
|
|
72
|
+
export { CubeCamera } from './cameras/CubeCamera.js';
|
|
73
|
+
export { ArrayCamera } from './cameras/ArrayCamera.js';
|
|
74
|
+
export { Camera } from './cameras/Camera.js';
|
|
75
|
+
export { AudioListener } from './audio/AudioListener.js';
|
|
76
|
+
export { PositionalAudio } from './audio/PositionalAudio.js';
|
|
77
|
+
export { AudioContext } from './audio/AudioContext.js';
|
|
78
|
+
export { AudioAnalyser } from './audio/AudioAnalyser.js';
|
|
79
|
+
export { Audio } from './audio/Audio.js';
|
|
80
|
+
export { VectorKeyframeTrack } from './animation/tracks/VectorKeyframeTrack.js';
|
|
81
|
+
export { StringKeyframeTrack } from './animation/tracks/StringKeyframeTrack.js';
|
|
82
|
+
export { QuaternionKeyframeTrack } from './animation/tracks/QuaternionKeyframeTrack.js';
|
|
83
|
+
export { NumberKeyframeTrack } from './animation/tracks/NumberKeyframeTrack.js';
|
|
84
|
+
export { ColorKeyframeTrack } from './animation/tracks/ColorKeyframeTrack.js';
|
|
85
|
+
export { BooleanKeyframeTrack } from './animation/tracks/BooleanKeyframeTrack.js';
|
|
86
|
+
export { PropertyMixer } from './animation/PropertyMixer.js';
|
|
87
|
+
export { PropertyBinding } from './animation/PropertyBinding.js';
|
|
88
|
+
export { KeyframeTrack } from './animation/KeyframeTrack.js';
|
|
89
|
+
export { AnimationUtils } from './animation/AnimationUtils.js';
|
|
90
|
+
export { AnimationObjectGroup } from './animation/AnimationObjectGroup.js';
|
|
91
|
+
export { AnimationMixer } from './animation/AnimationMixer.js';
|
|
92
|
+
export { AnimationClip } from './animation/AnimationClip.js';
|
|
93
|
+
export { AnimationAction } from './animation/AnimationAction.js';
|
|
94
|
+
export { RenderTarget } from './core/RenderTarget.js';
|
|
95
|
+
export { Uniform } from './core/Uniform.js';
|
|
96
|
+
export { UniformsGroup } from './core/UniformsGroup.js';
|
|
97
|
+
export { InstancedBufferGeometry } from './core/InstancedBufferGeometry.js';
|
|
98
|
+
export { BufferGeometry } from './core/BufferGeometry.js';
|
|
99
|
+
export { InterleavedBufferAttribute } from './core/InterleavedBufferAttribute.js';
|
|
100
|
+
export { InstancedInterleavedBuffer } from './core/InstancedInterleavedBuffer.js';
|
|
101
|
+
export { InterleavedBuffer } from './core/InterleavedBuffer.js';
|
|
102
|
+
export { InstancedBufferAttribute } from './core/InstancedBufferAttribute.js';
|
|
103
|
+
export { GLBufferAttribute } from './core/GLBufferAttribute.js';
|
|
104
|
+
export * from './core/BufferAttribute.js';
|
|
105
|
+
export { Object3D } from './core/Object3D.js';
|
|
106
|
+
export { Raycaster } from './core/Raycaster.js';
|
|
107
|
+
export { Layers } from './core/Layers.js';
|
|
108
|
+
export { EventDispatcher } from './core/EventDispatcher.js';
|
|
109
|
+
export { Clock } from './core/Clock.js';
|
|
110
|
+
export { QuaternionLinearInterpolant } from './math/interpolants/QuaternionLinearInterpolant.js';
|
|
111
|
+
export { LinearInterpolant } from './math/interpolants/LinearInterpolant.js';
|
|
112
|
+
export { DiscreteInterpolant } from './math/interpolants/DiscreteInterpolant.js';
|
|
113
|
+
export { CubicInterpolant } from './math/interpolants/CubicInterpolant.js';
|
|
114
|
+
export { Interpolant } from './math/Interpolant.js';
|
|
115
|
+
export { Triangle } from './math/Triangle.js';
|
|
116
|
+
export { MathUtils } from './math/MathUtils.js';
|
|
117
|
+
export { Spherical } from './math/Spherical.js';
|
|
118
|
+
export { Cylindrical } from './math/Cylindrical.js';
|
|
119
|
+
export { Plane } from './math/Plane.js';
|
|
120
|
+
export { Frustum } from './math/Frustum.js';
|
|
121
|
+
export { Sphere } from './math/Sphere.js';
|
|
122
|
+
export { Ray } from './math/Ray.js';
|
|
123
|
+
export { Matrix4 } from './math/Matrix4.js';
|
|
124
|
+
export { Matrix3 } from './math/Matrix3.js';
|
|
125
|
+
export { Matrix2 } from './math/Matrix2.js';
|
|
126
|
+
export { Box3 } from './math/Box3.js';
|
|
127
|
+
export { Box2 } from './math/Box2.js';
|
|
128
|
+
export { Line3 } from './math/Line3.js';
|
|
129
|
+
export { Euler } from './math/Euler.js';
|
|
130
|
+
export { Vector4 } from './math/Vector4.js';
|
|
131
|
+
export { Vector3 } from './math/Vector3.js';
|
|
132
|
+
export { Vector2 } from './math/Vector2.js';
|
|
133
|
+
export { Quaternion } from './math/Quaternion.js';
|
|
134
|
+
export { Color } from './math/Color.js';
|
|
135
|
+
export { ColorManagement } from './math/ColorManagement.js';
|
|
136
|
+
export { SphericalHarmonics3 } from './math/SphericalHarmonics3.js';
|
|
137
|
+
export { SpotLightHelper } from './helpers/SpotLightHelper.js';
|
|
138
|
+
export { SkeletonHelper } from './helpers/SkeletonHelper.js';
|
|
139
|
+
export { PointLightHelper } from './helpers/PointLightHelper.js';
|
|
140
|
+
export { HemisphereLightHelper } from './helpers/HemisphereLightHelper.js';
|
|
141
|
+
export { GridHelper } from './helpers/GridHelper.js';
|
|
142
|
+
export { PolarGridHelper } from './helpers/PolarGridHelper.js';
|
|
143
|
+
export { DirectionalLightHelper } from './helpers/DirectionalLightHelper.js';
|
|
144
|
+
export { CameraHelper } from './helpers/CameraHelper.js';
|
|
145
|
+
export { BoxHelper } from './helpers/BoxHelper.js';
|
|
146
|
+
export { Box3Helper } from './helpers/Box3Helper.js';
|
|
147
|
+
export { PlaneHelper } from './helpers/PlaneHelper.js';
|
|
148
|
+
export { ArrowHelper } from './helpers/ArrowHelper.js';
|
|
149
|
+
export { AxesHelper } from './helpers/AxesHelper.js';
|
|
150
|
+
export * from './extras/curves/Curves.js';
|
|
151
|
+
export { Shape } from './extras/core/Shape.js';
|
|
152
|
+
export { Path } from './extras/core/Path.js';
|
|
153
|
+
export { ShapePath } from './extras/core/ShapePath.js';
|
|
154
|
+
export { CurvePath } from './extras/core/CurvePath.js';
|
|
155
|
+
export { Curve } from './extras/core/Curve.js';
|
|
156
|
+
export { Controls } from './extras/Controls.js';
|
|
157
|
+
export { DataUtils } from './extras/DataUtils.js';
|
|
158
|
+
export { ImageUtils } from './extras/ImageUtils.js';
|
|
159
|
+
export { ShapeUtils } from './extras/ShapeUtils.js';
|
|
160
|
+
//export { PMREMGenerator } from './extras/PMREMGenerator.js';
|
|
161
|
+
//export { WebGLUtils } from './renderers/webgl/WebGLUtils.js';
|
|
162
|
+
export { createCanvasElement } from './utils.js';
|
|
163
|
+
export * from './constants.js';
|
|
164
|
+
export * from './Three.Legacy.js';
|
|
165
|
+
|
|
166
|
+
export { default as WebGPURenderer } from './renderers/webgpu/WebGPURenderer.js';
|
|
167
|
+
export { default as QuadMesh } from './renderers/common/QuadMesh.js';
|
|
168
|
+
export { default as PMREMGenerator } from './renderers/common/extras/PMREMGenerator.js';
|
|
169
|
+
export { default as PostProcessing } from './renderers/common/PostProcessing.js';
|
|
170
|
+
export { default as StorageTexture } from './renderers/common/StorageTexture.js';
|
|
171
|
+
export { default as StorageBufferAttribute } from './renderers/common/StorageBufferAttribute.js';
|
|
172
|
+
export { default as StorageInstancedBufferAttribute } from './renderers/common/StorageInstancedBufferAttribute.js';
|
|
173
|
+
export { default as IESSpotLight } from './lights/webgpu/IESSpotLight.js';
|
|
174
|
+
export { default as NodeLoader } from './loaders/nodes/NodeLoader.js';
|
|
175
|
+
export { default as NodeObjectLoader } from './loaders/nodes/NodeObjectLoader.js';
|
|
176
|
+
export { default as NodeMaterialLoader } from './loaders/nodes/NodeMaterialLoader.js';
|
|
177
|
+
export * from './nodes/Nodes.js';
|
|
178
|
+
export * from './nodes/TSL.js';
|
|
179
|
+
|
|
180
|
+
if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {
|
|
181
|
+
|
|
182
|
+
__THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'register', { detail: {
|
|
183
|
+
revision: REVISION,
|
|
184
|
+
} } ) );
|
|
185
|
+
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
if ( typeof window !== 'undefined' ) {
|
|
189
|
+
|
|
190
|
+
if ( window.__THREE__ ) {
|
|
191
|
+
|
|
192
|
+
console.warn( 'WARNING: Multiple instances of Three.js being imported.' );
|
|
193
|
+
|
|
194
|
+
} else {
|
|
195
|
+
|
|
196
|
+
window.__THREE__ = REVISION;
|
|
197
|
+
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
}
|
package/src/Three.js
CHANGED
|
@@ -120,6 +120,7 @@ export { Sphere } from './math/Sphere.js';
|
|
|
120
120
|
export { Ray } from './math/Ray.js';
|
|
121
121
|
export { Matrix4 } from './math/Matrix4.js';
|
|
122
122
|
export { Matrix3 } from './math/Matrix3.js';
|
|
123
|
+
export { Matrix2 } from './math/Matrix2.js';
|
|
123
124
|
export { Box3 } from './math/Box3.js';
|
|
124
125
|
export { Box2 } from './math/Box2.js';
|
|
125
126
|
export { Line3 } from './math/Line3.js';
|
|
@@ -150,9 +151,11 @@ export { Path } from './extras/core/Path.js';
|
|
|
150
151
|
export { ShapePath } from './extras/core/ShapePath.js';
|
|
151
152
|
export { CurvePath } from './extras/core/CurvePath.js';
|
|
152
153
|
export { Curve } from './extras/core/Curve.js';
|
|
154
|
+
export { Controls } from './extras/Controls.js';
|
|
153
155
|
export { DataUtils } from './extras/DataUtils.js';
|
|
154
156
|
export { ImageUtils } from './extras/ImageUtils.js';
|
|
155
157
|
export { ShapeUtils } from './extras/ShapeUtils.js';
|
|
158
|
+
export { TextureUtils } from './extras/TextureUtils.js';
|
|
156
159
|
export { PMREMGenerator } from './extras/PMREMGenerator.js';
|
|
157
160
|
export { WebGLUtils } from './renderers/webgl/WebGLUtils.js';
|
|
158
161
|
export { createCanvasElement } from './utils.js';
|
package/src/constants.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const REVISION = '
|
|
1
|
+
export const REVISION = '168';
|
|
2
2
|
|
|
3
3
|
export const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
|
|
4
4
|
export const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
|
|
@@ -103,6 +103,7 @@ export const RedFormat = 1028;
|
|
|
103
103
|
export const RedIntegerFormat = 1029;
|
|
104
104
|
export const RGFormat = 1030;
|
|
105
105
|
export const RGIntegerFormat = 1031;
|
|
106
|
+
export const RGBIntegerFormat = 1032;
|
|
106
107
|
export const RGBAIntegerFormat = 1033;
|
|
107
108
|
|
|
108
109
|
export const RGB_S3TC_DXT1_Format = 33776;
|
|
@@ -153,6 +154,8 @@ export const TriangleStripDrawMode = 1;
|
|
|
153
154
|
export const TriangleFanDrawMode = 2;
|
|
154
155
|
export const BasicDepthPacking = 3200;
|
|
155
156
|
export const RGBADepthPacking = 3201;
|
|
157
|
+
export const RGBDepthPacking = 3202;
|
|
158
|
+
export const RGDepthPacking = 3203;
|
|
156
159
|
export const TangentSpaceNormalMap = 0;
|
|
157
160
|
export const ObjectSpaceNormalMap = 1;
|
|
158
161
|
|
package/src/core/Object3D.js
CHANGED
|
@@ -589,13 +589,17 @@ class Object3D extends EventDispatcher {
|
|
|
589
589
|
|
|
590
590
|
if ( this.matrixWorldNeedsUpdate || force ) {
|
|
591
591
|
|
|
592
|
-
if ( this.
|
|
592
|
+
if ( this.matrixWorldAutoUpdate === true ) {
|
|
593
593
|
|
|
594
|
-
|
|
594
|
+
if ( this.parent === null ) {
|
|
595
595
|
|
|
596
|
-
|
|
596
|
+
this.matrixWorld.copy( this.matrix );
|
|
597
597
|
|
|
598
|
-
|
|
598
|
+
} else {
|
|
599
|
+
|
|
600
|
+
this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix );
|
|
601
|
+
|
|
602
|
+
}
|
|
599
603
|
|
|
600
604
|
}
|
|
601
605
|
|
|
@@ -605,7 +609,7 @@ class Object3D extends EventDispatcher {
|
|
|
605
609
|
|
|
606
610
|
}
|
|
607
611
|
|
|
608
|
-
//
|
|
612
|
+
// make sure descendants are updated if required
|
|
609
613
|
|
|
610
614
|
const children = this.children;
|
|
611
615
|
|
|
@@ -613,11 +617,7 @@ class Object3D extends EventDispatcher {
|
|
|
613
617
|
|
|
614
618
|
const child = children[ i ];
|
|
615
619
|
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
child.updateMatrixWorld( force );
|
|
619
|
-
|
|
620
|
-
}
|
|
620
|
+
child.updateMatrixWorld( force );
|
|
621
621
|
|
|
622
622
|
}
|
|
623
623
|
|
|
@@ -627,7 +627,7 @@ class Object3D extends EventDispatcher {
|
|
|
627
627
|
|
|
628
628
|
const parent = this.parent;
|
|
629
629
|
|
|
630
|
-
if ( updateParents === true && parent !== null
|
|
630
|
+
if ( updateParents === true && parent !== null ) {
|
|
631
631
|
|
|
632
632
|
parent.updateWorldMatrix( true, false );
|
|
633
633
|
|
|
@@ -635,17 +635,21 @@ class Object3D extends EventDispatcher {
|
|
|
635
635
|
|
|
636
636
|
if ( this.matrixAutoUpdate ) this.updateMatrix();
|
|
637
637
|
|
|
638
|
-
if ( this.
|
|
638
|
+
if ( this.matrixWorldAutoUpdate === true ) {
|
|
639
639
|
|
|
640
|
-
|
|
640
|
+
if ( this.parent === null ) {
|
|
641
641
|
|
|
642
|
-
|
|
642
|
+
this.matrixWorld.copy( this.matrix );
|
|
643
643
|
|
|
644
|
-
|
|
644
|
+
} else {
|
|
645
|
+
|
|
646
|
+
this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix );
|
|
647
|
+
|
|
648
|
+
}
|
|
645
649
|
|
|
646
650
|
}
|
|
647
651
|
|
|
648
|
-
//
|
|
652
|
+
// make sure descendants are updated
|
|
649
653
|
|
|
650
654
|
if ( updateChildren === true ) {
|
|
651
655
|
|
|
@@ -655,11 +659,7 @@ class Object3D extends EventDispatcher {
|
|
|
655
659
|
|
|
656
660
|
const child = children[ i ];
|
|
657
661
|
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
child.updateWorldMatrix( false, true );
|
|
661
|
-
|
|
662
|
-
}
|
|
662
|
+
child.updateWorldMatrix( false, true );
|
|
663
663
|
|
|
664
664
|
}
|
|
665
665
|
|
|
@@ -752,7 +752,7 @@ class Object3D extends EventDispatcher {
|
|
|
752
752
|
sphereCenter: bound.sphere.center.toArray()
|
|
753
753
|
} ) );
|
|
754
754
|
|
|
755
|
-
object.
|
|
755
|
+
object.maxInstanceCount = this._maxInstanceCount;
|
|
756
756
|
object.maxVertexCount = this._maxVertexCount;
|
|
757
757
|
object.maxIndexCount = this._maxIndexCount;
|
|
758
758
|
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { EventDispatcher } from '../core/EventDispatcher.js';
|
|
2
|
+
|
|
3
|
+
class Controls extends EventDispatcher {
|
|
4
|
+
|
|
5
|
+
constructor( object, domElement ) {
|
|
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 };
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { AlphaFormat, LuminanceFormat, LuminanceAlphaFormat, RedFormat, RedIntegerFormat, RGFormat, RGIntegerFormat, RGBFormat, RGBAFormat, RGBAIntegerFormat, RGB_S3TC_DXT1_Format, RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT5_Format, RGB_PVRTC_2BPPV1_Format, RGBA_PVRTC_2BPPV1_Format, RGB_PVRTC_4BPPV1_Format, RGBA_PVRTC_4BPPV1_Format, RGB_ETC1_Format, RGB_ETC2_Format, RGBA_ETC2_EAC_Format, RGBA_ASTC_4x4_Format, RGBA_ASTC_5x4_Format, RGBA_ASTC_5x5_Format, RGBA_ASTC_6x5_Format, RGBA_ASTC_6x6_Format, RGBA_ASTC_8x5_Format, RGBA_ASTC_8x6_Format, RGBA_ASTC_8x8_Format, RGBA_ASTC_10x5_Format, RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_10x10_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, RGBA_BPTC_Format, RGB_BPTC_SIGNED_Format, RGB_BPTC_UNSIGNED_Format, RED_RGTC1_Format, SIGNED_RED_RGTC1_Format, RED_GREEN_RGTC2_Format, SIGNED_RED_GREEN_RGTC2_Format, UnsignedByteType, ByteType, UnsignedShortType, ShortType, HalfFloatType, UnsignedShort4444Type, UnsignedShort5551Type, UnsignedIntType, IntType, FloatType, UnsignedInt5999Type } from '../constants.js';
|
|
2
|
+
|
|
3
|
+
function contain( texture, aspect ) {
|
|
4
|
+
|
|
5
|
+
const imageAspect = ( texture.image && texture.image.width ) ? texture.image.width / texture.image.height : 1;
|
|
6
|
+
|
|
7
|
+
if ( imageAspect > aspect ) {
|
|
8
|
+
|
|
9
|
+
texture.repeat.x = 1;
|
|
10
|
+
texture.repeat.y = imageAspect / aspect;
|
|
11
|
+
|
|
12
|
+
texture.offset.x = 0;
|
|
13
|
+
texture.offset.y = ( 1 - texture.repeat.y ) / 2;
|
|
14
|
+
|
|
15
|
+
} else {
|
|
16
|
+
|
|
17
|
+
texture.repeat.x = aspect / imageAspect;
|
|
18
|
+
texture.repeat.y = 1;
|
|
19
|
+
|
|
20
|
+
texture.offset.x = ( 1 - texture.repeat.x ) / 2;
|
|
21
|
+
texture.offset.y = 0;
|
|
22
|
+
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return texture;
|
|
26
|
+
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function cover( texture, aspect ) {
|
|
30
|
+
|
|
31
|
+
const imageAspect = ( texture.image && texture.image.width ) ? texture.image.width / texture.image.height : 1;
|
|
32
|
+
|
|
33
|
+
if ( imageAspect > aspect ) {
|
|
34
|
+
|
|
35
|
+
texture.repeat.x = aspect / imageAspect;
|
|
36
|
+
texture.repeat.y = 1;
|
|
37
|
+
|
|
38
|
+
texture.offset.x = ( 1 - texture.repeat.x ) / 2;
|
|
39
|
+
texture.offset.y = 0;
|
|
40
|
+
|
|
41
|
+
} else {
|
|
42
|
+
|
|
43
|
+
texture.repeat.x = 1;
|
|
44
|
+
texture.repeat.y = imageAspect / aspect;
|
|
45
|
+
|
|
46
|
+
texture.offset.x = 0;
|
|
47
|
+
texture.offset.y = ( 1 - texture.repeat.y ) / 2;
|
|
48
|
+
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return texture;
|
|
52
|
+
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function fill( texture ) {
|
|
56
|
+
|
|
57
|
+
texture.repeat.x = 1;
|
|
58
|
+
texture.repeat.y = 1;
|
|
59
|
+
|
|
60
|
+
texture.offset.x = 0;
|
|
61
|
+
texture.offset.y = 0;
|
|
62
|
+
|
|
63
|
+
return texture;
|
|
64
|
+
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Given the width, height, format, and type of a texture. Determines how many
|
|
71
|
+
* bytes must be used to represent the texture.
|
|
72
|
+
*/
|
|
73
|
+
function getByteLength( width, height, format, type ) {
|
|
74
|
+
|
|
75
|
+
const typeByteLength = getTextureTypeByteLength( type );
|
|
76
|
+
|
|
77
|
+
switch ( format ) {
|
|
78
|
+
|
|
79
|
+
// https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glTexImage2D.xhtml
|
|
80
|
+
case AlphaFormat:
|
|
81
|
+
return width * height;
|
|
82
|
+
case LuminanceFormat:
|
|
83
|
+
return width * height;
|
|
84
|
+
case LuminanceAlphaFormat:
|
|
85
|
+
return width * height * 2;
|
|
86
|
+
case RedFormat:
|
|
87
|
+
return ( ( width * height ) / typeByteLength.components ) * typeByteLength.byteLength;
|
|
88
|
+
case RedIntegerFormat:
|
|
89
|
+
return ( ( width * height ) / typeByteLength.components ) * typeByteLength.byteLength;
|
|
90
|
+
case RGFormat:
|
|
91
|
+
return ( ( width * height * 2 ) / typeByteLength.components ) * typeByteLength.byteLength;
|
|
92
|
+
case RGIntegerFormat:
|
|
93
|
+
return ( ( width * height * 2 ) / typeByteLength.components ) * typeByteLength.byteLength;
|
|
94
|
+
case RGBFormat:
|
|
95
|
+
return ( ( width * height * 3 ) / typeByteLength.components ) * typeByteLength.byteLength;
|
|
96
|
+
case RGBAFormat:
|
|
97
|
+
return ( ( width * height * 4 ) / typeByteLength.components ) * typeByteLength.byteLength;
|
|
98
|
+
case RGBAIntegerFormat:
|
|
99
|
+
return ( ( width * height * 4 ) / typeByteLength.components ) * typeByteLength.byteLength;
|
|
100
|
+
|
|
101
|
+
// https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_s3tc_srgb/
|
|
102
|
+
case RGB_S3TC_DXT1_Format:
|
|
103
|
+
case RGBA_S3TC_DXT1_Format:
|
|
104
|
+
return Math.floor( ( width + 3 ) / 4 ) * Math.floor( ( height + 3 ) / 4 ) * 8;
|
|
105
|
+
case RGBA_S3TC_DXT3_Format:
|
|
106
|
+
case RGBA_S3TC_DXT5_Format:
|
|
107
|
+
return Math.floor( ( width + 3 ) / 4 ) * Math.floor( ( height + 3 ) / 4 ) * 16;
|
|
108
|
+
|
|
109
|
+
// https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_pvrtc/
|
|
110
|
+
case RGB_PVRTC_2BPPV1_Format:
|
|
111
|
+
case RGBA_PVRTC_2BPPV1_Format:
|
|
112
|
+
return ( Math.max( width, 16 ) * Math.max( height, 8 ) ) / 4;
|
|
113
|
+
case RGB_PVRTC_4BPPV1_Format:
|
|
114
|
+
case RGBA_PVRTC_4BPPV1_Format:
|
|
115
|
+
return ( Math.max( width, 8 ) * Math.max( height, 8 ) ) / 2;
|
|
116
|
+
|
|
117
|
+
// https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_etc/
|
|
118
|
+
case RGB_ETC1_Format:
|
|
119
|
+
case RGB_ETC2_Format:
|
|
120
|
+
return Math.floor( ( width + 3 ) / 4 ) * Math.floor( ( height + 3 ) / 4 ) * 8;
|
|
121
|
+
case RGBA_ETC2_EAC_Format:
|
|
122
|
+
return Math.floor( ( width + 3 ) / 4 ) * Math.floor( ( height + 3 ) / 4 ) * 16;
|
|
123
|
+
|
|
124
|
+
// https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_astc/
|
|
125
|
+
case RGBA_ASTC_4x4_Format:
|
|
126
|
+
return Math.floor( ( width + 3 ) / 4 ) * Math.floor( ( height + 3 ) / 4 ) * 16;
|
|
127
|
+
case RGBA_ASTC_5x4_Format:
|
|
128
|
+
return Math.floor( ( width + 4 ) / 5 ) * Math.floor( ( height + 3 ) / 4 ) * 16;
|
|
129
|
+
case RGBA_ASTC_5x5_Format:
|
|
130
|
+
return Math.floor( ( width + 4 ) / 5 ) * Math.floor( ( height + 4 ) / 5 ) * 16;
|
|
131
|
+
case RGBA_ASTC_6x5_Format:
|
|
132
|
+
return Math.floor( ( width + 5 ) / 6 ) * Math.floor( ( height + 4 ) / 5 ) * 16;
|
|
133
|
+
case RGBA_ASTC_6x6_Format:
|
|
134
|
+
return Math.floor( ( width + 5 ) / 6 ) * Math.floor( ( height + 5 ) / 6 ) * 16;
|
|
135
|
+
case RGBA_ASTC_8x5_Format:
|
|
136
|
+
return Math.floor( ( width + 7 ) / 8 ) * Math.floor( ( height + 4 ) / 5 ) * 16;
|
|
137
|
+
case RGBA_ASTC_8x6_Format:
|
|
138
|
+
return Math.floor( ( width + 7 ) / 8 ) * Math.floor( ( height + 5 ) / 6 ) * 16;
|
|
139
|
+
case RGBA_ASTC_8x8_Format:
|
|
140
|
+
return Math.floor( ( width + 7 ) / 8 ) * Math.floor( ( height + 7 ) / 8 ) * 16;
|
|
141
|
+
case RGBA_ASTC_10x5_Format:
|
|
142
|
+
return Math.floor( ( width + 9 ) / 10 ) * Math.floor( ( height + 4 ) / 5 ) * 16;
|
|
143
|
+
case RGBA_ASTC_10x6_Format:
|
|
144
|
+
return Math.floor( ( width + 9 ) / 10 ) * Math.floor( ( height + 5 ) / 6 ) * 16;
|
|
145
|
+
case RGBA_ASTC_10x8_Format:
|
|
146
|
+
return Math.floor( ( width + 9 ) / 10 ) * Math.floor( ( height + 7 ) / 8 ) * 16;
|
|
147
|
+
case RGBA_ASTC_10x10_Format:
|
|
148
|
+
return Math.floor( ( width + 9 ) / 10 ) * Math.floor( ( height + 9 ) / 10 ) * 16;
|
|
149
|
+
case RGBA_ASTC_12x10_Format:
|
|
150
|
+
return Math.floor( ( width + 11 ) / 12 ) * Math.floor( ( height + 9 ) / 10 ) * 16;
|
|
151
|
+
case RGBA_ASTC_12x12_Format:
|
|
152
|
+
return Math.floor( ( width + 11 ) / 12 ) * Math.floor( ( height + 11 ) / 12 ) * 16;
|
|
153
|
+
|
|
154
|
+
// https://registry.khronos.org/webgl/extensions/EXT_texture_compression_bptc/
|
|
155
|
+
case RGBA_BPTC_Format:
|
|
156
|
+
case RGB_BPTC_SIGNED_Format:
|
|
157
|
+
case RGB_BPTC_UNSIGNED_Format:
|
|
158
|
+
return Math.ceil( width / 4 ) * Math.ceil( height / 4 ) * 16;
|
|
159
|
+
|
|
160
|
+
// https://registry.khronos.org/webgl/extensions/EXT_texture_compression_rgtc/
|
|
161
|
+
case RED_RGTC1_Format:
|
|
162
|
+
case SIGNED_RED_RGTC1_Format:
|
|
163
|
+
return Math.ceil( width / 4 ) * Math.ceil( height / 4 ) * 8;
|
|
164
|
+
case RED_GREEN_RGTC2_Format:
|
|
165
|
+
case SIGNED_RED_GREEN_RGTC2_Format:
|
|
166
|
+
return Math.ceil( width / 4 ) * Math.ceil( height / 4 ) * 16;
|
|
167
|
+
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
throw new Error(
|
|
171
|
+
`Unable to determine texture byte length for ${format} format.`,
|
|
172
|
+
);
|
|
173
|
+
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function getTextureTypeByteLength( type ) {
|
|
177
|
+
|
|
178
|
+
switch ( type ) {
|
|
179
|
+
|
|
180
|
+
case UnsignedByteType:
|
|
181
|
+
case ByteType:
|
|
182
|
+
return { byteLength: 1, components: 1 };
|
|
183
|
+
case UnsignedShortType:
|
|
184
|
+
case ShortType:
|
|
185
|
+
case HalfFloatType:
|
|
186
|
+
return { byteLength: 2, components: 1 };
|
|
187
|
+
case UnsignedShort4444Type:
|
|
188
|
+
case UnsignedShort5551Type:
|
|
189
|
+
return { byteLength: 2, components: 4 };
|
|
190
|
+
case UnsignedIntType:
|
|
191
|
+
case IntType:
|
|
192
|
+
case FloatType:
|
|
193
|
+
return { byteLength: 4, components: 1 };
|
|
194
|
+
case UnsignedInt5999Type:
|
|
195
|
+
return { byteLength: 4, components: 3 };
|
|
196
|
+
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
throw new Error( `Unknown texture type ${type}.` );
|
|
200
|
+
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
const TextureUtils = {
|
|
204
|
+
contain,
|
|
205
|
+
cover,
|
|
206
|
+
fill,
|
|
207
|
+
getByteLength
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
export { contain, cover, fill, getByteLength, TextureUtils };
|
package/src/lights/Light.js
CHANGED
|
@@ -48,6 +48,7 @@ class Light extends Object3D {
|
|
|
48
48
|
if ( this.penumbra !== undefined ) data.object.penumbra = this.penumbra;
|
|
49
49
|
|
|
50
50
|
if ( this.shadow !== undefined ) data.object.shadow = this.shadow.toJSON();
|
|
51
|
+
if ( this.target !== undefined ) data.object.target = this.target.uuid;
|
|
51
52
|
|
|
52
53
|
return data;
|
|
53
54
|
|
|
@@ -14,6 +14,8 @@ class LightShadow {
|
|
|
14
14
|
|
|
15
15
|
this.camera = camera;
|
|
16
16
|
|
|
17
|
+
this.intensity = 1;
|
|
18
|
+
|
|
17
19
|
this.bias = 0;
|
|
18
20
|
this.normalBias = 0;
|
|
19
21
|
this.radius = 1;
|
|
@@ -111,6 +113,8 @@ class LightShadow {
|
|
|
111
113
|
|
|
112
114
|
this.camera = source.camera.clone();
|
|
113
115
|
|
|
116
|
+
this.intensity = source.intensity;
|
|
117
|
+
|
|
114
118
|
this.bias = source.bias;
|
|
115
119
|
this.radius = source.radius;
|
|
116
120
|
|
|
@@ -130,6 +134,7 @@ class LightShadow {
|
|
|
130
134
|
|
|
131
135
|
const object = {};
|
|
132
136
|
|
|
137
|
+
if ( this.intensity !== 1 ) object.intensity = this.intensity;
|
|
133
138
|
if ( this.bias !== 0 ) object.bias = this.bias;
|
|
134
139
|
if ( this.normalBias !== 0 ) object.normalBias = this.normalBias;
|
|
135
140
|
if ( this.radius !== 1 ) object.radius = this.radius;
|