three-stdlib 2.22.10 → 2.23.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/_polyfill/CompressedArrayTexture.cjs +12 -0
- package/dist/_polyfill/CompressedArrayTexture.js +6 -6
- package/dist/_polyfill/Data3DTexture.cjs +17 -0
- package/dist/_polyfill/Data3DTexture.js +8 -8
- package/dist/animation/{AnimationClipCreator.mjs → AnimationClipCreator.cjs} +18 -18
- package/dist/animation/AnimationClipCreator.js +18 -18
- package/dist/animation/{CCDIKSolver.mjs → CCDIKSolver.cjs} +32 -32
- package/dist/animation/CCDIKSolver.js +32 -32
- package/dist/animation/{MMDAnimationHelper.mjs → MMDAnimationHelper.cjs} +17 -17
- package/dist/animation/MMDAnimationHelper.js +17 -17
- package/dist/animation/{MMDPhysics.mjs → MMDPhysics.cjs} +25 -25
- package/dist/animation/MMDPhysics.js +25 -25
- package/dist/cameras/{CinematicCamera.mjs → CinematicCamera.cjs} +17 -17
- package/dist/cameras/CinematicCamera.js +17 -17
- package/dist/controls/{ArcballControls.mjs → ArcballControls.cjs} +102 -102
- package/dist/controls/ArcballControls.js +102 -102
- package/dist/controls/{DeviceOrientationControls.mjs → DeviceOrientationControls.cjs} +14 -14
- package/dist/controls/DeviceOrientationControls.js +14 -14
- package/dist/controls/{DragControls.mjs → DragControls.cjs} +12 -12
- package/dist/controls/DragControls.js +12 -12
- package/dist/controls/{FirstPersonControls.mjs → FirstPersonControls.cjs} +16 -16
- package/dist/controls/FirstPersonControls.js +16 -16
- package/dist/controls/{FlyControls.mjs → FlyControls.cjs} +10 -10
- package/dist/controls/FlyControls.js +10 -10
- package/dist/controls/{OrbitControls.mjs → OrbitControls.cjs} +52 -54
- package/dist/controls/OrbitControls.d.ts +4 -4
- package/dist/controls/OrbitControls.js +52 -54
- package/dist/controls/{PointerLockControls.mjs → PointerLockControls.cjs} +8 -8
- package/dist/controls/PointerLockControls.js +8 -8
- package/dist/controls/{TrackballControls.mjs → TrackballControls.cjs} +32 -32
- package/dist/controls/TrackballControls.d.ts +2 -2
- package/dist/controls/TrackballControls.js +32 -32
- package/dist/controls/{TransformControls.mjs → TransformControls.cjs} +169 -169
- package/dist/controls/TransformControls.js +169 -169
- package/dist/controls/experimental/{CameraControls.mjs → CameraControls.cjs} +59 -59
- package/dist/controls/experimental/CameraControls.js +59 -59
- package/dist/csm/{CSM.mjs → CSM.cjs} +17 -17
- package/dist/csm/CSM.js +17 -17
- package/dist/csm/{CSMFrustum.mjs → CSMFrustum.cjs} +7 -7
- package/dist/csm/CSMFrustum.js +7 -7
- package/dist/csm/{CSMHelper.mjs → CSMHelper.cjs} +14 -14
- package/dist/csm/CSMHelper.js +14 -14
- package/dist/csm/{CSMShader.mjs → CSMShader.cjs} +5 -5
- package/dist/csm/CSMShader.js +5 -5
- package/dist/curves/{CurveExtras.mjs → CurveExtras.cjs} +45 -45
- package/dist/curves/CurveExtras.js +45 -45
- package/dist/curves/{NURBSCurve.mjs → NURBSCurve.cjs} +11 -11
- package/dist/curves/NURBSCurve.js +11 -11
- package/dist/curves/{NURBSSurface.mjs → NURBSSurface.cjs} +7 -7
- package/dist/curves/NURBSSurface.js +7 -7
- package/dist/curves/{NURBSUtils.mjs → NURBSUtils.cjs} +17 -17
- package/dist/curves/NURBSUtils.js +17 -17
- package/dist/deprecated/{Geometry.mjs → Geometry.cjs} +51 -51
- package/dist/deprecated/Geometry.js +51 -51
- package/dist/effects/{AnaglyphEffect.mjs → AnaglyphEffect.cjs} +14 -14
- package/dist/effects/AnaglyphEffect.js +14 -14
- package/dist/effects/{AsciiEffect.mjs → AsciiEffect.cjs} +3 -3
- package/dist/effects/AsciiEffect.js +3 -3
- package/dist/effects/{OutlineEffect.mjs → OutlineEffect.cjs} +8 -8
- package/dist/effects/OutlineEffect.js +8 -8
- package/dist/effects/{ParallaxBarrierEffect.mjs → ParallaxBarrierEffect.cjs} +12 -12
- package/dist/effects/ParallaxBarrierEffect.js +12 -12
- package/dist/effects/{PeppersGhostEffect.mjs → PeppersGhostEffect.cjs} +11 -11
- package/dist/effects/PeppersGhostEffect.js +11 -11
- package/dist/effects/{StereoEffect.mjs → StereoEffect.cjs} +6 -6
- package/dist/effects/StereoEffect.js +6 -6
- package/dist/environments/RoomEnvironment.cjs +95 -0
- package/dist/environments/RoomEnvironment.js +23 -40
- package/dist/exporters/{ColladaExporter.mjs → ColladaExporter.cjs} +16 -16
- package/dist/exporters/ColladaExporter.js +16 -16
- package/dist/exporters/{DRACOExporter.mjs → DRACOExporter.cjs} +8 -8
- package/dist/exporters/DRACOExporter.js +8 -8
- package/dist/exporters/{GLTFExporter.mjs → GLTFExporter.cjs} +52 -49
- package/dist/exporters/GLTFExporter.js +52 -49
- package/dist/exporters/{MMDExporter.mjs → MMDExporter.cjs} +10 -10
- package/dist/exporters/MMDExporter.js +10 -10
- package/dist/exporters/{OBJExporter.mjs → OBJExporter.cjs} +13 -13
- package/dist/exporters/OBJExporter.js +13 -13
- package/dist/exporters/{PLYExporter.mjs → PLYExporter.cjs} +8 -8
- package/dist/exporters/PLYExporter.js +8 -8
- package/dist/exporters/{STLExporter.mjs → STLExporter.cjs} +12 -12
- package/dist/exporters/STLExporter.js +12 -12
- package/dist/exporters/{USDZExporter.mjs → USDZExporter.cjs} +10 -10
- package/dist/exporters/USDZExporter.js +10 -10
- package/dist/geometries/{BoxLineGeometry.mjs → BoxLineGeometry.cjs} +6 -6
- package/dist/geometries/BoxLineGeometry.js +6 -6
- package/dist/geometries/ConvexGeometry.cjs +26 -0
- package/dist/geometries/ConvexGeometry.js +9 -9
- package/dist/geometries/{DecalGeometry.mjs → DecalGeometry.cjs} +16 -16
- package/dist/geometries/DecalGeometry.js +16 -16
- package/dist/geometries/{LightningStrike.mjs → LightningStrike.cjs} +45 -45
- package/dist/geometries/LightningStrike.js +45 -45
- package/dist/geometries/{ParametricGeometries.mjs → ParametricGeometries.cjs} +11 -11
- package/dist/geometries/ParametricGeometries.js +11 -11
- package/dist/geometries/{ParametricGeometry.mjs → ParametricGeometry.cjs} +11 -11
- package/dist/geometries/ParametricGeometry.js +11 -11
- package/dist/geometries/{RoundedBoxGeometry.mjs → RoundedBoxGeometry.cjs} +10 -10
- package/dist/geometries/RoundedBoxGeometry.js +10 -10
- package/dist/geometries/{TeapotGeometry.mjs → TeapotGeometry.cjs} +21 -21
- package/dist/geometries/TeapotGeometry.js +21 -21
- package/dist/geometries/{TextGeometry.mjs → TextGeometry.cjs} +6 -6
- package/dist/geometries/TextGeometry.js +6 -6
- package/dist/helpers/{LightProbeHelper.mjs → LightProbeHelper.cjs} +7 -7
- package/dist/helpers/LightProbeHelper.js +7 -7
- package/dist/helpers/{PositionalAudioHelper.mjs → PositionalAudioHelper.cjs} +11 -11
- package/dist/helpers/PositionalAudioHelper.js +11 -11
- package/dist/helpers/{RectAreaLightHelper.mjs → RectAreaLightHelper.cjs} +11 -11
- package/dist/helpers/RectAreaLightHelper.js +11 -11
- package/dist/helpers/{VertexNormalsHelper.mjs → VertexNormalsHelper.cjs} +11 -11
- package/dist/helpers/VertexNormalsHelper.js +11 -11
- package/dist/helpers/{VertexTangentsHelper.mjs → VertexTangentsHelper.cjs} +10 -10
- package/dist/helpers/VertexTangentsHelper.js +10 -10
- package/dist/index.cjs +613 -0
- package/dist/index.js +613 -613
- package/dist/interactive/{HTMLMesh.mjs → HTMLMesh.cjs} +11 -11
- package/dist/interactive/HTMLMesh.js +11 -11
- package/dist/interactive/{InteractiveGroup.mjs → InteractiveGroup.cjs} +8 -8
- package/dist/interactive/InteractiveGroup.js +8 -8
- package/dist/interactive/{SelectionBox.mjs → SelectionBox.cjs} +21 -21
- package/dist/interactive/SelectionBox.js +21 -21
- package/dist/interactive/{SelectionHelper.mjs → SelectionHelper.cjs} +7 -7
- package/dist/interactive/SelectionHelper.js +7 -7
- package/dist/libs/{MeshoptDecoder.mjs → MeshoptDecoder.cjs} +3 -3
- package/dist/libs/MeshoptDecoder.js +3 -3
- package/dist/libs/{MotionControllers.mjs → MotionControllers.cjs} +6 -6
- package/dist/libs/MotionControllers.js +6 -6
- package/dist/lights/{LightProbeGenerator.mjs → LightProbeGenerator.cjs} +16 -16
- package/dist/lights/LightProbeGenerator.js +16 -16
- package/dist/lights/{RectAreaLightUniformsLib.mjs → RectAreaLightUniformsLib.cjs} +42 -42
- package/dist/lights/RectAreaLightUniformsLib.js +42 -42
- package/dist/lines/Line2.cjs +13 -0
- package/dist/lines/Line2.js +8 -8
- package/dist/lines/{LineGeometry.mjs → LineGeometry.cjs} +5 -5
- package/dist/lines/LineGeometry.js +5 -5
- package/dist/lines/{LineMaterial.mjs → LineMaterial.cjs} +10 -10
- package/dist/lines/LineMaterial.js +10 -10
- package/dist/lines/{LineSegments2.mjs → LineSegments2.cjs} +28 -28
- package/dist/lines/LineSegments2.js +28 -28
- package/dist/lines/{LineSegmentsGeometry.mjs → LineSegmentsGeometry.cjs} +18 -18
- package/dist/lines/LineSegmentsGeometry.js +18 -18
- package/dist/lines/Wireframe.cjs +32 -0
- package/dist/lines/Wireframe.js +13 -13
- package/dist/lines/WireframeGeometry2.cjs +13 -0
- package/dist/lines/WireframeGeometry2.js +7 -7
- package/dist/loaders/{3DMLoader.mjs → 3DMLoader.cjs} +37 -37
- package/dist/loaders/3DMLoader.js +37 -37
- package/dist/loaders/{3MFLoader.mjs → 3MFLoader.cjs} +53 -53
- package/dist/loaders/3MFLoader.js +53 -53
- package/dist/loaders/{AMFLoader.mjs → AMFLoader.cjs} +19 -19
- package/dist/loaders/AMFLoader.js +19 -19
- package/dist/loaders/{AssimpLoader.mjs → AssimpLoader.cjs} +41 -41
- package/dist/loaders/AssimpLoader.js +41 -41
- package/dist/loaders/{BVHLoader.mjs → BVHLoader.cjs} +18 -18
- package/dist/loaders/BVHLoader.js +18 -18
- package/dist/loaders/{BasisTextureLoader.mjs → BasisTextureLoader.cjs} +22 -22
- package/dist/loaders/BasisTextureLoader.js +22 -22
- package/dist/loaders/{ColladaLoader.mjs → ColladaLoader.cjs} +76 -76
- package/dist/loaders/ColladaLoader.js +76 -76
- package/dist/loaders/{DDSLoader.mjs → DDSLoader.cjs} +10 -10
- package/dist/loaders/DDSLoader.js +10 -10
- package/dist/loaders/{DRACOLoader.mjs → DRACOLoader.cjs} +12 -12
- package/dist/loaders/DRACOLoader.js +12 -12
- package/dist/loaders/{EXRLoader.mjs → EXRLoader.cjs} +23 -23
- package/dist/loaders/EXRLoader.js +23 -23
- package/dist/loaders/{FBXLoader.mjs → FBXLoader.cjs} +116 -116
- package/dist/loaders/FBXLoader.js +116 -116
- package/dist/loaders/{FontLoader.mjs → FontLoader.cjs} +9 -9
- package/dist/loaders/FontLoader.js +9 -9
- package/dist/loaders/{GCodeLoader.mjs → GCodeLoader.cjs} +13 -13
- package/dist/loaders/GCodeLoader.js +13 -13
- package/dist/loaders/{GLTFLoader.mjs → GLTFLoader.cjs} +112 -112
- package/dist/loaders/GLTFLoader.js +112 -112
- package/dist/loaders/{HDRCubeTextureLoader.mjs → HDRCubeTextureLoader.cjs} +15 -15
- package/dist/loaders/HDRCubeTextureLoader.js +15 -15
- package/dist/loaders/{KMZLoader.mjs → KMZLoader.cjs} +13 -13
- package/dist/loaders/KMZLoader.js +13 -13
- package/dist/loaders/{KTX2Loader.mjs → KTX2Loader.cjs} +65 -65
- package/dist/loaders/KTX2Loader.js +65 -65
- package/dist/loaders/{KTXLoader.mjs → KTXLoader.cjs} +5 -5
- package/dist/loaders/KTXLoader.js +5 -5
- package/dist/loaders/{LDrawLoader.mjs → LDrawLoader.cjs} +39 -39
- package/dist/loaders/LDrawLoader.js +39 -39
- package/dist/loaders/{LUT3dlLoader.mjs → LUT3dlLoader.cjs} +22 -22
- package/dist/loaders/LUT3dlLoader.js +22 -22
- package/dist/loaders/{LUTCubeLoader.mjs → LUTCubeLoader.cjs} +22 -22
- package/dist/loaders/LUTCubeLoader.js +22 -22
- package/dist/loaders/{LWOLoader.mjs → LWOLoader.cjs} +42 -42
- package/dist/loaders/LWOLoader.js +42 -42
- package/dist/loaders/{LottieLoader.mjs → LottieLoader.cjs} +8 -8
- package/dist/loaders/LottieLoader.js +8 -8
- package/dist/loaders/{MD2Loader.mjs → MD2Loader.cjs} +15 -15
- package/dist/loaders/MD2Loader.js +15 -15
- package/dist/loaders/{MDDLoader.mjs → MDDLoader.cjs} +9 -9
- package/dist/loaders/MDDLoader.js +9 -9
- package/dist/loaders/{MMDLoader.mjs → MMDLoader.cjs} +59 -59
- package/dist/loaders/MMDLoader.js +59 -59
- package/dist/loaders/{MTLLoader.mjs → MTLLoader.cjs} +17 -17
- package/dist/loaders/MTLLoader.js +17 -17
- package/dist/loaders/{NRRDLoader.mjs → NRRDLoader.cjs} +17 -17
- package/dist/loaders/NRRDLoader.js +17 -17
- package/dist/loaders/{OBJLoader.mjs → OBJLoader.cjs} +37 -37
- package/dist/loaders/OBJLoader.js +37 -37
- package/dist/loaders/{PCDLoader.mjs → PCDLoader.cjs} +13 -13
- package/dist/loaders/PCDLoader.js +13 -13
- package/dist/loaders/{PDBLoader.mjs → PDBLoader.cjs} +11 -11
- package/dist/loaders/PDBLoader.js +11 -11
- package/dist/loaders/{PLYLoader.mjs → PLYLoader.cjs} +13 -13
- package/dist/loaders/PLYLoader.js +13 -13
- package/dist/loaders/{PRWMLoader.mjs → PRWMLoader.cjs} +9 -9
- package/dist/loaders/PRWMLoader.js +9 -9
- package/dist/loaders/{PVRLoader.mjs → PVRLoader.cjs} +11 -11
- package/dist/loaders/PVRLoader.js +11 -11
- package/dist/loaders/{RGBELoader.mjs → RGBELoader.cjs} +18 -18
- package/dist/loaders/RGBELoader.js +18 -18
- package/dist/loaders/{RGBMLoader.mjs → RGBMLoader.cjs} +16 -16
- package/dist/loaders/RGBMLoader.js +16 -16
- package/dist/loaders/{STLLoader.mjs → STLLoader.cjs} +15 -15
- package/dist/loaders/STLLoader.js +15 -15
- package/dist/loaders/{SVGLoader.mjs → SVGLoader.cjs} +55 -55
- package/dist/loaders/SVGLoader.js +55 -55
- package/dist/loaders/{TDSLoader.mjs → TDSLoader.cjs} +20 -20
- package/dist/loaders/TDSLoader.js +20 -20
- package/dist/loaders/{TGALoader.mjs → TGALoader.cjs} +6 -6
- package/dist/loaders/TGALoader.js +6 -6
- package/dist/loaders/{TTFLoader.mjs → TTFLoader.cjs} +9 -9
- package/dist/loaders/TTFLoader.js +9 -9
- package/dist/loaders/{TiltLoader.mjs → TiltLoader.cjs} +26 -26
- package/dist/loaders/TiltLoader.js +26 -26
- package/dist/loaders/{VOXLoader.mjs → VOXLoader.cjs} +18 -18
- package/dist/loaders/VOXLoader.js +18 -18
- package/dist/loaders/{VRMLLoader.mjs → VRMLLoader.cjs} +125 -125
- package/dist/loaders/VRMLLoader.js +125 -125
- package/dist/loaders/{VRMLoader.mjs → VRMLoader.cjs} +7 -7
- package/dist/loaders/VRMLoader.js +7 -7
- package/dist/loaders/{VTKLoader.mjs → VTKLoader.cjs} +24 -24
- package/dist/loaders/VTKLoader.js +24 -24
- package/dist/loaders/{XLoader.mjs → XLoader.cjs} +42 -42
- package/dist/loaders/XLoader.js +42 -42
- package/dist/loaders/{XYZLoader.mjs → XYZLoader.cjs} +9 -9
- package/dist/loaders/XYZLoader.js +9 -9
- package/dist/loaders/lwo/{IFFParser.mjs → IFFParser.cjs} +7 -7
- package/dist/loaders/lwo/IFFParser.js +7 -7
- package/dist/loaders/lwo/{LWO2Parser.mjs → LWO2Parser.cjs} +3 -3
- package/dist/loaders/lwo/LWO2Parser.js +3 -3
- package/dist/loaders/lwo/{LWO3Parser.mjs → LWO3Parser.cjs} +3 -3
- package/dist/loaders/lwo/LWO3Parser.js +3 -3
- package/dist/math/{Capsule.mjs → Capsule.cjs} +8 -8
- package/dist/math/Capsule.js +8 -8
- package/dist/math/{ColorConverter.mjs → ColorConverter.cjs} +7 -7
- package/dist/math/ColorConverter.js +7 -7
- package/dist/math/{ConvexHull.mjs → ConvexHull.cjs} +18 -18
- package/dist/math/ConvexHull.js +18 -18
- package/dist/math/{ImprovedNoise.mjs → ImprovedNoise.cjs} +3 -3
- package/dist/math/ImprovedNoise.js +3 -3
- package/dist/math/{Lut.mjs → Lut.cjs} +14 -14
- package/dist/math/Lut.js +14 -14
- package/dist/math/{MeshSurfaceSampler.mjs → MeshSurfaceSampler.cjs} +6 -6
- package/dist/math/MeshSurfaceSampler.js +6 -6
- package/dist/math/{OBB.mjs → OBB.cjs} +21 -21
- package/dist/math/OBB.js +21 -21
- package/dist/math/{Octree.mjs → Octree.cjs} +19 -19
- package/dist/math/Octree.js +19 -19
- package/dist/math/{SimplexNoise.mjs → SimplexNoise.cjs} +3 -3
- package/dist/math/SimplexNoise.js +3 -3
- package/dist/misc/{ConvexObjectBreaker.mjs → ConvexObjectBreaker.cjs} +25 -25
- package/dist/misc/ConvexObjectBreaker.js +25 -25
- package/dist/misc/{GPUComputationRenderer.mjs → GPUComputationRenderer.cjs} +19 -19
- package/dist/misc/GPUComputationRenderer.js +19 -19
- package/dist/misc/{Gyroscope.mjs → Gyroscope.cjs} +11 -11
- package/dist/misc/Gyroscope.js +11 -11
- package/dist/misc/{MD2Character.mjs → MD2Character.cjs} +14 -14
- package/dist/misc/MD2Character.js +14 -14
- package/dist/misc/{MD2CharacterComplex.mjs → MD2CharacterComplex.cjs} +20 -20
- package/dist/misc/MD2CharacterComplex.js +20 -20
- package/dist/misc/{MorphAnimMesh.mjs → MorphAnimMesh.cjs} +8 -8
- package/dist/misc/MorphAnimMesh.js +8 -8
- package/dist/misc/{MorphBlendMesh.mjs → MorphBlendMesh.cjs} +6 -6
- package/dist/misc/MorphBlendMesh.js +6 -6
- package/dist/misc/{ProgressiveLightmap.mjs → ProgressiveLightmap.cjs} +17 -17
- package/dist/misc/ProgressiveLightmap.js +17 -17
- package/dist/misc/{RollerCoaster.mjs → RollerCoaster.cjs} +77 -77
- package/dist/misc/RollerCoaster.js +77 -77
- package/dist/misc/{Timer.mjs → Timer.cjs} +3 -3
- package/dist/misc/Timer.js +3 -3
- package/dist/misc/{TubePainter.mjs → TubePainter.cjs} +24 -24
- package/dist/misc/TubePainter.js +24 -24
- package/dist/misc/{Volume.mjs → Volume.cjs} +18 -18
- package/dist/misc/Volume.js +18 -18
- package/dist/misc/{VolumeSlice.mjs → VolumeSlice.cjs} +10 -10
- package/dist/misc/VolumeSlice.js +10 -10
- package/dist/misc/{WebGL.mjs → WebGL.cjs} +7 -7
- package/dist/misc/WebGL.js +7 -7
- package/dist/modifiers/{CurveModifier.mjs → CurveModifier.cjs} +17 -17
- package/dist/modifiers/CurveModifier.js +17 -17
- package/dist/modifiers/{EdgeSplitModifier.mjs → EdgeSplitModifier.cjs} +12 -13
- package/dist/modifiers/EdgeSplitModifier.js +13 -12
- package/dist/modifiers/{SimplifyModifier.mjs → SimplifyModifier.cjs} +12 -12
- package/dist/modifiers/SimplifyModifier.js +12 -12
- package/dist/modifiers/{TessellateModifier.mjs → TessellateModifier.cjs} +30 -30
- package/dist/modifiers/TessellateModifier.js +30 -30
- package/dist/objects/{GroundProjectedEnv.mjs → GroundProjectedEnv.cjs} +8 -8
- package/dist/objects/GroundProjectedEnv.js +8 -8
- package/dist/objects/{Lensflare.mjs → Lensflare.cjs} +37 -37
- package/dist/objects/Lensflare.js +37 -37
- package/dist/objects/{LightningStorm.mjs → LightningStorm.cjs} +17 -17
- package/dist/objects/LightningStorm.js +17 -17
- package/dist/objects/{MarchingCubes.mjs → MarchingCubes.cjs} +21 -21
- package/dist/objects/MarchingCubes.js +21 -21
- package/dist/objects/{Reflector.mjs → Reflector.cjs} +23 -23
- package/dist/objects/Reflector.js +23 -23
- package/dist/objects/{ReflectorForSSRPass.mjs → ReflectorForSSRPass.cjs} +33 -33
- package/dist/objects/ReflectorForSSRPass.js +33 -33
- package/dist/objects/ReflectorRTT.cjs +10 -0
- package/dist/objects/ReflectorRTT.js +5 -5
- package/dist/objects/{Refractor.mjs → Refractor.cjs} +26 -26
- package/dist/objects/Refractor.js +26 -26
- package/dist/objects/{ShadowMesh.mjs → ShadowMesh.cjs} +9 -9
- package/dist/objects/ShadowMesh.js +9 -9
- package/dist/objects/{Sky.mjs → Sky.cjs} +11 -11
- package/dist/objects/Sky.js +11 -11
- package/dist/objects/{Water.mjs → Water.cjs} +33 -33
- package/dist/objects/Water.js +33 -33
- package/dist/objects/{Water2.mjs → Water2.cjs} +20 -20
- package/dist/objects/Water2.js +20 -20
- package/dist/physics/{AmmoPhysics.mjs → AmmoPhysics.cjs} +3 -3
- package/dist/physics/AmmoPhysics.js +3 -3
- package/dist/postprocessing/{AdaptiveToneMappingPass.mjs → AdaptiveToneMappingPass.cjs} +32 -32
- package/dist/postprocessing/AdaptiveToneMappingPass.js +32 -32
- package/dist/postprocessing/{AfterimagePass.mjs → AfterimagePass.cjs} +21 -21
- package/dist/postprocessing/AfterimagePass.js +21 -21
- package/dist/postprocessing/{BloomPass.mjs → BloomPass.cjs} +20 -20
- package/dist/postprocessing/BloomPass.js +20 -20
- package/dist/postprocessing/{BokehPass.mjs → BokehPass.cjs} +19 -19
- package/dist/postprocessing/BokehPass.js +19 -19
- package/dist/postprocessing/{ClearPass.mjs → ClearPass.cjs} +7 -7
- package/dist/postprocessing/ClearPass.js +7 -7
- package/dist/postprocessing/{CubeTexturePass.mjs → CubeTexturePass.cjs} +14 -14
- package/dist/postprocessing/CubeTexturePass.js +14 -14
- package/dist/postprocessing/{DotScreenPass.mjs → DotScreenPass.cjs} +12 -12
- package/dist/postprocessing/DotScreenPass.js +12 -12
- package/dist/postprocessing/{EffectComposer.mjs → EffectComposer.cjs} +20 -20
- package/dist/postprocessing/EffectComposer.js +20 -20
- package/dist/postprocessing/{FilmPass.mjs → FilmPass.cjs} +12 -12
- package/dist/postprocessing/FilmPass.js +12 -12
- package/dist/postprocessing/{GlitchPass.mjs → GlitchPass.cjs} +26 -26
- package/dist/postprocessing/GlitchPass.js +26 -26
- package/dist/postprocessing/{HalftonePass.mjs → HalftonePass.cjs} +13 -13
- package/dist/postprocessing/HalftonePass.js +13 -13
- package/dist/postprocessing/{LUTPass.mjs → LUTPass.cjs} +5 -5
- package/dist/postprocessing/LUTPass.js +5 -5
- package/dist/postprocessing/{MaskPass.mjs → MaskPass.cjs} +7 -7
- package/dist/postprocessing/MaskPass.js +7 -7
- package/dist/postprocessing/{OutlinePass.mjs → OutlinePass.cjs} +45 -45
- package/dist/postprocessing/OutlinePass.js +45 -45
- package/dist/postprocessing/{Pass.mjs → Pass.cjs} +8 -8
- package/dist/postprocessing/Pass.js +8 -8
- package/dist/postprocessing/{RenderPass.mjs → RenderPass.cjs} +7 -7
- package/dist/postprocessing/RenderPass.js +7 -7
- package/dist/postprocessing/{RenderPixelatedPass.mjs → RenderPixelatedPass.cjs} +18 -18
- package/dist/postprocessing/RenderPixelatedPass.js +18 -18
- package/dist/postprocessing/{SAOPass.mjs → SAOPass.cjs} +69 -69
- package/dist/postprocessing/SAOPass.js +69 -69
- package/dist/postprocessing/{SMAAPass.mjs → SMAAPass.cjs} +30 -30
- package/dist/postprocessing/SMAAPass.js +30 -30
- package/dist/postprocessing/{SSAARenderPass.mjs → SSAARenderPass.cjs} +19 -19
- package/dist/postprocessing/SSAARenderPass.js +19 -19
- package/dist/postprocessing/{SSAOPass.mjs → SSAOPass.cjs} +63 -63
- package/dist/postprocessing/SSAOPass.js +63 -63
- package/dist/postprocessing/{SSRPass.mjs → SSRPass.cjs} +86 -86
- package/dist/postprocessing/SSRPass.js +86 -86
- package/dist/postprocessing/{SavePass.mjs → SavePass.cjs} +13 -13
- package/dist/postprocessing/SavePass.js +13 -13
- package/dist/postprocessing/{ShaderPass.mjs → ShaderPass.cjs} +10 -10
- package/dist/postprocessing/ShaderPass.js +10 -10
- package/dist/postprocessing/{TAARenderPass.mjs → TAARenderPass.cjs} +8 -8
- package/dist/postprocessing/TAARenderPass.js +8 -8
- package/dist/postprocessing/{TexturePass.mjs → TexturePass.cjs} +11 -11
- package/dist/postprocessing/TexturePass.js +11 -11
- package/dist/postprocessing/{UnrealBloomPass.mjs → UnrealBloomPass.cjs} +36 -36
- package/dist/postprocessing/UnrealBloomPass.js +36 -36
- package/dist/postprocessing/{WaterPass.mjs → WaterPass.cjs} +10 -10
- package/dist/postprocessing/WaterPass.js +10 -10
- package/dist/renderers/{CSS2DRenderer.mjs → CSS2DRenderer.cjs} +12 -12
- package/dist/renderers/CSS2DRenderer.js +12 -12
- package/dist/renderers/{CSS3DRenderer.mjs → CSS3DRenderer.cjs} +12 -12
- package/dist/renderers/CSS3DRenderer.js +12 -12
- package/dist/renderers/{Projector.mjs → Projector.cjs} +21 -21
- package/dist/renderers/Projector.js +21 -21
- package/dist/renderers/{SVGRenderer.mjs → SVGRenderer.cjs} +12 -12
- package/dist/renderers/SVGRenderer.js +12 -12
- package/dist/shaders/{ACESFilmicToneMappingShader.mjs → ACESFilmicToneMappingShader.cjs} +3 -3
- package/dist/shaders/ACESFilmicToneMappingShader.js +3 -3
- package/dist/shaders/{AfterimageShader.mjs → AfterimageShader.cjs} +3 -3
- package/dist/shaders/AfterimageShader.js +3 -3
- package/dist/shaders/{BasicShader.mjs → BasicShader.cjs} +3 -3
- package/dist/shaders/BasicShader.js +3 -3
- package/dist/shaders/{BleachBypassShader.mjs → BleachBypassShader.cjs} +3 -3
- package/dist/shaders/BleachBypassShader.js +3 -3
- package/dist/shaders/{BlendShader.mjs → BlendShader.cjs} +3 -3
- package/dist/shaders/BlendShader.js +3 -3
- package/dist/shaders/{BokehShader.mjs → BokehShader.cjs} +3 -3
- package/dist/shaders/BokehShader.js +3 -3
- package/dist/shaders/{BokehShader2.mjs → BokehShader2.cjs} +6 -6
- package/dist/shaders/BokehShader2.js +6 -6
- package/dist/shaders/{BrightnessContrastShader.mjs → BrightnessContrastShader.cjs} +3 -3
- package/dist/shaders/BrightnessContrastShader.js +3 -3
- package/dist/shaders/{ColorCorrectionShader.mjs → ColorCorrectionShader.cjs} +7 -7
- package/dist/shaders/ColorCorrectionShader.js +7 -7
- package/dist/shaders/{ColorifyShader.mjs → ColorifyShader.cjs} +5 -5
- package/dist/shaders/ColorifyShader.js +5 -5
- package/dist/shaders/{ConvolutionShader.mjs → ConvolutionShader.cjs} +5 -5
- package/dist/shaders/ConvolutionShader.js +5 -5
- package/dist/shaders/{CopyShader.mjs → CopyShader.cjs} +3 -3
- package/dist/shaders/CopyShader.js +3 -3
- package/dist/shaders/{DOFMipMapShader.mjs → DOFMipMapShader.cjs} +3 -3
- package/dist/shaders/DOFMipMapShader.js +3 -3
- package/dist/shaders/{DepthLimitedBlurShader.mjs → DepthLimitedBlurShader.cjs} +7 -7
- package/dist/shaders/DepthLimitedBlurShader.js +7 -7
- package/dist/shaders/{DigitalGlitch.mjs → DigitalGlitch.cjs} +3 -3
- package/dist/shaders/DigitalGlitch.js +3 -3
- package/dist/shaders/{DotScreenShader.mjs → DotScreenShader.cjs} +6 -6
- package/dist/shaders/DotScreenShader.js +6 -6
- package/dist/shaders/{FXAAShader.mjs → FXAAShader.cjs} +5 -5
- package/dist/shaders/FXAAShader.js +5 -5
- package/dist/shaders/{FilmShader.mjs → FilmShader.cjs} +3 -3
- package/dist/shaders/FilmShader.js +3 -3
- package/dist/shaders/{FocusShader.mjs → FocusShader.cjs} +3 -3
- package/dist/shaders/FocusShader.js +3 -3
- package/dist/shaders/{FreiChenShader.mjs → FreiChenShader.cjs} +5 -5
- package/dist/shaders/FreiChenShader.js +5 -5
- package/dist/shaders/{FresnelShader.mjs → FresnelShader.cjs} +3 -3
- package/dist/shaders/FresnelShader.js +3 -3
- package/dist/shaders/{GammaCorrectionShader.mjs → GammaCorrectionShader.cjs} +3 -3
- package/dist/shaders/GammaCorrectionShader.js +3 -3
- package/dist/shaders/{GodRaysShader.mjs → GodRaysShader.cjs} +11 -11
- package/dist/shaders/GodRaysShader.js +11 -11
- package/dist/shaders/{HalftoneShader.mjs → HalftoneShader.cjs} +3 -3
- package/dist/shaders/HalftoneShader.js +3 -3
- package/dist/shaders/{HorizontalBlurShader.mjs → HorizontalBlurShader.cjs} +3 -3
- package/dist/shaders/HorizontalBlurShader.js +3 -3
- package/dist/shaders/{HorizontalTiltShiftShader.mjs → HorizontalTiltShiftShader.cjs} +3 -3
- package/dist/shaders/HorizontalTiltShiftShader.js +3 -3
- package/dist/shaders/{HueSaturationShader.mjs → HueSaturationShader.cjs} +3 -3
- package/dist/shaders/HueSaturationShader.js +3 -3
- package/dist/shaders/{KaleidoShader.mjs → KaleidoShader.cjs} +3 -3
- package/dist/shaders/KaleidoShader.js +3 -3
- package/dist/shaders/{LuminosityHighPassShader.mjs → LuminosityHighPassShader.cjs} +5 -5
- package/dist/shaders/LuminosityHighPassShader.js +5 -5
- package/dist/shaders/{LuminosityShader.mjs → LuminosityShader.cjs} +3 -3
- package/dist/shaders/LuminosityShader.js +3 -3
- package/dist/shaders/{MirrorShader.mjs → MirrorShader.cjs} +3 -3
- package/dist/shaders/MirrorShader.js +3 -3
- package/dist/shaders/{NormalMapShader.mjs → NormalMapShader.cjs} +6 -6
- package/dist/shaders/NormalMapShader.js +6 -6
- package/dist/shaders/{ParallaxShader.mjs → ParallaxShader.cjs} +3 -3
- package/dist/shaders/ParallaxShader.js +3 -3
- package/dist/shaders/{PixelShader.mjs → PixelShader.cjs} +3 -3
- package/dist/shaders/PixelShader.js +3 -3
- package/dist/shaders/{RGBShiftShader.mjs → RGBShiftShader.cjs} +3 -3
- package/dist/shaders/RGBShiftShader.js +3 -3
- package/dist/shaders/{SAOShader.mjs → SAOShader.cjs} +7 -7
- package/dist/shaders/SAOShader.js +7 -7
- package/dist/shaders/{SMAAShader.mjs → SMAAShader.cjs} +9 -9
- package/dist/shaders/SMAAShader.js +9 -9
- package/dist/shaders/{SSAOShader.mjs → SSAOShader.cjs} +10 -10
- package/dist/shaders/SSAOShader.js +10 -10
- package/dist/shaders/{SSRShader.mjs → SSRShader.cjs} +10 -10
- package/dist/shaders/SSRShader.js +10 -10
- package/dist/shaders/{SepiaShader.mjs → SepiaShader.cjs} +3 -3
- package/dist/shaders/SepiaShader.js +3 -3
- package/dist/shaders/{SobelOperatorShader.mjs → SobelOperatorShader.cjs} +5 -5
- package/dist/shaders/SobelOperatorShader.js +5 -5
- package/dist/shaders/{SubsurfaceScatteringShader.mjs → SubsurfaceScatteringShader.cjs} +13 -13
- package/dist/shaders/SubsurfaceScatteringShader.js +13 -13
- package/dist/shaders/{TechnicolorShader.mjs → TechnicolorShader.cjs} +3 -3
- package/dist/shaders/TechnicolorShader.js +3 -3
- package/dist/shaders/{ToneMapShader.mjs → ToneMapShader.cjs} +3 -3
- package/dist/shaders/ToneMapShader.js +3 -3
- package/dist/shaders/{ToonShader.mjs → ToonShader.cjs} +32 -32
- package/dist/shaders/ToonShader.js +32 -32
- package/dist/shaders/{TriangleBlurShader.mjs → TriangleBlurShader.cjs} +5 -5
- package/dist/shaders/TriangleBlurShader.js +5 -5
- package/dist/shaders/{UnpackDepthRGBAShader.mjs → UnpackDepthRGBAShader.cjs} +3 -3
- package/dist/shaders/UnpackDepthRGBAShader.js +3 -3
- package/dist/shaders/{VerticalBlurShader.mjs → VerticalBlurShader.cjs} +3 -3
- package/dist/shaders/VerticalBlurShader.js +3 -3
- package/dist/shaders/{VerticalTiltShiftShader.mjs → VerticalTiltShiftShader.cjs} +3 -3
- package/dist/shaders/VerticalTiltShiftShader.js +3 -3
- package/dist/shaders/{VignetteShader.mjs → VignetteShader.cjs} +3 -3
- package/dist/shaders/VignetteShader.js +3 -3
- package/dist/shaders/{VolumeShader.mjs → VolumeShader.cjs} +6 -6
- package/dist/shaders/VolumeShader.js +6 -6
- package/dist/shaders/{WaterRefractionShader.mjs → WaterRefractionShader.cjs} +3 -3
- package/dist/shaders/WaterRefractionShader.js +3 -3
- package/dist/shaders/types.cjs +1 -0
- package/dist/shaders/types.js +1 -1
- package/dist/textures/{FlakesTexture.mjs → FlakesTexture.cjs} +3 -3
- package/dist/textures/FlakesTexture.js +3 -3
- package/dist/types/Loader.cjs +26 -0
- package/dist/types/Loader.js +5 -22
- package/dist/types/helpers.cjs +4 -0
- package/dist/types/helpers.js +3 -3
- package/dist/utils/{BufferGeometryUtils.mjs → BufferGeometryUtils.cjs} +41 -41
- package/dist/utils/BufferGeometryUtils.js +41 -41
- package/dist/utils/{GeometryCompressionUtils.mjs → GeometryCompressionUtils.cjs} +94 -94
- package/dist/utils/GeometryCompressionUtils.js +94 -94
- package/dist/utils/{GeometryUtils.mjs → GeometryUtils.cjs} +18 -18
- package/dist/utils/GeometryUtils.js +18 -18
- package/dist/utils/{RoughnessMipmapper.mjs → RoughnessMipmapper.cjs} +13 -13
- package/dist/utils/RoughnessMipmapper.js +13 -13
- package/dist/utils/{SceneUtils.mjs → SceneUtils.cjs} +8 -8
- package/dist/utils/SceneUtils.js +8 -8
- package/dist/utils/{ShadowMapViewer.mjs → ShadowMapViewer.cjs} +18 -18
- package/dist/utils/ShadowMapViewer.js +18 -18
- package/dist/utils/{SkeletonUtils.mjs → SkeletonUtils.cjs} +10 -10
- package/dist/utils/SkeletonUtils.js +10 -10
- package/dist/utils/{UVsDebug.mjs → UVsDebug.cjs} +7 -7
- package/dist/utils/UVsDebug.js +7 -7
- package/dist/utils/{WorkerPool.mjs → WorkerPool.cjs} +3 -3
- package/dist/utils/WorkerPool.js +3 -3
- package/dist/webxr/{ARButton.mjs → ARButton.cjs} +3 -3
- package/dist/webxr/ARButton.js +3 -3
- package/dist/webxr/{OculusHandModel.mjs → OculusHandModel.cjs} +9 -9
- package/dist/webxr/OculusHandModel.js +9 -9
- package/dist/webxr/{OculusHandPointerModel.mjs → OculusHandPointerModel.cjs} +41 -24
- package/dist/webxr/OculusHandPointerModel.js +24 -41
- package/dist/webxr/Text2D.cjs +48 -0
- package/dist/webxr/Text2D.js +9 -26
- package/dist/webxr/{VRButton.mjs → VRButton.cjs} +3 -3
- package/dist/webxr/VRButton.js +3 -3
- package/dist/webxr/{XRControllerModelFactory.mjs → XRControllerModelFactory.cjs} +18 -18
- package/dist/webxr/XRControllerModelFactory.js +18 -18
- package/dist/webxr/{XREstimatedLight.mjs → XREstimatedLight.cjs} +8 -8
- package/dist/webxr/XREstimatedLight.js +8 -8
- package/dist/webxr/{XRHandMeshModel.mjs → XRHandMeshModel.cjs} +5 -5
- package/dist/webxr/XRHandMeshModel.js +5 -5
- package/dist/webxr/{XRHandModelFactory.mjs → XRHandModelFactory.cjs} +10 -10
- package/dist/webxr/XRHandModelFactory.js +10 -10
- package/dist/webxr/{XRHandPrimitiveModel.mjs → XRHandPrimitiveModel.cjs} +11 -11
- package/dist/webxr/XRHandPrimitiveModel.js +11 -11
- package/package.json +3 -3
- package/dist/_polyfill/CompressedArrayTexture.mjs +0 -12
- package/dist/_polyfill/Data3DTexture.mjs +0 -17
- package/dist/environments/RoomEnvironment.mjs +0 -78
- package/dist/geometries/ConvexGeometry.mjs +0 -26
- package/dist/index.mjs +0 -613
- package/dist/lines/Line2.mjs +0 -13
- package/dist/lines/Wireframe.mjs +0 -32
- package/dist/lines/WireframeGeometry2.mjs +0 -13
- package/dist/objects/ReflectorRTT.mjs +0 -10
- package/dist/shaders/types.mjs +0 -1
- package/dist/types/Loader.mjs +0 -9
- package/dist/types/helpers.mjs +0 -4
- package/dist/webxr/Text2D.mjs +0 -31
@@ -1,14 +1,12 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
const THREE = require("three");
|
4
|
-
class PLYLoader extends THREE.Loader {
|
1
|
+
import { Loader, FileLoader, BufferGeometry, Float32BufferAttribute, LoaderUtils } from "three";
|
2
|
+
class PLYLoader extends Loader {
|
5
3
|
constructor(manager) {
|
6
4
|
super(manager);
|
7
5
|
this.propertyNameMapping = {};
|
8
6
|
}
|
9
7
|
load(url, onLoad, onProgress, onError) {
|
10
8
|
const scope = this;
|
11
|
-
const loader = new
|
9
|
+
const loader = new FileLoader(this.manager);
|
12
10
|
loader.setPath(this.path);
|
13
11
|
loader.setResponseType("arraybuffer");
|
14
12
|
loader.setRequestHeader(this.requestHeader);
|
@@ -180,23 +178,23 @@ class PLYLoader extends THREE.Loader {
|
|
180
178
|
return postProcess(buffer);
|
181
179
|
}
|
182
180
|
function postProcess(buffer) {
|
183
|
-
let geometry2 = new
|
181
|
+
let geometry2 = new BufferGeometry();
|
184
182
|
if (buffer.indices.length > 0) {
|
185
183
|
geometry2.setIndex(buffer.indices);
|
186
184
|
}
|
187
|
-
geometry2.setAttribute("position", new
|
185
|
+
geometry2.setAttribute("position", new Float32BufferAttribute(buffer.vertices, 3));
|
188
186
|
if (buffer.normals.length > 0) {
|
189
|
-
geometry2.setAttribute("normal", new
|
187
|
+
geometry2.setAttribute("normal", new Float32BufferAttribute(buffer.normals, 3));
|
190
188
|
}
|
191
189
|
if (buffer.uvs.length > 0) {
|
192
|
-
geometry2.setAttribute("uv", new
|
190
|
+
geometry2.setAttribute("uv", new Float32BufferAttribute(buffer.uvs, 2));
|
193
191
|
}
|
194
192
|
if (buffer.colors.length > 0) {
|
195
|
-
geometry2.setAttribute("color", new
|
193
|
+
geometry2.setAttribute("color", new Float32BufferAttribute(buffer.colors, 3));
|
196
194
|
}
|
197
195
|
if (buffer.faceVertexUvs.length > 0) {
|
198
196
|
geometry2 = geometry2.toNonIndexed();
|
199
|
-
geometry2.setAttribute("uv", new
|
197
|
+
geometry2.setAttribute("uv", new Float32BufferAttribute(buffer.faceVertexUvs, 2));
|
200
198
|
}
|
201
199
|
geometry2.computeBoundingSphere();
|
202
200
|
return geometry2;
|
@@ -305,7 +303,7 @@ class PLYLoader extends THREE.Loader {
|
|
305
303
|
let geometry;
|
306
304
|
const scope = this;
|
307
305
|
if (data instanceof ArrayBuffer) {
|
308
|
-
const text =
|
306
|
+
const text = LoaderUtils.decodeText(new Uint8Array(data));
|
309
307
|
const header = parseHeader(text);
|
310
308
|
geometry = header.format === "ascii" ? parseASCII(text, header) : parseBinary(data, header);
|
311
309
|
} else {
|
@@ -314,4 +312,6 @@ class PLYLoader extends THREE.Loader {
|
|
314
312
|
return geometry;
|
315
313
|
}
|
316
314
|
}
|
317
|
-
|
315
|
+
export {
|
316
|
+
PLYLoader
|
317
|
+
};
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
3
|
+
const THREE = require("three");
|
2
4
|
let bigEndianPlatform = null;
|
3
5
|
function isBigEndianPlatform() {
|
4
6
|
if (bigEndianPlatform === null) {
|
@@ -107,13 +109,13 @@ function decodePrwm(buffer) {
|
|
107
109
|
indices
|
108
110
|
};
|
109
111
|
}
|
110
|
-
class PRWMLoader extends Loader {
|
112
|
+
class PRWMLoader extends THREE.Loader {
|
111
113
|
constructor(manager) {
|
112
114
|
super(manager);
|
113
115
|
}
|
114
116
|
load(url, onLoad, onProgress, onError) {
|
115
117
|
const scope = this;
|
116
|
-
const loader = new FileLoader(scope.manager);
|
118
|
+
const loader = new THREE.FileLoader(scope.manager);
|
117
119
|
loader.setPath(scope.path);
|
118
120
|
loader.setResponseType("arraybuffer");
|
119
121
|
loader.setRequestHeader(scope.requestHeader);
|
@@ -138,16 +140,16 @@ class PRWMLoader extends Loader {
|
|
138
140
|
);
|
139
141
|
}
|
140
142
|
parse(arrayBuffer) {
|
141
|
-
const data = decodePrwm(arrayBuffer), attributesKey = Object.keys(data.attributes), bufferGeometry = new BufferGeometry();
|
143
|
+
const data = decodePrwm(arrayBuffer), attributesKey = Object.keys(data.attributes), bufferGeometry = new THREE.BufferGeometry();
|
142
144
|
for (let i = 0; i < attributesKey.length; i++) {
|
143
145
|
const attribute = data.attributes[attributesKey[i]];
|
144
146
|
bufferGeometry.setAttribute(
|
145
147
|
attributesKey[i],
|
146
|
-
new BufferAttribute(attribute.values, attribute.cardinality, attribute.normalized)
|
148
|
+
new THREE.BufferAttribute(attribute.values, attribute.cardinality, attribute.normalized)
|
147
149
|
);
|
148
150
|
}
|
149
151
|
if (data.indices !== null) {
|
150
|
-
bufferGeometry.setIndex(new BufferAttribute(data.indices, 1));
|
152
|
+
bufferGeometry.setIndex(new THREE.BufferAttribute(data.indices, 1));
|
151
153
|
}
|
152
154
|
return bufferGeometry;
|
153
155
|
}
|
@@ -155,6 +157,4 @@ class PRWMLoader extends Loader {
|
|
155
157
|
return isBigEndianPlatform();
|
156
158
|
}
|
157
159
|
}
|
158
|
-
|
159
|
-
PRWMLoader
|
160
|
-
};
|
160
|
+
exports.PRWMLoader = PRWMLoader;
|
@@ -1,6 +1,4 @@
|
|
1
|
-
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
3
|
-
const THREE = require("three");
|
1
|
+
import { Loader, FileLoader, BufferGeometry, BufferAttribute } from "three";
|
4
2
|
let bigEndianPlatform = null;
|
5
3
|
function isBigEndianPlatform() {
|
6
4
|
if (bigEndianPlatform === null) {
|
@@ -109,13 +107,13 @@ function decodePrwm(buffer) {
|
|
109
107
|
indices
|
110
108
|
};
|
111
109
|
}
|
112
|
-
class PRWMLoader extends
|
110
|
+
class PRWMLoader extends Loader {
|
113
111
|
constructor(manager) {
|
114
112
|
super(manager);
|
115
113
|
}
|
116
114
|
load(url, onLoad, onProgress, onError) {
|
117
115
|
const scope = this;
|
118
|
-
const loader = new
|
116
|
+
const loader = new FileLoader(scope.manager);
|
119
117
|
loader.setPath(scope.path);
|
120
118
|
loader.setResponseType("arraybuffer");
|
121
119
|
loader.setRequestHeader(scope.requestHeader);
|
@@ -140,16 +138,16 @@ class PRWMLoader extends THREE.Loader {
|
|
140
138
|
);
|
141
139
|
}
|
142
140
|
parse(arrayBuffer) {
|
143
|
-
const data = decodePrwm(arrayBuffer), attributesKey = Object.keys(data.attributes), bufferGeometry = new
|
141
|
+
const data = decodePrwm(arrayBuffer), attributesKey = Object.keys(data.attributes), bufferGeometry = new BufferGeometry();
|
144
142
|
for (let i = 0; i < attributesKey.length; i++) {
|
145
143
|
const attribute = data.attributes[attributesKey[i]];
|
146
144
|
bufferGeometry.setAttribute(
|
147
145
|
attributesKey[i],
|
148
|
-
new
|
146
|
+
new BufferAttribute(attribute.values, attribute.cardinality, attribute.normalized)
|
149
147
|
);
|
150
148
|
}
|
151
149
|
if (data.indices !== null) {
|
152
|
-
bufferGeometry.setIndex(new
|
150
|
+
bufferGeometry.setIndex(new BufferAttribute(data.indices, 1));
|
153
151
|
}
|
154
152
|
return bufferGeometry;
|
155
153
|
}
|
@@ -157,4 +155,6 @@ class PRWMLoader extends THREE.Loader {
|
|
157
155
|
return isBigEndianPlatform();
|
158
156
|
}
|
159
157
|
}
|
160
|
-
|
158
|
+
export {
|
159
|
+
PRWMLoader
|
160
|
+
};
|
@@ -1,5 +1,7 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
3
|
+
const THREE = require("three");
|
4
|
+
class PVRLoader extends THREE.CompressedTextureLoader {
|
3
5
|
constructor(manager) {
|
4
6
|
super(manager);
|
5
7
|
}
|
@@ -27,19 +29,19 @@ function _parseV3(pvrDatas) {
|
|
27
29
|
switch (pixelFormat) {
|
28
30
|
case 0:
|
29
31
|
bpp = 2;
|
30
|
-
format = RGB_PVRTC_2BPPV1_Format;
|
32
|
+
format = THREE.RGB_PVRTC_2BPPV1_Format;
|
31
33
|
break;
|
32
34
|
case 1:
|
33
35
|
bpp = 2;
|
34
|
-
format = RGBA_PVRTC_2BPPV1_Format;
|
36
|
+
format = THREE.RGBA_PVRTC_2BPPV1_Format;
|
35
37
|
break;
|
36
38
|
case 2:
|
37
39
|
bpp = 4;
|
38
|
-
format = RGB_PVRTC_4BPPV1_Format;
|
40
|
+
format = THREE.RGB_PVRTC_4BPPV1_Format;
|
39
41
|
break;
|
40
42
|
case 3:
|
41
43
|
bpp = 4;
|
42
|
-
format = RGBA_PVRTC_4BPPV1_Format;
|
44
|
+
format = THREE.RGBA_PVRTC_4BPPV1_Format;
|
43
45
|
break;
|
44
46
|
default:
|
45
47
|
console.error("THREE.PVRLoader: Unsupported PVR format:", pixelFormat);
|
@@ -63,10 +65,10 @@ function _parseV2(pvrDatas) {
|
|
63
65
|
let bpp, format;
|
64
66
|
const _hasAlpha = bitmaskAlpha > 0;
|
65
67
|
if (formatFlags === PVRTC_4) {
|
66
|
-
format = _hasAlpha ? RGBA_PVRTC_4BPPV1_Format : RGB_PVRTC_4BPPV1_Format;
|
68
|
+
format = _hasAlpha ? THREE.RGBA_PVRTC_4BPPV1_Format : THREE.RGB_PVRTC_4BPPV1_Format;
|
67
69
|
bpp = 4;
|
68
70
|
} else if (formatFlags === PVRTC_2) {
|
69
|
-
format = _hasAlpha ? RGBA_PVRTC_2BPPV1_Format : RGB_PVRTC_2BPPV1_Format;
|
71
|
+
format = _hasAlpha ? THREE.RGBA_PVRTC_2BPPV1_Format : THREE.RGB_PVRTC_2BPPV1_Format;
|
70
72
|
bpp = 2;
|
71
73
|
} else {
|
72
74
|
console.error("THREE.PVRLoader: Unknown PVR format:", formatFlags);
|
@@ -126,6 +128,4 @@ function _extract(pvrDatas) {
|
|
126
128
|
}
|
127
129
|
return pvr;
|
128
130
|
}
|
129
|
-
|
130
|
-
PVRLoader
|
131
|
-
};
|
131
|
+
exports.PVRLoader = PVRLoader;
|
@@ -1,7 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
const THREE = require("three");
|
4
|
-
class PVRLoader extends THREE.CompressedTextureLoader {
|
1
|
+
import { CompressedTextureLoader, RGBA_PVRTC_4BPPV1_Format, RGB_PVRTC_4BPPV1_Format, RGBA_PVRTC_2BPPV1_Format, RGB_PVRTC_2BPPV1_Format } from "three";
|
2
|
+
class PVRLoader extends CompressedTextureLoader {
|
5
3
|
constructor(manager) {
|
6
4
|
super(manager);
|
7
5
|
}
|
@@ -29,19 +27,19 @@ function _parseV3(pvrDatas) {
|
|
29
27
|
switch (pixelFormat) {
|
30
28
|
case 0:
|
31
29
|
bpp = 2;
|
32
|
-
format =
|
30
|
+
format = RGB_PVRTC_2BPPV1_Format;
|
33
31
|
break;
|
34
32
|
case 1:
|
35
33
|
bpp = 2;
|
36
|
-
format =
|
34
|
+
format = RGBA_PVRTC_2BPPV1_Format;
|
37
35
|
break;
|
38
36
|
case 2:
|
39
37
|
bpp = 4;
|
40
|
-
format =
|
38
|
+
format = RGB_PVRTC_4BPPV1_Format;
|
41
39
|
break;
|
42
40
|
case 3:
|
43
41
|
bpp = 4;
|
44
|
-
format =
|
42
|
+
format = RGBA_PVRTC_4BPPV1_Format;
|
45
43
|
break;
|
46
44
|
default:
|
47
45
|
console.error("THREE.PVRLoader: Unsupported PVR format:", pixelFormat);
|
@@ -65,10 +63,10 @@ function _parseV2(pvrDatas) {
|
|
65
63
|
let bpp, format;
|
66
64
|
const _hasAlpha = bitmaskAlpha > 0;
|
67
65
|
if (formatFlags === PVRTC_4) {
|
68
|
-
format = _hasAlpha ?
|
66
|
+
format = _hasAlpha ? RGBA_PVRTC_4BPPV1_Format : RGB_PVRTC_4BPPV1_Format;
|
69
67
|
bpp = 4;
|
70
68
|
} else if (formatFlags === PVRTC_2) {
|
71
|
-
format = _hasAlpha ?
|
69
|
+
format = _hasAlpha ? RGBA_PVRTC_2BPPV1_Format : RGB_PVRTC_2BPPV1_Format;
|
72
70
|
bpp = 2;
|
73
71
|
} else {
|
74
72
|
console.error("THREE.PVRLoader: Unknown PVR format:", formatFlags);
|
@@ -128,4 +126,6 @@ function _extract(pvrDatas) {
|
|
128
126
|
}
|
129
127
|
return pvr;
|
130
128
|
}
|
131
|
-
|
129
|
+
export {
|
130
|
+
PVRLoader
|
131
|
+
};
|
@@ -1,8 +1,10 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
3
|
+
const THREE = require("three");
|
4
|
+
class RGBELoader extends THREE.DataTextureLoader {
|
3
5
|
constructor(manager) {
|
4
6
|
super(manager);
|
5
|
-
this.type = HalfFloatType;
|
7
|
+
this.type = THREE.HalfFloatType;
|
6
8
|
}
|
7
9
|
// adapted from http://www.graphics.cornell.edu/~bjw/rgbe.html
|
8
10
|
parse(buffer) {
|
@@ -173,10 +175,10 @@ class RGBELoader extends DataTextureLoader {
|
|
173
175
|
const RGBEByteToRGBHalf = function(sourceArray, sourceOffset, destArray, destOffset) {
|
174
176
|
const e = sourceArray[sourceOffset + 3];
|
175
177
|
const scale = Math.pow(2, e - 128) / 255;
|
176
|
-
destArray[destOffset + 0] = DataUtils.toHalfFloat(Math.min(sourceArray[sourceOffset + 0] * scale, 65504));
|
177
|
-
destArray[destOffset + 1] = DataUtils.toHalfFloat(Math.min(sourceArray[sourceOffset + 1] * scale, 65504));
|
178
|
-
destArray[destOffset + 2] = DataUtils.toHalfFloat(Math.min(sourceArray[sourceOffset + 2] * scale, 65504));
|
179
|
-
destArray[destOffset + 3] = DataUtils.toHalfFloat(1);
|
178
|
+
destArray[destOffset + 0] = THREE.DataUtils.toHalfFloat(Math.min(sourceArray[sourceOffset + 0] * scale, 65504));
|
179
|
+
destArray[destOffset + 1] = THREE.DataUtils.toHalfFloat(Math.min(sourceArray[sourceOffset + 1] * scale, 65504));
|
180
|
+
destArray[destOffset + 2] = THREE.DataUtils.toHalfFloat(Math.min(sourceArray[sourceOffset + 2] * scale, 65504));
|
181
|
+
destArray[destOffset + 3] = THREE.DataUtils.toHalfFloat(1);
|
180
182
|
};
|
181
183
|
const byteArray = new Uint8Array(buffer);
|
182
184
|
byteArray.pos = 0;
|
@@ -187,23 +189,23 @@ class RGBELoader extends DataTextureLoader {
|
|
187
189
|
let data, type;
|
188
190
|
let numElements;
|
189
191
|
switch (this.type) {
|
190
|
-
case FloatType:
|
192
|
+
case THREE.FloatType:
|
191
193
|
numElements = image_rgba_data.length / 4;
|
192
194
|
const floatArray = new Float32Array(numElements * 4);
|
193
195
|
for (let j = 0; j < numElements; j++) {
|
194
196
|
RGBEByteToRGBFloat(image_rgba_data, j * 4, floatArray, j * 4);
|
195
197
|
}
|
196
198
|
data = floatArray;
|
197
|
-
type = FloatType;
|
199
|
+
type = THREE.FloatType;
|
198
200
|
break;
|
199
|
-
case HalfFloatType:
|
201
|
+
case THREE.HalfFloatType:
|
200
202
|
numElements = image_rgba_data.length / 4;
|
201
203
|
const halfArray = new Uint16Array(numElements * 4);
|
202
204
|
for (let j = 0; j < numElements; j++) {
|
203
205
|
RGBEByteToRGBHalf(image_rgba_data, j * 4, halfArray, j * 4);
|
204
206
|
}
|
205
207
|
data = halfArray;
|
206
|
-
type = HalfFloatType;
|
208
|
+
type = THREE.HalfFloatType;
|
207
209
|
break;
|
208
210
|
default:
|
209
211
|
console.error("THREE.RGBELoader: unsupported type: ", this.type);
|
@@ -229,14 +231,14 @@ class RGBELoader extends DataTextureLoader {
|
|
229
231
|
load(url, onLoad, onProgress, onError) {
|
230
232
|
function onLoadCallback(texture, texData) {
|
231
233
|
switch (texture.type) {
|
232
|
-
case FloatType:
|
233
|
-
case HalfFloatType:
|
234
|
+
case THREE.FloatType:
|
235
|
+
case THREE.HalfFloatType:
|
234
236
|
if ("colorSpace" in texture)
|
235
237
|
texture.colorSpace = "srgb-linear";
|
236
238
|
else
|
237
239
|
texture.encoding = 3e3;
|
238
|
-
texture.minFilter = LinearFilter;
|
239
|
-
texture.magFilter = LinearFilter;
|
240
|
+
texture.minFilter = THREE.LinearFilter;
|
241
|
+
texture.magFilter = THREE.LinearFilter;
|
240
242
|
texture.generateMipmaps = false;
|
241
243
|
texture.flipY = true;
|
242
244
|
break;
|
@@ -247,6 +249,4 @@ class RGBELoader extends DataTextureLoader {
|
|
247
249
|
return super.load(url, onLoadCallback, onProgress, onError);
|
248
250
|
}
|
249
251
|
}
|
250
|
-
|
251
|
-
RGBELoader
|
252
|
-
};
|
252
|
+
exports.RGBELoader = RGBELoader;
|
@@ -1,10 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
const THREE = require("three");
|
4
|
-
class RGBELoader extends THREE.DataTextureLoader {
|
1
|
+
import { DataTextureLoader, HalfFloatType, DataUtils, FloatType, LinearFilter } from "three";
|
2
|
+
class RGBELoader extends DataTextureLoader {
|
5
3
|
constructor(manager) {
|
6
4
|
super(manager);
|
7
|
-
this.type =
|
5
|
+
this.type = HalfFloatType;
|
8
6
|
}
|
9
7
|
// adapted from http://www.graphics.cornell.edu/~bjw/rgbe.html
|
10
8
|
parse(buffer) {
|
@@ -175,10 +173,10 @@ class RGBELoader extends THREE.DataTextureLoader {
|
|
175
173
|
const RGBEByteToRGBHalf = function(sourceArray, sourceOffset, destArray, destOffset) {
|
176
174
|
const e = sourceArray[sourceOffset + 3];
|
177
175
|
const scale = Math.pow(2, e - 128) / 255;
|
178
|
-
destArray[destOffset + 0] =
|
179
|
-
destArray[destOffset + 1] =
|
180
|
-
destArray[destOffset + 2] =
|
181
|
-
destArray[destOffset + 3] =
|
176
|
+
destArray[destOffset + 0] = DataUtils.toHalfFloat(Math.min(sourceArray[sourceOffset + 0] * scale, 65504));
|
177
|
+
destArray[destOffset + 1] = DataUtils.toHalfFloat(Math.min(sourceArray[sourceOffset + 1] * scale, 65504));
|
178
|
+
destArray[destOffset + 2] = DataUtils.toHalfFloat(Math.min(sourceArray[sourceOffset + 2] * scale, 65504));
|
179
|
+
destArray[destOffset + 3] = DataUtils.toHalfFloat(1);
|
182
180
|
};
|
183
181
|
const byteArray = new Uint8Array(buffer);
|
184
182
|
byteArray.pos = 0;
|
@@ -189,23 +187,23 @@ class RGBELoader extends THREE.DataTextureLoader {
|
|
189
187
|
let data, type;
|
190
188
|
let numElements;
|
191
189
|
switch (this.type) {
|
192
|
-
case
|
190
|
+
case FloatType:
|
193
191
|
numElements = image_rgba_data.length / 4;
|
194
192
|
const floatArray = new Float32Array(numElements * 4);
|
195
193
|
for (let j = 0; j < numElements; j++) {
|
196
194
|
RGBEByteToRGBFloat(image_rgba_data, j * 4, floatArray, j * 4);
|
197
195
|
}
|
198
196
|
data = floatArray;
|
199
|
-
type =
|
197
|
+
type = FloatType;
|
200
198
|
break;
|
201
|
-
case
|
199
|
+
case HalfFloatType:
|
202
200
|
numElements = image_rgba_data.length / 4;
|
203
201
|
const halfArray = new Uint16Array(numElements * 4);
|
204
202
|
for (let j = 0; j < numElements; j++) {
|
205
203
|
RGBEByteToRGBHalf(image_rgba_data, j * 4, halfArray, j * 4);
|
206
204
|
}
|
207
205
|
data = halfArray;
|
208
|
-
type =
|
206
|
+
type = HalfFloatType;
|
209
207
|
break;
|
210
208
|
default:
|
211
209
|
console.error("THREE.RGBELoader: unsupported type: ", this.type);
|
@@ -231,14 +229,14 @@ class RGBELoader extends THREE.DataTextureLoader {
|
|
231
229
|
load(url, onLoad, onProgress, onError) {
|
232
230
|
function onLoadCallback(texture, texData) {
|
233
231
|
switch (texture.type) {
|
234
|
-
case
|
235
|
-
case
|
232
|
+
case FloatType:
|
233
|
+
case HalfFloatType:
|
236
234
|
if ("colorSpace" in texture)
|
237
235
|
texture.colorSpace = "srgb-linear";
|
238
236
|
else
|
239
237
|
texture.encoding = 3e3;
|
240
|
-
texture.minFilter =
|
241
|
-
texture.magFilter =
|
238
|
+
texture.minFilter = LinearFilter;
|
239
|
+
texture.magFilter = LinearFilter;
|
242
240
|
texture.generateMipmaps = false;
|
243
241
|
texture.flipY = true;
|
244
242
|
break;
|
@@ -249,4 +247,6 @@ class RGBELoader extends THREE.DataTextureLoader {
|
|
249
247
|
return super.load(url, onLoadCallback, onProgress, onError);
|
250
248
|
}
|
251
249
|
}
|
252
|
-
|
250
|
+
export {
|
251
|
+
RGBELoader
|
252
|
+
};
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
3
|
+
const THREE = require("three");
|
2
4
|
let UPNG;
|
3
5
|
function init() {
|
4
6
|
if (UPNG)
|
@@ -922,10 +924,10 @@ function init() {
|
|
922
924
|
return true;
|
923
925
|
};
|
924
926
|
}
|
925
|
-
class RGBMLoader extends DataTextureLoader {
|
927
|
+
class RGBMLoader extends THREE.DataTextureLoader {
|
926
928
|
constructor(manager) {
|
927
929
|
super(manager);
|
928
|
-
this.type = HalfFloatType;
|
930
|
+
this.type = THREE.HalfFloatType;
|
929
931
|
this.maxRange = 7;
|
930
932
|
}
|
931
933
|
setDataType(value) {
|
@@ -937,7 +939,7 @@ class RGBMLoader extends DataTextureLoader {
|
|
937
939
|
return this;
|
938
940
|
}
|
939
941
|
loadCubemap(urls, onLoad, onProgress, onError) {
|
940
|
-
const texture = new CubeTexture();
|
942
|
+
const texture = new THREE.CubeTexture();
|
941
943
|
let loaded = 0;
|
942
944
|
const scope = this;
|
943
945
|
function loadTexture(i) {
|
@@ -960,8 +962,8 @@ class RGBMLoader extends DataTextureLoader {
|
|
960
962
|
loadTexture(i);
|
961
963
|
}
|
962
964
|
texture.type = this.type;
|
963
|
-
texture.format = RGBAFormat;
|
964
|
-
texture.minFilter = LinearFilter;
|
965
|
+
texture.format = THREE.RGBAFormat;
|
966
|
+
texture.minFilter = THREE.LinearFilter;
|
965
967
|
texture.generateMipmaps = false;
|
966
968
|
return texture;
|
967
969
|
}
|
@@ -971,17 +973,17 @@ class RGBMLoader extends DataTextureLoader {
|
|
971
973
|
const rgba = UPNG.toRGBA8(img)[0];
|
972
974
|
const data = new Uint8Array(rgba);
|
973
975
|
const size = img.width * img.height * 4;
|
974
|
-
const output = this.type === HalfFloatType ? new Uint16Array(size) : new Float32Array(size);
|
976
|
+
const output = this.type === THREE.HalfFloatType ? new Uint16Array(size) : new Float32Array(size);
|
975
977
|
for (let i = 0; i < data.length; i += 4) {
|
976
978
|
const r = data[i + 0] / 255;
|
977
979
|
const g = data[i + 1] / 255;
|
978
980
|
const b = data[i + 2] / 255;
|
979
981
|
const a = data[i + 3] / 255;
|
980
|
-
if (this.type === HalfFloatType) {
|
981
|
-
output[i + 0] = DataUtils.toHalfFloat(Math.min(r * a * this.maxRange, 65504));
|
982
|
-
output[i + 1] = DataUtils.toHalfFloat(Math.min(g * a * this.maxRange, 65504));
|
983
|
-
output[i + 2] = DataUtils.toHalfFloat(Math.min(b * a * this.maxRange, 65504));
|
984
|
-
output[i + 3] = DataUtils.toHalfFloat(1);
|
982
|
+
if (this.type === THREE.HalfFloatType) {
|
983
|
+
output[i + 0] = THREE.DataUtils.toHalfFloat(Math.min(r * a * this.maxRange, 65504));
|
984
|
+
output[i + 1] = THREE.DataUtils.toHalfFloat(Math.min(g * a * this.maxRange, 65504));
|
985
|
+
output[i + 2] = THREE.DataUtils.toHalfFloat(Math.min(b * a * this.maxRange, 65504));
|
986
|
+
output[i + 3] = THREE.DataUtils.toHalfFloat(1);
|
985
987
|
} else {
|
986
988
|
output[i + 0] = r * a * this.maxRange;
|
987
989
|
output[i + 1] = g * a * this.maxRange;
|
@@ -993,12 +995,10 @@ class RGBMLoader extends DataTextureLoader {
|
|
993
995
|
width: img.width,
|
994
996
|
height: img.height,
|
995
997
|
data: output,
|
996
|
-
format: RGBAFormat,
|
998
|
+
format: THREE.RGBAFormat,
|
997
999
|
type: this.type,
|
998
1000
|
flipY: true
|
999
1001
|
};
|
1000
1002
|
}
|
1001
1003
|
}
|
1002
|
-
|
1003
|
-
RGBMLoader
|
1004
|
-
};
|
1004
|
+
exports.RGBMLoader = RGBMLoader;
|
@@ -1,6 +1,4 @@
|
|
1
|
-
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
3
|
-
const THREE = require("three");
|
1
|
+
import { DataTextureLoader, HalfFloatType, CubeTexture, RGBAFormat, LinearFilter, DataUtils } from "three";
|
4
2
|
let UPNG;
|
5
3
|
function init() {
|
6
4
|
if (UPNG)
|
@@ -924,10 +922,10 @@ function init() {
|
|
924
922
|
return true;
|
925
923
|
};
|
926
924
|
}
|
927
|
-
class RGBMLoader extends
|
925
|
+
class RGBMLoader extends DataTextureLoader {
|
928
926
|
constructor(manager) {
|
929
927
|
super(manager);
|
930
|
-
this.type =
|
928
|
+
this.type = HalfFloatType;
|
931
929
|
this.maxRange = 7;
|
932
930
|
}
|
933
931
|
setDataType(value) {
|
@@ -939,7 +937,7 @@ class RGBMLoader extends THREE.DataTextureLoader {
|
|
939
937
|
return this;
|
940
938
|
}
|
941
939
|
loadCubemap(urls, onLoad, onProgress, onError) {
|
942
|
-
const texture = new
|
940
|
+
const texture = new CubeTexture();
|
943
941
|
let loaded = 0;
|
944
942
|
const scope = this;
|
945
943
|
function loadTexture(i) {
|
@@ -962,8 +960,8 @@ class RGBMLoader extends THREE.DataTextureLoader {
|
|
962
960
|
loadTexture(i);
|
963
961
|
}
|
964
962
|
texture.type = this.type;
|
965
|
-
texture.format =
|
966
|
-
texture.minFilter =
|
963
|
+
texture.format = RGBAFormat;
|
964
|
+
texture.minFilter = LinearFilter;
|
967
965
|
texture.generateMipmaps = false;
|
968
966
|
return texture;
|
969
967
|
}
|
@@ -973,17 +971,17 @@ class RGBMLoader extends THREE.DataTextureLoader {
|
|
973
971
|
const rgba = UPNG.toRGBA8(img)[0];
|
974
972
|
const data = new Uint8Array(rgba);
|
975
973
|
const size = img.width * img.height * 4;
|
976
|
-
const output = this.type ===
|
974
|
+
const output = this.type === HalfFloatType ? new Uint16Array(size) : new Float32Array(size);
|
977
975
|
for (let i = 0; i < data.length; i += 4) {
|
978
976
|
const r = data[i + 0] / 255;
|
979
977
|
const g = data[i + 1] / 255;
|
980
978
|
const b = data[i + 2] / 255;
|
981
979
|
const a = data[i + 3] / 255;
|
982
|
-
if (this.type ===
|
983
|
-
output[i + 0] =
|
984
|
-
output[i + 1] =
|
985
|
-
output[i + 2] =
|
986
|
-
output[i + 3] =
|
980
|
+
if (this.type === HalfFloatType) {
|
981
|
+
output[i + 0] = DataUtils.toHalfFloat(Math.min(r * a * this.maxRange, 65504));
|
982
|
+
output[i + 1] = DataUtils.toHalfFloat(Math.min(g * a * this.maxRange, 65504));
|
983
|
+
output[i + 2] = DataUtils.toHalfFloat(Math.min(b * a * this.maxRange, 65504));
|
984
|
+
output[i + 3] = DataUtils.toHalfFloat(1);
|
987
985
|
} else {
|
988
986
|
output[i + 0] = r * a * this.maxRange;
|
989
987
|
output[i + 1] = g * a * this.maxRange;
|
@@ -995,10 +993,12 @@ class RGBMLoader extends THREE.DataTextureLoader {
|
|
995
993
|
width: img.width,
|
996
994
|
height: img.height,
|
997
995
|
data: output,
|
998
|
-
format:
|
996
|
+
format: RGBAFormat,
|
999
997
|
type: this.type,
|
1000
998
|
flipY: true
|
1001
999
|
};
|
1002
1000
|
}
|
1003
1001
|
}
|
1004
|
-
|
1002
|
+
export {
|
1003
|
+
RGBMLoader
|
1004
|
+
};
|