super-three 0.165.0 → 0.167.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 +706 -383
- package/build/three.module.js +702 -384
- package/build/three.module.min.js +1 -1
- package/build/three.webgpu.js +76086 -0
- package/build/three.webgpu.min.js +6 -0
- package/examples/jsm/Addons.js +2 -1
- package/examples/jsm/csm/CSMShader.js +4 -4
- package/examples/jsm/exporters/GLTFExporter.js +7 -3
- package/examples/jsm/geometries/TeapotGeometry.js +1 -1
- 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/MaterialXLoader.js +2 -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/postprocessing/RenderTransitionPass.js +13 -38
- package/examples/jsm/postprocessing/SSAOPass.js +6 -9
- package/examples/jsm/postprocessing/UnrealBloomPass.js +4 -4
- 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/transpiler/GLSLDecoder.js +46 -4
- package/examples/jsm/transpiler/TSLEncoder.js +17 -15
- package/package.json +7 -6
- package/src/Three.WebGPU.js +194 -0
- package/src/Three.js +2 -0
- package/src/constants.js +4 -1
- package/src/core/Object3D.js +22 -22
- 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/src/materials/Material.js +13 -4
- 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/{examples/jsm → src}/nodes/Nodes.js +30 -12
- package/{examples/jsm → src}/nodes/accessors/BatchNode.js +28 -10
- package/{examples/jsm → src}/nodes/accessors/BufferAttributeNode.js +36 -1
- package/src/nodes/accessors/CameraNode.js +19 -0
- package/{examples/jsm → src}/nodes/accessors/CubeTextureNode.js +22 -5
- package/src/nodes/accessors/InstanceNode.js +140 -0
- package/{examples/jsm → src}/nodes/accessors/MaterialNode.js +22 -2
- package/{examples/jsm → src}/nodes/accessors/ModelNode.js +2 -1
- package/{examples/jsm → src}/nodes/accessors/MorphNode.js +24 -20
- package/{examples/jsm → src}/nodes/accessors/NormalNode.js +1 -1
- package/{examples/jsm → src}/nodes/accessors/Object3DNode.js +1 -1
- package/{examples/jsm → src}/nodes/accessors/ReferenceNode.js +1 -1
- package/{examples/jsm → src}/nodes/accessors/ReflectVectorNode.js +4 -0
- package/{examples/jsm → src}/nodes/accessors/StorageBufferNode.js +50 -1
- package/{examples/jsm → src}/nodes/accessors/StorageTextureNode.js +12 -3
- package/{examples/jsm → src}/nodes/accessors/TextureNode.js +55 -18
- package/{examples/jsm → src}/nodes/accessors/UniformsNode.js +7 -1
- package/{examples/jsm → src}/nodes/accessors/VertexColorNode.js +2 -1
- package/{examples/jsm → src}/nodes/code/ScriptableNode.js +14 -0
- package/{examples/jsm → src}/nodes/code/ScriptableValueNode.js +2 -1
- package/{examples/jsm → src}/nodes/core/AttributeNode.js +20 -6
- package/{examples/jsm → src}/nodes/core/CacheNode.js +7 -10
- package/{examples/jsm → src}/nodes/core/IndexNode.js +6 -0
- package/{examples/jsm → src}/nodes/core/LightingModel.js +2 -2
- package/src/nodes/core/MRTNode.js +76 -0
- package/{examples/jsm → src}/nodes/core/Node.js +18 -12
- package/{examples/jsm → src}/nodes/core/NodeBuilder.js +175 -37
- 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 +6 -1
- package/{examples/jsm → src}/nodes/core/PropertyNode.js +1 -0
- package/{examples/jsm → src}/nodes/core/TempNode.js +2 -2
- package/{examples/jsm → src}/nodes/core/UniformGroupNode.js +20 -0
- package/{examples/jsm → src}/nodes/core/UniformNode.js +10 -1
- package/{examples/jsm → src}/nodes/core/VarNode.js +2 -6
- package/{examples/jsm → src}/nodes/core/VaryingNode.js +8 -0
- package/{examples/jsm → src}/nodes/display/AfterImageNode.js +19 -27
- package/{examples/jsm → src}/nodes/display/AnamorphicNode.js +18 -21
- package/src/nodes/display/BloomNode.js +333 -0
- package/{examples/jsm → src}/nodes/display/ColorAdjustmentNode.js +7 -2
- package/{examples/jsm → src}/nodes/display/ColorSpaceNode.js +1 -1
- package/src/nodes/display/DenoiseNode.js +198 -0
- package/src/nodes/display/DepthOfFieldNode.js +119 -0
- package/src/nodes/display/DotScreenNode.js +75 -0
- package/src/nodes/display/FXAANode.js +327 -0
- package/src/nodes/display/FilmNode.js +52 -0
- package/{examples/jsm → src}/nodes/display/FrontFacingNode.js +2 -1
- package/src/nodes/display/GTAONode.js +324 -0
- package/{examples/jsm → src}/nodes/display/GaussianBlurNode.js +34 -17
- package/src/nodes/display/Lut3DNode.js +53 -0
- package/{examples/jsm → src}/nodes/display/NormalMapNode.js +1 -1
- package/src/nodes/display/PassNode.js +291 -0
- package/src/nodes/display/PixelationPassNode.js +201 -0
- package/src/nodes/display/RGBShiftNode.js +49 -0
- package/src/nodes/display/RenderOutputNode.js +56 -0
- package/src/nodes/display/SobelOperatorNode.js +121 -0
- package/{examples/jsm → src}/nodes/display/ToneMappingNode.js +44 -5
- package/src/nodes/display/TransitionNode.js +76 -0
- package/{examples/jsm → src}/nodes/display/ViewportDepthNode.js +39 -16
- package/{examples/jsm → src}/nodes/display/ViewportDepthTextureNode.js +2 -1
- package/{examples/jsm → src}/nodes/display/ViewportNode.js +2 -1
- package/{examples/jsm → src}/nodes/display/ViewportSharedTextureNode.js +2 -1
- package/{examples/jsm → src}/nodes/display/ViewportTextureNode.js +5 -2
- package/src/nodes/functions/BSDF/LTC.js +131 -0
- package/src/nodes/functions/BasicLightingModel.js +78 -0
- package/{examples/jsm → src}/nodes/functions/PhongLightingModel.js +5 -3
- package/{examples/jsm → src}/nodes/functions/PhysicalLightingModel.js +42 -1
- package/{examples/jsm → src}/nodes/functions/ToonLightingModel.js +3 -1
- package/{examples/jsm → src}/nodes/geometry/RangeNode.js +19 -6
- package/{examples/jsm → src}/nodes/lighting/AONode.js +1 -4
- package/{examples/jsm → src}/nodes/lighting/AmbientLightNode.js +1 -1
- package/src/nodes/lighting/AnalyticLightNode.js +333 -0
- package/src/nodes/lighting/BasicEnvironmentNode.js +26 -0
- package/src/nodes/lighting/BasicLightMapNode.js +29 -0
- package/{examples/jsm → src}/nodes/lighting/DirectionalLightNode.js +2 -3
- package/{examples/jsm → src}/nodes/lighting/EnvironmentNode.js +5 -4
- package/{examples/jsm → src}/nodes/lighting/HemisphereLightNode.js +2 -1
- package/{examples/jsm → src}/nodes/lighting/IESSpotLightNode.js +1 -1
- package/{examples/jsm → src}/nodes/lighting/LightingNode.js +2 -0
- package/{examples/jsm → src}/nodes/lighting/LightsNode.js +1 -3
- package/{examples/jsm → src}/nodes/lighting/PointLightNode.js +2 -3
- package/src/nodes/lighting/RectAreaLightNode.js +97 -0
- package/{examples/jsm → src}/nodes/lighting/SpotLightNode.js +2 -3
- package/{examples/jsm → src}/nodes/loaders/NodeLoader.js +3 -1
- package/{examples/jsm → src}/nodes/loaders/NodeMaterialLoader.js +2 -1
- package/{examples/jsm → src}/nodes/loaders/NodeObjectLoader.js +2 -1
- package/{examples/jsm → src}/nodes/materials/InstancedPointsNodeMaterial.js +3 -3
- package/{examples/jsm → src}/nodes/materials/Line2NodeMaterial.js +3 -3
- package/{examples/jsm → src}/nodes/materials/LineBasicNodeMaterial.js +3 -3
- package/{examples/jsm → src}/nodes/materials/LineDashedNodeMaterial.js +4 -3
- package/src/nodes/materials/MeshBasicNodeMaterial.js +73 -0
- package/{examples/jsm → src}/nodes/materials/MeshLambertNodeMaterial.js +12 -3
- package/{examples/jsm → src}/nodes/materials/MeshMatcapNodeMaterial.js +6 -5
- package/{examples/jsm → src}/nodes/materials/MeshNormalNodeMaterial.js +5 -3
- package/{examples/jsm → src}/nodes/materials/MeshPhongNodeMaterial.js +11 -3
- package/{examples/jsm → src}/nodes/materials/MeshPhysicalNodeMaterial.js +5 -4
- package/{examples/jsm → src}/nodes/materials/MeshStandardNodeMaterial.js +14 -3
- package/{examples/jsm → src}/nodes/materials/MeshToonNodeMaterial.js +3 -3
- package/{examples/jsm → src}/nodes/materials/NodeMaterial.js +85 -20
- package/{examples/jsm → src}/nodes/materials/PointsNodeMaterial.js +3 -3
- package/{examples/jsm → src}/nodes/materials/ShadowNodeMaterial.js +3 -3
- package/{examples/jsm → src}/nodes/materials/SpriteNodeMaterial.js +3 -3
- package/{examples/jsm → src}/nodes/materialx/lib/mx_hsv.js +9 -17
- package/{examples/jsm → src}/nodes/materialx/lib/mx_noise.js +474 -577
- package/{examples/jsm → src}/nodes/materialx/lib/mx_transform_color.js +2 -8
- package/{examples/jsm → src}/nodes/math/CondNode.js +13 -6
- package/{examples/jsm → src}/nodes/math/MathNode.js +14 -1
- package/{examples/jsm → src}/nodes/math/OperatorNode.js +6 -6
- package/{examples/jsm → src}/nodes/parsers/GLSLNodeFunction.js +7 -7
- package/{examples/jsm → src}/nodes/pmrem/PMREMNode.js +2 -1
- package/{examples/jsm → src}/nodes/shadernode/ShaderNode.js +2 -0
- package/{examples/jsm → src}/nodes/utils/DiscardNode.js +1 -0
- package/{examples/jsm → src}/nodes/utils/FunctionOverloadingNode.js +2 -0
- package/{examples/jsm → src}/nodes/utils/LoopNode.js +7 -6
- package/{examples/jsm → src}/nodes/utils/MaxMipLevelNode.js +8 -2
- package/src/nodes/utils/RTTNode.js +130 -0
- package/{examples/jsm → src}/nodes/utils/ReflectorNode.js +9 -1
- package/src/objects/BatchedMesh.js +168 -188
- package/src/objects/InstancedMesh.js +1 -1
- package/src/renderers/WebGLRenderer.js +38 -25
- 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 +9 -3
- package/src/renderers/common/BindGroup.js +16 -0
- package/{examples/jsm → src}/renderers/common/Bindings.js +38 -23
- package/{examples/jsm → src}/renderers/common/ClippingContext.js +4 -2
- package/{examples/jsm → src}/renderers/common/Color4.js +1 -1
- package/{examples/jsm → src}/renderers/common/CubeRenderTarget.js +7 -1
- 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 +87 -0
- package/{examples/jsm/objects → src/renderers/common}/QuadMesh.js +6 -3
- package/{examples/jsm → src}/renderers/common/RenderContext.js +1 -1
- package/{examples/jsm → src}/renderers/common/RenderContexts.js +1 -1
- package/{examples/jsm → src}/renderers/common/RenderObject.js +44 -11
- package/{examples/jsm → src}/renderers/common/Renderer.js +84 -32
- package/{examples/jsm → src}/renderers/common/SampledTexture.js +2 -2
- 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 +6 -2
- 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 +13 -12
- package/src/renderers/common/nodes/NodeBuilderState.js +58 -0
- package/{examples/jsm → src}/renderers/common/nodes/NodeSampledTexture.js +6 -5
- 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 +37 -16
- 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/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 +26 -0
- package/src/renderers/webgl/WebGLPrograms.js +1 -1
- package/src/renderers/webgl/WebGLTextures.js +14 -53
- 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 +156 -54
- package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/nodes/GLSLNodeBuilder.js +178 -43
- 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 +1 -1
- package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/utils/WebGLTextureUtils.js +34 -2
- package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/utils/WebGLUtils.js +1 -1
- package/{examples/jsm → src}/renderers/webgpu/WebGPUBackend.js +164 -76
- package/{examples/jsm → src}/renderers/webgpu/WebGPURenderer.js +2 -2
- package/{examples/jsm → src}/renderers/webgpu/nodes/WGSLNodeBuilder.js +194 -56
- 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 +20 -13
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUConstants.js +3 -1
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUPipelineUtils.js +28 -21
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUTextureUtils.js +40 -23
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUUtils.js +24 -3
- package/src/renderers/webxr/WebXRDepthSensing.js +6 -0
- package/src/renderers/webxr/WebXRManager.js +6 -0
- package/src/textures/CompressedArrayTexture.js +1 -1
- package/examples/jsm/nodes/accessors/CameraNode.js +0 -12
- package/examples/jsm/nodes/accessors/InstanceNode.js +0 -94
- package/examples/jsm/nodes/core/NodeCache.js +0 -26
- package/examples/jsm/nodes/display/PassNode.js +0 -201
- package/examples/jsm/nodes/lighting/AnalyticLightNode.js +0 -256
- package/examples/jsm/nodes/materials/MeshBasicNodeMaterial.js +0 -28
- 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 → src}/nodes/accessors/AccessorsUtils.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/BitangentNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/BufferNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/ClippingNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/InstancedPointsMaterialNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/MaterialReferenceNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/ModelViewProjectionNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/PointUVNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/PositionNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/RendererReferenceNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/SceneNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/SkinningNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/TangentNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/Texture3DNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/TextureBicubicNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/TextureSizeNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/UVNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/UserDataNode.js +0 -0
- /package/{examples/jsm → src}/nodes/code/CodeNode.js +0 -0
- /package/{examples/jsm → src}/nodes/code/ExpressionNode.js +0 -0
- /package/{examples/jsm → src}/nodes/code/FunctionCallNode.js +0 -0
- /package/{examples/jsm → src}/nodes/code/FunctionNode.js +0 -0
- /package/{examples/jsm → src}/nodes/core/AssignNode.js +0 -0
- /package/{examples/jsm → src}/nodes/core/BypassNode.js +0 -0
- /package/{examples/jsm → src}/nodes/core/ConstNode.js +0 -0
- /package/{examples/jsm → src}/nodes/core/ContextNode.js +0 -0
- /package/{examples/jsm → src}/nodes/core/InputNode.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/NodeKeywords.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/OutputStructNode.js +0 -0
- /package/{examples/jsm → src}/nodes/core/ParameterNode.js +0 -0
- /package/{examples/jsm → src}/nodes/core/StackNode.js +0 -0
- /package/{examples/jsm → src}/nodes/core/StructTypeNode.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/display/BlendModeNode.js +0 -0
- /package/{examples/jsm → src}/nodes/display/BumpMapNode.js +0 -0
- /package/{examples/jsm → src}/nodes/display/PosterizeNode.js +0 -0
- /package/{examples/jsm → src}/nodes/fog/FogExp2Node.js +0 -0
- /package/{examples/jsm → src}/nodes/fog/FogNode.js +0 -0
- /package/{examples/jsm → src}/nodes/fog/FogRangeNode.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/BSDF/BRDF_GGX.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/BSDF/BRDF_Lambert.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/BSDF/BRDF_Sheen.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/BSDF/DFGApprox.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/BSDF/D_GGX.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/BSDF/D_GGX_Anisotropic.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/BSDF/EnvironmentBRDF.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/BSDF/F_Schlick.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/BSDF/Schlick_to_F0.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/BSDF/V_GGX_SmithCorrelated.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/ShadowMaskModel.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/material/getGeometryRoughness.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/material/getRoughness.js +0 -0
- /package/{examples/jsm → src}/nodes/gpgpu/ComputeNode.js +0 -0
- /package/{examples/jsm → src}/nodes/lighting/IrradianceNode.js +0 -0
- /package/{examples/jsm → src}/nodes/lighting/LightNode.js +0 -0
- /package/{examples/jsm → src}/nodes/lighting/LightUtils.js +0 -0
- /package/{examples/jsm → src}/nodes/lighting/LightingContextNode.js +0 -0
- /package/{examples/jsm → src}/nodes/materials/Materials.js +0 -0
- /package/{examples/jsm → src}/nodes/materials/MeshSSSNodeMaterial.js +0 -0
- /package/{examples/jsm → src}/nodes/materials/VolumeNodeMaterial.js +0 -0
- /package/{examples/jsm → src}/nodes/materialx/DISCLAIMER.md +0 -0
- /package/{examples/jsm → src}/nodes/materialx/MaterialXNodes.js +0 -0
- /package/{examples/jsm → src}/nodes/math/HashNode.js +0 -0
- /package/{examples/jsm → src}/nodes/math/MathUtils.js +0 -0
- /package/{examples/jsm → src}/nodes/math/TriNoise3D.js +0 -0
- /package/{examples/jsm → src}/nodes/parsers/GLSLNodeParser.js +0 -0
- /package/{examples/jsm → src}/nodes/pmrem/PMREMUtils.js +0 -0
- /package/{examples/jsm → src}/nodes/procedural/CheckerNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/ArrayElementNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/ConvertNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/EquirectUVNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/JoinNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/MatcapUVNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/OscNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/PackingNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/RemapNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/RotateNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/RotateUVNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/SetNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/SplitNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/SpriteSheetUVNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/StorageArrayElementNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/TimerNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/TriplanarTexturesNode.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/RenderList.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
- /package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUTexturePassUtils.js +0 -0
|
@@ -0,0 +1,194 @@
|
|
|
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 { Material } from './materials/Material.js';
|
|
44
|
+
export { AnimationLoader } from './loaders/AnimationLoader.js';
|
|
45
|
+
export { CompressedTextureLoader } from './loaders/CompressedTextureLoader.js';
|
|
46
|
+
export { CubeTextureLoader } from './loaders/CubeTextureLoader.js';
|
|
47
|
+
export { DataTextureLoader } from './loaders/DataTextureLoader.js';
|
|
48
|
+
export { TextureLoader } from './loaders/TextureLoader.js';
|
|
49
|
+
export { ObjectLoader } from './loaders/ObjectLoader.js';
|
|
50
|
+
export { MaterialLoader } from './loaders/MaterialLoader.js';
|
|
51
|
+
export { BufferGeometryLoader } from './loaders/BufferGeometryLoader.js';
|
|
52
|
+
export { DefaultLoadingManager, LoadingManager } from './loaders/LoadingManager.js';
|
|
53
|
+
export { ImageLoader } from './loaders/ImageLoader.js';
|
|
54
|
+
export { ImageBitmapLoader } from './loaders/ImageBitmapLoader.js';
|
|
55
|
+
export { FileLoader } from './loaders/FileLoader.js';
|
|
56
|
+
export { Loader } from './loaders/Loader.js';
|
|
57
|
+
export { LoaderUtils } from './loaders/LoaderUtils.js';
|
|
58
|
+
export { Cache } from './loaders/Cache.js';
|
|
59
|
+
export { AudioLoader } from './loaders/AudioLoader.js';
|
|
60
|
+
export { SpotLight } from './lights/SpotLight.js';
|
|
61
|
+
export { PointLight } from './lights/PointLight.js';
|
|
62
|
+
export { RectAreaLight } from './lights/RectAreaLight.js';
|
|
63
|
+
export { HemisphereLight } from './lights/HemisphereLight.js';
|
|
64
|
+
export { DirectionalLight } from './lights/DirectionalLight.js';
|
|
65
|
+
export { AmbientLight } from './lights/AmbientLight.js';
|
|
66
|
+
export { Light } from './lights/Light.js';
|
|
67
|
+
export { LightProbe } from './lights/LightProbe.js';
|
|
68
|
+
export { StereoCamera } from './cameras/StereoCamera.js';
|
|
69
|
+
export { PerspectiveCamera } from './cameras/PerspectiveCamera.js';
|
|
70
|
+
export { OrthographicCamera } from './cameras/OrthographicCamera.js';
|
|
71
|
+
export { CubeCamera } from './cameras/CubeCamera.js';
|
|
72
|
+
export { ArrayCamera } from './cameras/ArrayCamera.js';
|
|
73
|
+
export { Camera } from './cameras/Camera.js';
|
|
74
|
+
export { AudioListener } from './audio/AudioListener.js';
|
|
75
|
+
export { PositionalAudio } from './audio/PositionalAudio.js';
|
|
76
|
+
export { AudioContext } from './audio/AudioContext.js';
|
|
77
|
+
export { AudioAnalyser } from './audio/AudioAnalyser.js';
|
|
78
|
+
export { Audio } from './audio/Audio.js';
|
|
79
|
+
export { VectorKeyframeTrack } from './animation/tracks/VectorKeyframeTrack.js';
|
|
80
|
+
export { StringKeyframeTrack } from './animation/tracks/StringKeyframeTrack.js';
|
|
81
|
+
export { QuaternionKeyframeTrack } from './animation/tracks/QuaternionKeyframeTrack.js';
|
|
82
|
+
export { NumberKeyframeTrack } from './animation/tracks/NumberKeyframeTrack.js';
|
|
83
|
+
export { ColorKeyframeTrack } from './animation/tracks/ColorKeyframeTrack.js';
|
|
84
|
+
export { BooleanKeyframeTrack } from './animation/tracks/BooleanKeyframeTrack.js';
|
|
85
|
+
export { PropertyMixer } from './animation/PropertyMixer.js';
|
|
86
|
+
export { PropertyBinding } from './animation/PropertyBinding.js';
|
|
87
|
+
export { KeyframeTrack } from './animation/KeyframeTrack.js';
|
|
88
|
+
export { AnimationUtils } from './animation/AnimationUtils.js';
|
|
89
|
+
export { AnimationObjectGroup } from './animation/AnimationObjectGroup.js';
|
|
90
|
+
export { AnimationMixer } from './animation/AnimationMixer.js';
|
|
91
|
+
export { AnimationClip } from './animation/AnimationClip.js';
|
|
92
|
+
export { AnimationAction } from './animation/AnimationAction.js';
|
|
93
|
+
export { RenderTarget } from './core/RenderTarget.js';
|
|
94
|
+
export { Uniform } from './core/Uniform.js';
|
|
95
|
+
export { UniformsGroup } from './core/UniformsGroup.js';
|
|
96
|
+
export { InstancedBufferGeometry } from './core/InstancedBufferGeometry.js';
|
|
97
|
+
export { BufferGeometry } from './core/BufferGeometry.js';
|
|
98
|
+
export { InterleavedBufferAttribute } from './core/InterleavedBufferAttribute.js';
|
|
99
|
+
export { InstancedInterleavedBuffer } from './core/InstancedInterleavedBuffer.js';
|
|
100
|
+
export { InterleavedBuffer } from './core/InterleavedBuffer.js';
|
|
101
|
+
export { InstancedBufferAttribute } from './core/InstancedBufferAttribute.js';
|
|
102
|
+
export { GLBufferAttribute } from './core/GLBufferAttribute.js';
|
|
103
|
+
export * from './core/BufferAttribute.js';
|
|
104
|
+
export { Object3D } from './core/Object3D.js';
|
|
105
|
+
export { Raycaster } from './core/Raycaster.js';
|
|
106
|
+
export { Layers } from './core/Layers.js';
|
|
107
|
+
export { EventDispatcher } from './core/EventDispatcher.js';
|
|
108
|
+
export { Clock } from './core/Clock.js';
|
|
109
|
+
export { QuaternionLinearInterpolant } from './math/interpolants/QuaternionLinearInterpolant.js';
|
|
110
|
+
export { LinearInterpolant } from './math/interpolants/LinearInterpolant.js';
|
|
111
|
+
export { DiscreteInterpolant } from './math/interpolants/DiscreteInterpolant.js';
|
|
112
|
+
export { CubicInterpolant } from './math/interpolants/CubicInterpolant.js';
|
|
113
|
+
export { Interpolant } from './math/Interpolant.js';
|
|
114
|
+
export { Triangle } from './math/Triangle.js';
|
|
115
|
+
export { MathUtils } from './math/MathUtils.js';
|
|
116
|
+
export { Spherical } from './math/Spherical.js';
|
|
117
|
+
export { Cylindrical } from './math/Cylindrical.js';
|
|
118
|
+
export { Plane } from './math/Plane.js';
|
|
119
|
+
export { Frustum } from './math/Frustum.js';
|
|
120
|
+
export { Sphere } from './math/Sphere.js';
|
|
121
|
+
export { Ray } from './math/Ray.js';
|
|
122
|
+
export { Matrix4 } from './math/Matrix4.js';
|
|
123
|
+
export { Matrix3 } from './math/Matrix3.js';
|
|
124
|
+
export { Matrix2 } from './math/Matrix2.js';
|
|
125
|
+
export { Box3 } from './math/Box3.js';
|
|
126
|
+
export { Box2 } from './math/Box2.js';
|
|
127
|
+
export { Line3 } from './math/Line3.js';
|
|
128
|
+
export { Euler } from './math/Euler.js';
|
|
129
|
+
export { Vector4 } from './math/Vector4.js';
|
|
130
|
+
export { Vector3 } from './math/Vector3.js';
|
|
131
|
+
export { Vector2 } from './math/Vector2.js';
|
|
132
|
+
export { Quaternion } from './math/Quaternion.js';
|
|
133
|
+
export { Color } from './math/Color.js';
|
|
134
|
+
export { ColorManagement } from './math/ColorManagement.js';
|
|
135
|
+
export { SphericalHarmonics3 } from './math/SphericalHarmonics3.js';
|
|
136
|
+
export { SpotLightHelper } from './helpers/SpotLightHelper.js';
|
|
137
|
+
export { SkeletonHelper } from './helpers/SkeletonHelper.js';
|
|
138
|
+
export { PointLightHelper } from './helpers/PointLightHelper.js';
|
|
139
|
+
export { HemisphereLightHelper } from './helpers/HemisphereLightHelper.js';
|
|
140
|
+
export { GridHelper } from './helpers/GridHelper.js';
|
|
141
|
+
export { PolarGridHelper } from './helpers/PolarGridHelper.js';
|
|
142
|
+
export { DirectionalLightHelper } from './helpers/DirectionalLightHelper.js';
|
|
143
|
+
export { CameraHelper } from './helpers/CameraHelper.js';
|
|
144
|
+
export { BoxHelper } from './helpers/BoxHelper.js';
|
|
145
|
+
export { Box3Helper } from './helpers/Box3Helper.js';
|
|
146
|
+
export { PlaneHelper } from './helpers/PlaneHelper.js';
|
|
147
|
+
export { ArrowHelper } from './helpers/ArrowHelper.js';
|
|
148
|
+
export { AxesHelper } from './helpers/AxesHelper.js';
|
|
149
|
+
export * from './extras/curves/Curves.js';
|
|
150
|
+
export { Shape } from './extras/core/Shape.js';
|
|
151
|
+
export { Path } from './extras/core/Path.js';
|
|
152
|
+
export { ShapePath } from './extras/core/ShapePath.js';
|
|
153
|
+
export { CurvePath } from './extras/core/CurvePath.js';
|
|
154
|
+
export { Curve } from './extras/core/Curve.js';
|
|
155
|
+
export { DataUtils } from './extras/DataUtils.js';
|
|
156
|
+
export { ImageUtils } from './extras/ImageUtils.js';
|
|
157
|
+
export { ShapeUtils } from './extras/ShapeUtils.js';
|
|
158
|
+
//export { PMREMGenerator } from './extras/PMREMGenerator.js';
|
|
159
|
+
//export { WebGLUtils } from './renderers/webgl/WebGLUtils.js';
|
|
160
|
+
export { createCanvasElement } from './utils.js';
|
|
161
|
+
export * from './constants.js';
|
|
162
|
+
export * from './Three.Legacy.js';
|
|
163
|
+
|
|
164
|
+
export { default as WebGPURenderer } from './renderers/webgpu/WebGPURenderer.js';
|
|
165
|
+
export { default as QuadMesh } from './renderers/common/QuadMesh.js';
|
|
166
|
+
export { default as PMREMGenerator } from './renderers/common/extras/PMREMGenerator.js';
|
|
167
|
+
export { default as PostProcessing } from './renderers/common/PostProcessing.js';
|
|
168
|
+
export { default as StorageTexture } from './renderers/common/StorageTexture.js';
|
|
169
|
+
export { default as StorageBufferAttribute } from './renderers/common/StorageBufferAttribute.js';
|
|
170
|
+
export { default as StorageInstancedBufferAttribute } from './renderers/common/StorageInstancedBufferAttribute.js';
|
|
171
|
+
export { default as IESSpotLight } from './lights/webgpu/IESSpotLight.js';
|
|
172
|
+
export * from './nodes/Nodes.js';
|
|
173
|
+
|
|
174
|
+
if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {
|
|
175
|
+
|
|
176
|
+
__THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'register', { detail: {
|
|
177
|
+
revision: REVISION,
|
|
178
|
+
} } ) );
|
|
179
|
+
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
if ( typeof window !== 'undefined' ) {
|
|
183
|
+
|
|
184
|
+
if ( window.__THREE__ ) {
|
|
185
|
+
|
|
186
|
+
console.warn( 'WARNING: Multiple instances of Three.js being imported.' );
|
|
187
|
+
|
|
188
|
+
} else {
|
|
189
|
+
|
|
190
|
+
window.__THREE__ = REVISION;
|
|
191
|
+
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
}
|
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';
|
|
@@ -153,6 +154,7 @@ export { Curve } from './extras/core/Curve.js';
|
|
|
153
154
|
export { DataUtils } from './extras/DataUtils.js';
|
|
154
155
|
export { ImageUtils } from './extras/ImageUtils.js';
|
|
155
156
|
export { ShapeUtils } from './extras/ShapeUtils.js';
|
|
157
|
+
export { TextureUtils } from './extras/TextureUtils.js';
|
|
156
158
|
export { PMREMGenerator } from './extras/PMREMGenerator.js';
|
|
157
159
|
export { WebGLUtils } from './renderers/webgl/WebGLUtils.js';
|
|
158
160
|
export { createCanvasElement } from './utils.js';
|
package/src/constants.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const REVISION = '
|
|
1
|
+
export const REVISION = '167';
|
|
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,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;
|
|
@@ -164,6 +164,7 @@ class ObjectLoader extends Loader {
|
|
|
164
164
|
const skeletons = this.parseSkeletons( json.skeletons, object );
|
|
165
165
|
|
|
166
166
|
this.bindSkeletons( object, skeletons );
|
|
167
|
+
this.bindLightTargets( object );
|
|
167
168
|
|
|
168
169
|
//
|
|
169
170
|
|
|
@@ -205,6 +206,7 @@ class ObjectLoader extends Loader {
|
|
|
205
206
|
const skeletons = this.parseSkeletons( json.skeletons, object );
|
|
206
207
|
|
|
207
208
|
this.bindSkeletons( object, skeletons );
|
|
209
|
+
this.bindLightTargets( object );
|
|
208
210
|
|
|
209
211
|
return object;
|
|
210
212
|
|
|
@@ -849,6 +851,7 @@ class ObjectLoader extends Loader {
|
|
|
849
851
|
case 'DirectionalLight':
|
|
850
852
|
|
|
851
853
|
object = new DirectionalLight( data.color, data.intensity );
|
|
854
|
+
object.target = data.target || '';
|
|
852
855
|
|
|
853
856
|
break;
|
|
854
857
|
|
|
@@ -867,6 +870,7 @@ class ObjectLoader extends Loader {
|
|
|
867
870
|
case 'SpotLight':
|
|
868
871
|
|
|
869
872
|
object = new SpotLight( data.color, data.intensity, data.distance, data.angle, data.penumbra, data.decay );
|
|
873
|
+
object.target = data.target || '';
|
|
870
874
|
|
|
871
875
|
break;
|
|
872
876
|
|
|
@@ -923,7 +927,7 @@ class ObjectLoader extends Loader {
|
|
|
923
927
|
geometry = getGeometry( data.geometry );
|
|
924
928
|
material = getMaterial( data.material );
|
|
925
929
|
|
|
926
|
-
object = new BatchedMesh( data.
|
|
930
|
+
object = new BatchedMesh( data.maxInstanceCount, data.maxVertexCount, data.maxIndexCount, material );
|
|
927
931
|
object.geometry = geometry;
|
|
928
932
|
object.perObjectFrustumCulled = data.perObjectFrustumCulled;
|
|
929
933
|
object.sortObjects = data.sortObjects;
|
|
@@ -953,7 +957,7 @@ class ObjectLoader extends Loader {
|
|
|
953
957
|
|
|
954
958
|
} );
|
|
955
959
|
|
|
956
|
-
object.
|
|
960
|
+
object._maxInstanceCount = data.maxInstanceCount;
|
|
957
961
|
object._maxVertexCount = data.maxVertexCount;
|
|
958
962
|
object._maxIndexCount = data.maxIndexCount;
|
|
959
963
|
|
|
@@ -1047,6 +1051,7 @@ class ObjectLoader extends Loader {
|
|
|
1047
1051
|
|
|
1048
1052
|
if ( data.shadow ) {
|
|
1049
1053
|
|
|
1054
|
+
if ( data.shadow.intensity !== undefined ) object.shadow.intensity = data.shadow.intensity;
|
|
1050
1055
|
if ( data.shadow.bias !== undefined ) object.shadow.bias = data.shadow.bias;
|
|
1051
1056
|
if ( data.shadow.normalBias !== undefined ) object.shadow.normalBias = data.shadow.normalBias;
|
|
1052
1057
|
if ( data.shadow.radius !== undefined ) object.shadow.radius = data.shadow.radius;
|
|
@@ -1138,6 +1143,32 @@ class ObjectLoader extends Loader {
|
|
|
1138
1143
|
|
|
1139
1144
|
}
|
|
1140
1145
|
|
|
1146
|
+
bindLightTargets( object ) {
|
|
1147
|
+
|
|
1148
|
+
object.traverse( function ( child ) {
|
|
1149
|
+
|
|
1150
|
+
if ( child.isDirectionalLight || child.isSpotLight ) {
|
|
1151
|
+
|
|
1152
|
+
const uuid = child.target;
|
|
1153
|
+
|
|
1154
|
+
const target = object.getObjectByProperty( 'uuid', uuid );
|
|
1155
|
+
|
|
1156
|
+
if ( target !== undefined ) {
|
|
1157
|
+
|
|
1158
|
+
child.target = target;
|
|
1159
|
+
|
|
1160
|
+
} else {
|
|
1161
|
+
|
|
1162
|
+
child.target = new Object3D();
|
|
1163
|
+
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
} );
|
|
1169
|
+
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1141
1172
|
}
|
|
1142
1173
|
|
|
1143
1174
|
const TEXTURE_MAPPING = {
|