@anov/3d 0.0.3 → 0.0.4-alpha12

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.
Files changed (586) hide show
  1. package/README.md +1 -144
  2. package/dist/applicationApi.d.ts +34 -0
  3. package/dist/{core/cssRenderer.js → applicationApi.js} +53 -21
  4. package/dist/environment/index.d.ts +24 -0
  5. package/dist/environment/index.js +84 -0
  6. package/dist/environment/time/index.d.ts +12 -0
  7. package/dist/environment/time/index.js +27 -0
  8. package/dist/environment/weather/type.d.ts +15 -0
  9. package/dist/environment/weather/type.js +27 -0
  10. package/dist/hooksManager.d.ts +2 -0
  11. package/dist/hooksManager.js +15 -0
  12. package/dist/index.d.ts +15 -3
  13. package/dist/index.js +38 -5
  14. package/dist/messageStatus.d.ts +49 -0
  15. package/dist/messageStatus.js +50 -0
  16. package/dist/utils/index.d.ts +11 -44
  17. package/dist/utils/index.js +29 -73
  18. package/dist/utils/messageFn.d.ts +12 -0
  19. package/dist/utils/messageFn.js +33 -0
  20. package/package.json +8 -24
  21. package/dist/commonEnu.d.ts +0 -5
  22. package/dist/commonEnu.js +0 -6
  23. package/dist/core/camera.d.ts +0 -32
  24. package/dist/core/camera.js +0 -74
  25. package/dist/core/control/transformControls.d.ts +0 -12
  26. package/dist/core/control/transformControls.js +0 -72
  27. package/dist/core/cssRenderer.d.ts +0 -17
  28. package/dist/core/global/global.d.ts +0 -27
  29. package/dist/core/global/global.js +0 -72
  30. package/dist/core/global/globalControl.d.ts +0 -17
  31. package/dist/core/global/globalControl.js +0 -62
  32. package/dist/core/group.d.ts +0 -53
  33. package/dist/core/group.js +0 -135
  34. package/dist/core/line.d.ts +0 -13
  35. package/dist/core/line.js +0 -83
  36. package/dist/core/mesh.d.ts +0 -49
  37. package/dist/core/mesh.js +0 -146
  38. package/dist/core/model.d.ts +0 -29
  39. package/dist/core/model.js +0 -85
  40. package/dist/core/scene.d.ts +0 -175
  41. package/dist/core/scene.js +0 -389
  42. package/dist/core/use/useScene.d.ts +0 -10
  43. package/dist/core/use/useScene.js +0 -14
  44. package/dist/core/use/useframe.d.ts +0 -6
  45. package/dist/core/use/useframe.js +0 -11
  46. package/dist/export.d.ts +0 -40
  47. package/dist/export.js +0 -36
  48. package/dist/threeCell.d.ts +0 -8
  49. package/dist/threeCell.js +0 -16
  50. package/dist/type.d.ts +0 -4
  51. package/dist/type.js +0 -1
  52. package/dist/utils/createElement.d.ts +0 -103
  53. package/dist/utils/createElement.js +0 -145
  54. package/dist/utils/createLabel.d.ts +0 -2
  55. package/dist/utils/createLabel.js +0 -4
  56. package/dist/utils/line.d.ts +0 -0
  57. package/dist/utils/line.js +0 -0
  58. package/dist/utils/move.d.ts +0 -48
  59. package/dist/utils/move.js +0 -149
  60. package/examples/fonts/LICENSE +0 -13
  61. package/examples/fonts/README.md +0 -11
  62. package/examples/fonts/droid/NOTICE +0 -190
  63. package/examples/fonts/droid/README.txt +0 -18
  64. package/examples/fonts/droid/droid_sans_bold.typeface.json +0 -1
  65. package/examples/fonts/droid/droid_sans_mono_regular.typeface.json +0 -1
  66. package/examples/fonts/droid/droid_sans_regular.typeface.json +0 -1
  67. package/examples/fonts/droid/droid_serif_bold.typeface.json +0 -1
  68. package/examples/fonts/droid/droid_serif_regular.typeface.json +0 -1
  69. package/examples/fonts/gentilis_bold.typeface.json +0 -1
  70. package/examples/fonts/gentilis_regular.typeface.json +0 -1
  71. package/examples/fonts/helvetiker_bold.typeface.json +0 -1
  72. package/examples/fonts/helvetiker_regular.typeface.json +0 -1
  73. package/examples/fonts/optimer_bold.typeface.json +0 -1
  74. package/examples/fonts/optimer_regular.typeface.json +0 -1
  75. package/examples/fonts/ttf/README.md +0 -9
  76. package/examples/fonts/ttf/kenpixel.ttf +0 -0
  77. package/examples/jsm/animation/AnimationClipCreator.js +0 -116
  78. package/examples/jsm/animation/CCDIKSolver.js +0 -482
  79. package/examples/jsm/animation/MMDAnimationHelper.js +0 -1207
  80. package/examples/jsm/animation/MMDPhysics.js +0 -1406
  81. package/examples/jsm/cameras/CinematicCamera.js +0 -208
  82. package/examples/jsm/capabilities/WebGL.js +0 -91
  83. package/examples/jsm/capabilities/WebGPU.js +0 -53
  84. package/examples/jsm/controls/ArcballControls.js +0 -3224
  85. package/examples/jsm/controls/DragControls.js +0 -220
  86. package/examples/jsm/controls/FirstPersonControls.js +0 -325
  87. package/examples/jsm/controls/FlyControls.js +0 -300
  88. package/examples/jsm/controls/MapControls.js +0 -28
  89. package/examples/jsm/controls/OrbitControls.js +0 -1388
  90. package/examples/jsm/controls/PointerLockControls.js +0 -162
  91. package/examples/jsm/controls/TrackballControls.js +0 -828
  92. package/examples/jsm/controls/TransformControls.js +0 -1557
  93. package/examples/jsm/csm/CSM.js +0 -384
  94. package/examples/jsm/csm/CSMFrustum.js +0 -152
  95. package/examples/jsm/csm/CSMHelper.js +0 -193
  96. package/examples/jsm/csm/CSMShader.js +0 -252
  97. package/examples/jsm/curves/CurveExtras.js +0 -422
  98. package/examples/jsm/curves/NURBSCurve.js +0 -80
  99. package/examples/jsm/curves/NURBSSurface.js +0 -52
  100. package/examples/jsm/curves/NURBSUtils.js +0 -487
  101. package/examples/jsm/effects/AnaglyphEffect.js +0 -154
  102. package/examples/jsm/effects/AsciiEffect.js +0 -263
  103. package/examples/jsm/effects/OutlineEffect.js +0 -539
  104. package/examples/jsm/effects/ParallaxBarrierEffect.js +0 -119
  105. package/examples/jsm/effects/PeppersGhostEffect.js +0 -153
  106. package/examples/jsm/effects/StereoEffect.js +0 -55
  107. package/examples/jsm/environments/DebugEnvironment.js +0 -52
  108. package/examples/jsm/environments/RoomEnvironment.js +0 -148
  109. package/examples/jsm/exporters/DRACOExporter.js +0 -267
  110. package/examples/jsm/exporters/EXRExporter.js +0 -501
  111. package/examples/jsm/exporters/GLTFExporter.js +0 -3161
  112. package/examples/jsm/exporters/KTX2Exporter.js +0 -292
  113. package/examples/jsm/exporters/MMDExporter.js +0 -217
  114. package/examples/jsm/exporters/OBJExporter.js +0 -284
  115. package/examples/jsm/exporters/PLYExporter.js +0 -528
  116. package/examples/jsm/exporters/STLExporter.js +0 -199
  117. package/examples/jsm/exporters/USDZExporter.js +0 -711
  118. package/examples/jsm/geometries/BoxLineGeometry.js +0 -69
  119. package/examples/jsm/geometries/ConvexGeometry.js +0 -53
  120. package/examples/jsm/geometries/DecalGeometry.js +0 -356
  121. package/examples/jsm/geometries/ParametricGeometries.js +0 -254
  122. package/examples/jsm/geometries/ParametricGeometry.js +0 -139
  123. package/examples/jsm/geometries/RoundedBoxGeometry.js +0 -155
  124. package/examples/jsm/geometries/TeapotGeometry.js +0 -704
  125. package/examples/jsm/geometries/TextGeometry.js +0 -57
  126. package/examples/jsm/helpers/LightProbeHelper.js +0 -130
  127. package/examples/jsm/helpers/OctreeHelper.js +0 -73
  128. package/examples/jsm/helpers/PositionalAudioHelper.js +0 -109
  129. package/examples/jsm/helpers/RectAreaLightHelper.js +0 -85
  130. package/examples/jsm/helpers/VertexNormalsHelper.js +0 -96
  131. package/examples/jsm/helpers/VertexTangentsHelper.js +0 -88
  132. package/examples/jsm/helpers/ViewHelper.js +0 -333
  133. package/examples/jsm/interactive/HTMLMesh.js +0 -565
  134. package/examples/jsm/interactive/InteractiveGroup.js +0 -116
  135. package/examples/jsm/interactive/SelectionBox.js +0 -227
  136. package/examples/jsm/interactive/SelectionHelper.js +0 -104
  137. package/examples/jsm/libs/ammo.wasm.js +0 -822
  138. package/examples/jsm/libs/ammo.wasm.wasm +0 -0
  139. package/examples/jsm/libs/basis/README.md +0 -46
  140. package/examples/jsm/libs/basis/basis_transcoder.js +0 -21
  141. package/examples/jsm/libs/basis/basis_transcoder.wasm +0 -0
  142. package/examples/jsm/libs/chevrotain.module.min.js +0 -141
  143. package/examples/jsm/libs/draco/README.md +0 -32
  144. package/examples/jsm/libs/draco/draco_decoder.js +0 -34
  145. package/examples/jsm/libs/draco/draco_decoder.wasm +0 -0
  146. package/examples/jsm/libs/draco/draco_encoder.js +0 -33
  147. package/examples/jsm/libs/draco/draco_wasm_wrapper.js +0 -117
  148. package/examples/jsm/libs/draco/gltf/draco_decoder.js +0 -33
  149. package/examples/jsm/libs/draco/gltf/draco_decoder.wasm +0 -0
  150. package/examples/jsm/libs/draco/gltf/draco_encoder.js +0 -33
  151. package/examples/jsm/libs/draco/gltf/draco_wasm_wrapper.js +0 -116
  152. package/examples/jsm/libs/ecsy.module.js +0 -1792
  153. package/examples/jsm/libs/fflate.module.js +0 -2474
  154. package/examples/jsm/libs/ktx-parse.module.js +0 -1
  155. package/examples/jsm/libs/lil-gui.module.min.js +0 -8
  156. package/examples/jsm/libs/lottie_canvas.module.js +0 -14844
  157. package/examples/jsm/libs/meshopt_decoder.module.js +0 -178
  158. package/examples/jsm/libs/mikktspace.module.js +0 -128
  159. package/examples/jsm/libs/mmdparser.module.js +0 -11530
  160. package/examples/jsm/libs/motion-controllers.module.js +0 -397
  161. package/examples/jsm/libs/opentype.module.js +0 -14568
  162. package/examples/jsm/libs/potpack.module.js +0 -125
  163. package/examples/jsm/libs/rhino3dm/rhino3dm.js +0 -21
  164. package/examples/jsm/libs/rhino3dm/rhino3dm.module.js +0 -16
  165. package/examples/jsm/libs/rhino3dm/rhino3dm.wasm +0 -0
  166. package/examples/jsm/libs/stats.module.js +0 -167
  167. package/examples/jsm/libs/tween.module.js +0 -803
  168. package/examples/jsm/libs/utif.module.js +0 -1579
  169. package/examples/jsm/libs/zstddec.module.js +0 -1
  170. package/examples/jsm/lights/IESSpotLight.js +0 -25
  171. package/examples/jsm/lights/LightProbeGenerator.js +0 -252
  172. package/examples/jsm/lights/RectAreaLightUniformsLib.js +0 -79
  173. package/examples/jsm/lines/Line2.js +0 -19
  174. package/examples/jsm/lines/LineGeometry.js +0 -79
  175. package/examples/jsm/lines/LineMaterial.js +0 -702
  176. package/examples/jsm/lines/LineSegments2.js +0 -361
  177. package/examples/jsm/lines/LineSegmentsGeometry.js +0 -241
  178. package/examples/jsm/lines/Wireframe.js +0 -56
  179. package/examples/jsm/lines/WireframeGeometry2.js +0 -24
  180. package/examples/jsm/loaders/3DMLoader.js +0 -1497
  181. package/examples/jsm/loaders/3MFLoader.js +0 -1478
  182. package/examples/jsm/loaders/AMFLoader.js +0 -521
  183. package/examples/jsm/loaders/BVHLoader.js +0 -437
  184. package/examples/jsm/loaders/ColladaLoader.js +0 -4122
  185. package/examples/jsm/loaders/DDSLoader.js +0 -274
  186. package/examples/jsm/loaders/DRACOLoader.js +0 -612
  187. package/examples/jsm/loaders/EXRLoader.js +0 -2309
  188. package/examples/jsm/loaders/FBXLoader.js +0 -4142
  189. package/examples/jsm/loaders/FontLoader.js +0 -183
  190. package/examples/jsm/loaders/GCodeLoader.js +0 -261
  191. package/examples/jsm/loaders/GLTFLoader.js +0 -4576
  192. package/examples/jsm/loaders/HDRCubeTextureLoader.js +0 -115
  193. package/examples/jsm/loaders/IESLoader.js +0 -337
  194. package/examples/jsm/loaders/KMZLoader.js +0 -130
  195. package/examples/jsm/loaders/KTX2Loader.js +0 -868
  196. package/examples/jsm/loaders/KTXLoader.js +0 -176
  197. package/examples/jsm/loaders/LDrawLoader.js +0 -2464
  198. package/examples/jsm/loaders/LUT3dlLoader.js +0 -151
  199. package/examples/jsm/loaders/LUTCubeLoader.js +0 -153
  200. package/examples/jsm/loaders/LWOLoader.js +0 -1052
  201. package/examples/jsm/loaders/LogLuvLoader.js +0 -606
  202. package/examples/jsm/loaders/LottieLoader.js +0 -77
  203. package/examples/jsm/loaders/MD2Loader.js +0 -399
  204. package/examples/jsm/loaders/MDDLoader.js +0 -102
  205. package/examples/jsm/loaders/MMDLoader.js +0 -2273
  206. package/examples/jsm/loaders/MTLLoader.js +0 -567
  207. package/examples/jsm/loaders/MaterialXLoader.js +0 -734
  208. package/examples/jsm/loaders/NRRDLoader.js +0 -699
  209. package/examples/jsm/loaders/OBJLoader.js +0 -905
  210. package/examples/jsm/loaders/PCDLoader.js +0 -467
  211. package/examples/jsm/loaders/PDBLoader.js +0 -232
  212. package/examples/jsm/loaders/PLYLoader.js +0 -771
  213. package/examples/jsm/loaders/PVRLoader.js +0 -251
  214. package/examples/jsm/loaders/RGBELoader.js +0 -468
  215. package/examples/jsm/loaders/RGBMLoader.js +0 -1065
  216. package/examples/jsm/loaders/STLLoader.js +0 -403
  217. package/examples/jsm/loaders/SVGLoader.js +0 -3172
  218. package/examples/jsm/loaders/TDSLoader.js +0 -1124
  219. package/examples/jsm/loaders/TGALoader.js +0 -517
  220. package/examples/jsm/loaders/TIFFLoader.js +0 -36
  221. package/examples/jsm/loaders/TTFLoader.js +0 -214
  222. package/examples/jsm/loaders/TiltLoader.js +0 -520
  223. package/examples/jsm/loaders/USDZLoader.js +0 -633
  224. package/examples/jsm/loaders/VOXLoader.js +0 -311
  225. package/examples/jsm/loaders/VRMLLoader.js +0 -3533
  226. package/examples/jsm/loaders/VTKLoader.js +0 -1163
  227. package/examples/jsm/loaders/XYZLoader.js +0 -106
  228. package/examples/jsm/loaders/lwo/IFFParser.js +0 -1218
  229. package/examples/jsm/loaders/lwo/LWO2Parser.js +0 -414
  230. package/examples/jsm/loaders/lwo/LWO3Parser.js +0 -373
  231. package/examples/jsm/materials/MeshGouraudMaterial.js +0 -420
  232. package/examples/jsm/math/Capsule.js +0 -137
  233. package/examples/jsm/math/ColorConverter.js +0 -36
  234. package/examples/jsm/math/ConvexHull.js +0 -1271
  235. package/examples/jsm/math/ImprovedNoise.js +0 -71
  236. package/examples/jsm/math/Lut.js +0 -204
  237. package/examples/jsm/math/MeshSurfaceSampler.js +0 -250
  238. package/examples/jsm/math/OBB.js +0 -423
  239. package/examples/jsm/math/Octree.js +0 -462
  240. package/examples/jsm/math/SimplexNoise.js +0 -444
  241. package/examples/jsm/misc/ConvexObjectBreaker.js +0 -519
  242. package/examples/jsm/misc/GPUComputationRenderer.js +0 -446
  243. package/examples/jsm/misc/Gyroscope.js +0 -66
  244. package/examples/jsm/misc/MD2Character.js +0 -276
  245. package/examples/jsm/misc/MD2CharacterComplex.js +0 -576
  246. package/examples/jsm/misc/MorphAnimMesh.js +0 -75
  247. package/examples/jsm/misc/MorphBlendMesh.js +0 -322
  248. package/examples/jsm/misc/ProgressiveLightMap.js +0 -323
  249. package/examples/jsm/misc/RollerCoaster.js +0 -566
  250. package/examples/jsm/misc/TubePainter.js +0 -205
  251. package/examples/jsm/misc/Volume.js +0 -473
  252. package/examples/jsm/misc/VolumeSlice.js +0 -229
  253. package/examples/jsm/modifiers/CurveModifier.js +0 -326
  254. package/examples/jsm/modifiers/EdgeSplitModifier.js +0 -279
  255. package/examples/jsm/modifiers/SimplifyModifier.js +0 -525
  256. package/examples/jsm/modifiers/TessellateModifier.js +0 -307
  257. package/examples/jsm/nodes/Nodes.js +0 -171
  258. package/examples/jsm/nodes/accessors/BitangentNode.js +0 -89
  259. package/examples/jsm/nodes/accessors/BufferAttributeNode.js +0 -99
  260. package/examples/jsm/nodes/accessors/BufferNode.js +0 -30
  261. package/examples/jsm/nodes/accessors/CameraNode.js +0 -98
  262. package/examples/jsm/nodes/accessors/CubeTextureNode.js +0 -103
  263. package/examples/jsm/nodes/accessors/ExtendedMaterialNode.js +0 -77
  264. package/examples/jsm/nodes/accessors/InstanceNode.js +0 -71
  265. package/examples/jsm/nodes/accessors/MaterialNode.js +0 -267
  266. package/examples/jsm/nodes/accessors/MaterialReferenceNode.js +0 -39
  267. package/examples/jsm/nodes/accessors/ModelNode.js +0 -34
  268. package/examples/jsm/nodes/accessors/ModelViewProjectionNode.js +0 -29
  269. package/examples/jsm/nodes/accessors/MorphNode.js +0 -70
  270. package/examples/jsm/nodes/accessors/NormalNode.js +0 -96
  271. package/examples/jsm/nodes/accessors/Object3DNode.js +0 -150
  272. package/examples/jsm/nodes/accessors/PointUVNode.js +0 -26
  273. package/examples/jsm/nodes/accessors/PositionNode.js +0 -104
  274. package/examples/jsm/nodes/accessors/ReferenceNode.js +0 -72
  275. package/examples/jsm/nodes/accessors/ReflectVectorNode.js +0 -35
  276. package/examples/jsm/nodes/accessors/SceneNode.js +0 -52
  277. package/examples/jsm/nodes/accessors/SkinningNode.js +0 -93
  278. package/examples/jsm/nodes/accessors/StorageBufferNode.js +0 -27
  279. package/examples/jsm/nodes/accessors/TangentNode.js +0 -103
  280. package/examples/jsm/nodes/accessors/TextureBicubicNode.js +0 -94
  281. package/examples/jsm/nodes/accessors/TextureNode.js +0 -271
  282. package/examples/jsm/nodes/accessors/TextureSizeNode.js +0 -35
  283. package/examples/jsm/nodes/accessors/UVNode.js +0 -47
  284. package/examples/jsm/nodes/accessors/UserDataNode.js +0 -29
  285. package/examples/jsm/nodes/code/CodeNode.js +0 -78
  286. package/examples/jsm/nodes/code/ExpressionNode.js +0 -37
  287. package/examples/jsm/nodes/code/FunctionCallNode.js +0 -96
  288. package/examples/jsm/nodes/code/FunctionNode.js +0 -127
  289. package/examples/jsm/nodes/code/ScriptableNode.js +0 -488
  290. package/examples/jsm/nodes/code/ScriptableValueNode.js +0 -167
  291. package/examples/jsm/nodes/core/ArrayUniformNode.js +0 -26
  292. package/examples/jsm/nodes/core/AttributeNode.js +0 -102
  293. package/examples/jsm/nodes/core/BypassNode.js +0 -45
  294. package/examples/jsm/nodes/core/CacheNode.js +0 -46
  295. package/examples/jsm/nodes/core/ConstNode.js +0 -32
  296. package/examples/jsm/nodes/core/ContextNode.js +0 -61
  297. package/examples/jsm/nodes/core/IndexNode.js +0 -66
  298. package/examples/jsm/nodes/core/InputNode.js +0 -83
  299. package/examples/jsm/nodes/core/LightingModel.js +0 -15
  300. package/examples/jsm/nodes/core/Node.js +0 -454
  301. package/examples/jsm/nodes/core/NodeAttribute.js +0 -15
  302. package/examples/jsm/nodes/core/NodeBuilder.js +0 -1016
  303. package/examples/jsm/nodes/core/NodeCache.js +0 -26
  304. package/examples/jsm/nodes/core/NodeCode.js +0 -15
  305. package/examples/jsm/nodes/core/NodeFrame.js +0 -110
  306. package/examples/jsm/nodes/core/NodeFunction.js +0 -22
  307. package/examples/jsm/nodes/core/NodeFunctionInput.js +0 -17
  308. package/examples/jsm/nodes/core/NodeKeywords.js +0 -80
  309. package/examples/jsm/nodes/core/NodeParser.js +0 -11
  310. package/examples/jsm/nodes/core/NodeUniform.js +0 -28
  311. package/examples/jsm/nodes/core/NodeUtils.js +0 -212
  312. package/examples/jsm/nodes/core/NodeVar.js +0 -14
  313. package/examples/jsm/nodes/core/NodeVarying.js +0 -17
  314. package/examples/jsm/nodes/core/PropertyNode.js +0 -61
  315. package/examples/jsm/nodes/core/StackNode.js +0 -99
  316. package/examples/jsm/nodes/core/TempNode.js +0 -58
  317. package/examples/jsm/nodes/core/UniformNode.js +0 -61
  318. package/examples/jsm/nodes/core/VarNode.js +0 -87
  319. package/examples/jsm/nodes/core/VaryingNode.js +0 -69
  320. package/examples/jsm/nodes/core/constants.js +0 -27
  321. package/examples/jsm/nodes/display/BlendModeNode.js +0 -99
  322. package/examples/jsm/nodes/display/BumpMapNode.js +0 -77
  323. package/examples/jsm/nodes/display/ColorAdjustmentNode.js +0 -100
  324. package/examples/jsm/nodes/display/ColorSpaceNode.js +0 -108
  325. package/examples/jsm/nodes/display/FrontFacingNode.js +0 -27
  326. package/examples/jsm/nodes/display/NormalMapNode.js +0 -106
  327. package/examples/jsm/nodes/display/PosterizeNode.js +0 -32
  328. package/examples/jsm/nodes/display/ToneMappingNode.js +0 -141
  329. package/examples/jsm/nodes/display/ViewportDepthNode.js +0 -69
  330. package/examples/jsm/nodes/display/ViewportDepthTextureNode.js +0 -34
  331. package/examples/jsm/nodes/display/ViewportNode.js +0 -115
  332. package/examples/jsm/nodes/display/ViewportSharedTextureNode.js +0 -31
  333. package/examples/jsm/nodes/display/ViewportTextureNode.js +0 -75
  334. package/examples/jsm/nodes/fog/FogExp2Node.js +0 -35
  335. package/examples/jsm/nodes/fog/FogNode.js +0 -37
  336. package/examples/jsm/nodes/fog/FogRangeNode.js +0 -34
  337. package/examples/jsm/nodes/functions/BSDF/BRDF_GGX.js +0 -40
  338. package/examples/jsm/nodes/functions/BSDF/BRDF_Lambert.js +0 -9
  339. package/examples/jsm/nodes/functions/BSDF/BRDF_Sheen.js +0 -43
  340. package/examples/jsm/nodes/functions/BSDF/DFGApprox.js +0 -29
  341. package/examples/jsm/nodes/functions/BSDF/D_GGX.js +0 -18
  342. package/examples/jsm/nodes/functions/BSDF/EnvironmentBRDF.js +0 -13
  343. package/examples/jsm/nodes/functions/BSDF/F_Schlick.js +0 -16
  344. package/examples/jsm/nodes/functions/BSDF/Schlick_to_F0.js +0 -13
  345. package/examples/jsm/nodes/functions/BSDF/V_GGX_SmithCorrelated.js +0 -20
  346. package/examples/jsm/nodes/functions/PhongLightingModel.js +0 -67
  347. package/examples/jsm/nodes/functions/PhysicalLightingModel.js +0 -343
  348. package/examples/jsm/nodes/functions/material/getGeometryRoughness.js +0 -13
  349. package/examples/jsm/nodes/functions/material/getRoughness.js +0 -18
  350. package/examples/jsm/nodes/geometry/RangeNode.js +0 -104
  351. package/examples/jsm/nodes/gpgpu/ComputeNode.js +0 -85
  352. package/examples/jsm/nodes/lighting/AONode.js +0 -27
  353. package/examples/jsm/nodes/lighting/AmbientLightNode.js +0 -27
  354. package/examples/jsm/nodes/lighting/AnalyticLightNode.js +0 -184
  355. package/examples/jsm/nodes/lighting/DirectionalLightNode.js +0 -40
  356. package/examples/jsm/nodes/lighting/EnvironmentNode.js +0 -191
  357. package/examples/jsm/nodes/lighting/HemisphereLightNode.js +0 -55
  358. package/examples/jsm/nodes/lighting/IESSpotLightNode.js +0 -39
  359. package/examples/jsm/nodes/lighting/LightNode.js +0 -57
  360. package/examples/jsm/nodes/lighting/LightUtils.js +0 -17
  361. package/examples/jsm/nodes/lighting/LightingContextNode.js +0 -102
  362. package/examples/jsm/nodes/lighting/LightingNode.js +0 -21
  363. package/examples/jsm/nodes/lighting/LightsNode.js +0 -128
  364. package/examples/jsm/nodes/lighting/PointLightNode.js +0 -68
  365. package/examples/jsm/nodes/lighting/SpotLightNode.js +0 -89
  366. package/examples/jsm/nodes/loaders/NodeLoader.js +0 -108
  367. package/examples/jsm/nodes/loaders/NodeMaterialLoader.js +0 -59
  368. package/examples/jsm/nodes/loaders/NodeObjectLoader.js +0 -70
  369. package/examples/jsm/nodes/materials/LineBasicNodeMaterial.js +0 -28
  370. package/examples/jsm/nodes/materials/Materials.js +0 -12
  371. package/examples/jsm/nodes/materials/MeshBasicNodeMaterial.js +0 -27
  372. package/examples/jsm/nodes/materials/MeshLambertNodeMaterial.js +0 -34
  373. package/examples/jsm/nodes/materials/MeshNormalNodeMaterial.js +0 -40
  374. package/examples/jsm/nodes/materials/MeshPhongNodeMaterial.js +0 -65
  375. package/examples/jsm/nodes/materials/MeshPhysicalNodeMaterial.js +0 -128
  376. package/examples/jsm/nodes/materials/MeshStandardNodeMaterial.js +0 -80
  377. package/examples/jsm/nodes/materials/NodeMaterial.js +0 -536
  378. package/examples/jsm/nodes/materials/PointsNodeMaterial.js +0 -49
  379. package/examples/jsm/nodes/materials/SpriteNodeMaterial.js +0 -103
  380. package/examples/jsm/nodes/materialx/DISCLAIMER.md +0 -199
  381. package/examples/jsm/nodes/materialx/MaterialXNodes.js +0 -68
  382. package/examples/jsm/nodes/materialx/lib/mx_hsv.js +0 -56
  383. package/examples/jsm/nodes/materialx/lib/mx_noise.js +0 -618
  384. package/examples/jsm/nodes/materialx/lib/mx_transform_color.js +0 -19
  385. package/examples/jsm/nodes/math/CondNode.js +0 -86
  386. package/examples/jsm/nodes/math/MathNode.js +0 -359
  387. package/examples/jsm/nodes/math/OperatorNode.js +0 -269
  388. package/examples/jsm/nodes/parsers/GLSLNodeFunction.js +0 -152
  389. package/examples/jsm/nodes/parsers/GLSLNodeParser.js +0 -14
  390. package/examples/jsm/nodes/procedural/CheckerNode.js +0 -42
  391. package/examples/jsm/nodes/shadernode/ShaderNode.js +0 -420
  392. package/examples/jsm/nodes/utils/ArrayElementNode.js +0 -33
  393. package/examples/jsm/nodes/utils/ConvertNode.js +0 -65
  394. package/examples/jsm/nodes/utils/DiscardNode.js +0 -26
  395. package/examples/jsm/nodes/utils/EquirectUVNode.js +0 -33
  396. package/examples/jsm/nodes/utils/JoinNode.js +0 -51
  397. package/examples/jsm/nodes/utils/LoopNode.js +0 -186
  398. package/examples/jsm/nodes/utils/MatcapUVNode.js +0 -30
  399. package/examples/jsm/nodes/utils/MaxMipLevelNode.js +0 -46
  400. package/examples/jsm/nodes/utils/OscNode.js +0 -81
  401. package/examples/jsm/nodes/utils/PackingNode.js +0 -55
  402. package/examples/jsm/nodes/utils/RemapNode.js +0 -42
  403. package/examples/jsm/nodes/utils/RotateUVNode.js +0 -43
  404. package/examples/jsm/nodes/utils/SpecularMIPLevelNode.js +0 -37
  405. package/examples/jsm/nodes/utils/SplitNode.js +0 -104
  406. package/examples/jsm/nodes/utils/SpriteSheetUVNode.js +0 -41
  407. package/examples/jsm/nodes/utils/TimerNode.js +0 -94
  408. package/examples/jsm/nodes/utils/TriplanarTexturesNode.js +0 -62
  409. package/examples/jsm/objects/GroundProjectedSkybox.js +0 -172
  410. package/examples/jsm/objects/Lensflare.js +0 -377
  411. package/examples/jsm/objects/MarchingCubes.js +0 -1176
  412. package/examples/jsm/objects/Reflector.js +0 -264
  413. package/examples/jsm/objects/ReflectorForSSRPass.js +0 -349
  414. package/examples/jsm/objects/Refractor.js +0 -324
  415. package/examples/jsm/objects/ShadowMesh.js +0 -80
  416. package/examples/jsm/objects/Sky.js +0 -219
  417. package/examples/jsm/objects/Water.js +0 -330
  418. package/examples/jsm/objects/Water2.js +0 -358
  419. package/examples/jsm/offscreen/jank.js +0 -45
  420. package/examples/jsm/offscreen/offscreen.js +0 -8
  421. package/examples/jsm/offscreen/scene.js +0 -86
  422. package/examples/jsm/physics/AmmoPhysics.js +0 -285
  423. package/examples/jsm/physics/RapierPhysics.js +0 -199
  424. package/examples/jsm/postprocessing/AfterimagePass.js +0 -104
  425. package/examples/jsm/postprocessing/BloomPass.js +0 -172
  426. package/examples/jsm/postprocessing/BokehPass.js +0 -140
  427. package/examples/jsm/postprocessing/ClearPass.js +0 -46
  428. package/examples/jsm/postprocessing/CubeTexturePass.js +0 -85
  429. package/examples/jsm/postprocessing/DotScreenPass.js +0 -65
  430. package/examples/jsm/postprocessing/EffectComposer.js +0 -231
  431. package/examples/jsm/postprocessing/FilmPass.js +0 -66
  432. package/examples/jsm/postprocessing/GlitchPass.js +0 -128
  433. package/examples/jsm/postprocessing/HalftonePass.js +0 -79
  434. package/examples/jsm/postprocessing/LUTPass.js +0 -173
  435. package/examples/jsm/postprocessing/MaskPass.js +0 -104
  436. package/examples/jsm/postprocessing/OutlinePass.js +0 -654
  437. package/examples/jsm/postprocessing/OutputPass.js +0 -91
  438. package/examples/jsm/postprocessing/Pass.js +0 -84
  439. package/examples/jsm/postprocessing/RenderPass.js +0 -81
  440. package/examples/jsm/postprocessing/RenderPixelatedPass.js +0 -235
  441. package/examples/jsm/postprocessing/SAOPass.js +0 -411
  442. package/examples/jsm/postprocessing/SMAAPass.js +0 -201
  443. package/examples/jsm/postprocessing/SSAARenderPass.js +0 -228
  444. package/examples/jsm/postprocessing/SSAOPass.js +0 -440
  445. package/examples/jsm/postprocessing/SSRPass.js +0 -641
  446. package/examples/jsm/postprocessing/SavePass.js +0 -79
  447. package/examples/jsm/postprocessing/ShaderPass.js +0 -77
  448. package/examples/jsm/postprocessing/TAARenderPass.js +0 -189
  449. package/examples/jsm/postprocessing/TexturePass.js +0 -67
  450. package/examples/jsm/postprocessing/UnrealBloomPass.js +0 -415
  451. package/examples/jsm/renderers/CSS2DRenderer.js +0 -215
  452. package/examples/jsm/renderers/CSS3DRenderer.js +0 -335
  453. package/examples/jsm/renderers/Projector.js +0 -918
  454. package/examples/jsm/renderers/SVGRenderer.js +0 -553
  455. package/examples/jsm/renderers/common/Animation.js +0 -58
  456. package/examples/jsm/renderers/common/Attributes.js +0 -75
  457. package/examples/jsm/renderers/common/Backend.js +0 -162
  458. package/examples/jsm/renderers/common/Background.js +0 -136
  459. package/examples/jsm/renderers/common/Binding.js +0 -19
  460. package/examples/jsm/renderers/common/Bindings.js +0 -165
  461. package/examples/jsm/renderers/common/Buffer.js +0 -38
  462. package/examples/jsm/renderers/common/BufferUtils.js +0 -33
  463. package/examples/jsm/renderers/common/ChainMap.js +0 -89
  464. package/examples/jsm/renderers/common/ComputePipeline.js +0 -17
  465. package/examples/jsm/renderers/common/Constants.js +0 -14
  466. package/examples/jsm/renderers/common/CubeRenderTarget.js +0 -65
  467. package/examples/jsm/renderers/common/DataMap.js +0 -54
  468. package/examples/jsm/renderers/common/Geometries.js +0 -215
  469. package/examples/jsm/renderers/common/Info.js +0 -73
  470. package/examples/jsm/renderers/common/Pipeline.js +0 -13
  471. package/examples/jsm/renderers/common/Pipelines.js +0 -370
  472. package/examples/jsm/renderers/common/ProgrammableStage.js +0 -18
  473. package/examples/jsm/renderers/common/RenderContext.js +0 -38
  474. package/examples/jsm/renderers/common/RenderContexts.js +0 -49
  475. package/examples/jsm/renderers/common/RenderList.js +0 -178
  476. package/examples/jsm/renderers/common/RenderLists.js +0 -38
  477. package/examples/jsm/renderers/common/RenderObject.js +0 -129
  478. package/examples/jsm/renderers/common/RenderObjects.js +0 -95
  479. package/examples/jsm/renderers/common/RenderPipeline.js +0 -16
  480. package/examples/jsm/renderers/common/Renderer.js +0 -895
  481. package/examples/jsm/renderers/common/SampledTexture.js +0 -80
  482. package/examples/jsm/renderers/common/Sampler.js +0 -18
  483. package/examples/jsm/renderers/common/StorageBuffer.js +0 -17
  484. package/examples/jsm/renderers/common/Textures.js +0 -218
  485. package/examples/jsm/renderers/common/Uniform.js +0 -140
  486. package/examples/jsm/renderers/common/UniformBuffer.js +0 -15
  487. package/examples/jsm/renderers/common/UniformsGroup.js +0 -299
  488. package/examples/jsm/renderers/common/nodes/NodeSampledTexture.js +0 -39
  489. package/examples/jsm/renderers/common/nodes/NodeSampler.js +0 -21
  490. package/examples/jsm/renderers/common/nodes/NodeUniform.js +0 -135
  491. package/examples/jsm/renderers/common/nodes/Nodes.js +0 -330
  492. package/examples/jsm/renderers/webgl/nodes/GLSLNodeBuilder.js +0 -340
  493. package/examples/jsm/renderers/webgl/nodes/SlotNode.js +0 -26
  494. package/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.js +0 -764
  495. package/examples/jsm/renderers/webgl/nodes/WebGLNodes.js +0 -49
  496. package/examples/jsm/renderers/webgpu/WebGPUBackend.js +0 -844
  497. package/examples/jsm/renderers/webgpu/WebGPURenderer.js +0 -32
  498. package/examples/jsm/renderers/webgpu/nodes/WGSLNodeBuilder.js +0 -902
  499. package/examples/jsm/renderers/webgpu/nodes/WGSLNodeFunction.js +0 -104
  500. package/examples/jsm/renderers/webgpu/nodes/WGSLNodeParser.js +0 -14
  501. package/examples/jsm/renderers/webgpu/utils/WebGPUAttributeUtils.js +0 -274
  502. package/examples/jsm/renderers/webgpu/utils/WebGPUBindingUtils.js +0 -223
  503. package/examples/jsm/renderers/webgpu/utils/WebGPUConstants.js +0 -324
  504. package/examples/jsm/renderers/webgpu/utils/WebGPUPipelineUtils.js +0 -533
  505. package/examples/jsm/renderers/webgpu/utils/WebGPUTextureMipmapUtils.js +0 -163
  506. package/examples/jsm/renderers/webgpu/utils/WebGPUTextureUtils.js +0 -964
  507. package/examples/jsm/renderers/webgpu/utils/WebGPUUtils.js +0 -92
  508. package/examples/jsm/shaders/ACESFilmicToneMappingShader.js +0 -87
  509. package/examples/jsm/shaders/AfterimageShader.js +0 -56
  510. package/examples/jsm/shaders/BasicShader.js +0 -27
  511. package/examples/jsm/shaders/BleachBypassShader.js +0 -62
  512. package/examples/jsm/shaders/BlendShader.js +0 -47
  513. package/examples/jsm/shaders/BokehShader.js +0 -143
  514. package/examples/jsm/shaders/BokehShader2.js +0 -393
  515. package/examples/jsm/shaders/BrightnessContrastShader.js +0 -54
  516. package/examples/jsm/shaders/ColorCorrectionShader.js +0 -50
  517. package/examples/jsm/shaders/ColorifyShader.js +0 -51
  518. package/examples/jsm/shaders/ConvolutionShader.js +0 -103
  519. package/examples/jsm/shaders/CopyShader.js +0 -45
  520. package/examples/jsm/shaders/DOFMipMapShader.js +0 -54
  521. package/examples/jsm/shaders/DepthLimitedBlurShader.js +0 -166
  522. package/examples/jsm/shaders/DigitalGlitch.js +0 -101
  523. package/examples/jsm/shaders/DotScreenShader.js +0 -70
  524. package/examples/jsm/shaders/ExposureShader.js +0 -44
  525. package/examples/jsm/shaders/FXAAShader.js +0 -286
  526. package/examples/jsm/shaders/FilmShader.js +0 -102
  527. package/examples/jsm/shaders/FocusShader.js +0 -87
  528. package/examples/jsm/shaders/FreiChenShader.js +0 -94
  529. package/examples/jsm/shaders/GammaCorrectionShader.js +0 -43
  530. package/examples/jsm/shaders/GodRaysShader.js +0 -313
  531. package/examples/jsm/shaders/HalftoneShader.js +0 -310
  532. package/examples/jsm/shaders/HorizontalBlurShader.js +0 -59
  533. package/examples/jsm/shaders/HorizontalTiltShiftShader.js +0 -61
  534. package/examples/jsm/shaders/HueSaturationShader.js +0 -65
  535. package/examples/jsm/shaders/KaleidoShader.js +0 -56
  536. package/examples/jsm/shaders/LuminosityHighPassShader.js +0 -64
  537. package/examples/jsm/shaders/LuminosityShader.js +0 -46
  538. package/examples/jsm/shaders/MMDToonShader.js +0 -132
  539. package/examples/jsm/shaders/MirrorShader.js +0 -54
  540. package/examples/jsm/shaders/NormalMapShader.js +0 -53
  541. package/examples/jsm/shaders/OutputShader.js +0 -78
  542. package/examples/jsm/shaders/RGBShiftShader.js +0 -54
  543. package/examples/jsm/shaders/SAOShader.js +0 -188
  544. package/examples/jsm/shaders/SMAAShader.js +0 -460
  545. package/examples/jsm/shaders/SSAOShader.js +0 -288
  546. package/examples/jsm/shaders/SSRShader.js +0 -364
  547. package/examples/jsm/shaders/SepiaShader.js +0 -52
  548. package/examples/jsm/shaders/SobelOperatorShader.js +0 -90
  549. package/examples/jsm/shaders/SubsurfaceScatteringShader.js +0 -88
  550. package/examples/jsm/shaders/TechnicolorShader.js +0 -43
  551. package/examples/jsm/shaders/ToonShader.js +0 -326
  552. package/examples/jsm/shaders/TriangleBlurShader.js +0 -72
  553. package/examples/jsm/shaders/UnpackDepthRGBAShader.js +0 -45
  554. package/examples/jsm/shaders/VelocityShader.js +0 -128
  555. package/examples/jsm/shaders/VerticalBlurShader.js +0 -59
  556. package/examples/jsm/shaders/VerticalTiltShiftShader.js +0 -61
  557. package/examples/jsm/shaders/VignetteShader.js +0 -51
  558. package/examples/jsm/shaders/VolumeShader.js +0 -289
  559. package/examples/jsm/shaders/WaterRefractionShader.js +0 -93
  560. package/examples/jsm/textures/FlakesTexture.js +0 -40
  561. package/examples/jsm/utils/BufferGeometryUtils.js +0 -1373
  562. package/examples/jsm/utils/CameraUtils.js +0 -73
  563. package/examples/jsm/utils/GPUStatsPanel.js +0 -128
  564. package/examples/jsm/utils/GeometryCompressionUtils.js +0 -639
  565. package/examples/jsm/utils/GeometryUtils.js +0 -221
  566. package/examples/jsm/utils/LDrawUtils.js +0 -202
  567. package/examples/jsm/utils/PackedPhongMaterial.js +0 -178
  568. package/examples/jsm/utils/SceneUtils.js +0 -254
  569. package/examples/jsm/utils/ShadowMapViewer.js +0 -210
  570. package/examples/jsm/utils/SkeletonUtils.js +0 -413
  571. package/examples/jsm/utils/TextureUtils.js +0 -86
  572. package/examples/jsm/utils/UVsDebug.js +0 -165
  573. package/examples/jsm/utils/WorkerPool.js +0 -102
  574. package/examples/jsm/webxr/ARButton.js +0 -208
  575. package/examples/jsm/webxr/OculusHandModel.js +0 -109
  576. package/examples/jsm/webxr/OculusHandPointerModel.js +0 -413
  577. package/examples/jsm/webxr/Text2D.js +0 -38
  578. package/examples/jsm/webxr/VRButton.js +0 -200
  579. package/examples/jsm/webxr/XRButton.js +0 -198
  580. package/examples/jsm/webxr/XRControllerModelFactory.js +0 -299
  581. package/examples/jsm/webxr/XREstimatedLight.js +0 -223
  582. package/examples/jsm/webxr/XRHandMeshModel.js +0 -112
  583. package/examples/jsm/webxr/XRHandModelFactory.js +0 -105
  584. package/examples/jsm/webxr/XRHandPrimitiveModel.js +0 -103
  585. package/examples/jsm/webxr/XRPlanes.js +0 -100
  586. package/lib/3d.min.js +0 -1
@@ -1,606 +0,0 @@
1
- import {
2
- DataUtils,
3
- DataTextureLoader,
4
- FloatType,
5
- HalfFloatType,
6
- RGBAFormat
7
- } from 'three';
8
-
9
- class LogLuvLoader extends DataTextureLoader {
10
-
11
- constructor( manager ) {
12
-
13
- super( manager );
14
-
15
- this.type = HalfFloatType;
16
-
17
- }
18
-
19
- parse( buffer ) {
20
-
21
- const ifds = UTIF.decode( buffer );
22
- UTIF.decodeImage( buffer, ifds[ 0 ] );
23
- const rgba = UTIF.toRGBA( ifds[ 0 ], this.type );
24
-
25
- return {
26
- width: ifds[ 0 ].width,
27
- height: ifds[ 0 ].height,
28
- data: rgba,
29
- format: RGBAFormat,
30
- type: this.type,
31
- flipY: true
32
- };
33
-
34
- }
35
-
36
- setDataType( value ) {
37
-
38
- this.type = value;
39
- return this;
40
-
41
- }
42
-
43
- }
44
-
45
- // from https://github.com/photopea/UTIF.js (MIT License)
46
-
47
- const UTIF = {};
48
-
49
- UTIF.decode = function ( buff, prm ) {
50
-
51
- if ( prm == null ) prm = { parseMN: true, debug: false }; // read MakerNote, debug
52
- var data = new Uint8Array( buff ), offset = 0;
53
-
54
- var id = UTIF._binBE.readASCII( data, offset, 2 ); offset += 2;
55
- var bin = id == 'II' ? UTIF._binLE : UTIF._binBE;
56
- bin.readUshort( data, offset ); offset += 2;
57
-
58
- var ifdo = bin.readUint( data, offset );
59
- var ifds = [];
60
- while ( true ) {
61
-
62
- var cnt = bin.readUshort( data, ifdo ), typ = bin.readUshort( data, ifdo + 4 ); if ( cnt != 0 ) if ( typ < 1 || 13 < typ ) {
63
-
64
- console.log( 'error in TIFF' ); break;
65
-
66
- }
67
-
68
-
69
- UTIF._readIFD( bin, data, ifdo, ifds, 0, prm );
70
-
71
- ifdo = bin.readUint( data, ifdo + 2 + cnt * 12 );
72
- if ( ifdo == 0 ) break;
73
-
74
- }
75
-
76
- return ifds;
77
-
78
- };
79
-
80
- UTIF.decodeImage = function ( buff, img, ifds ) {
81
-
82
- if ( img.data ) return;
83
- var data = new Uint8Array( buff );
84
- var id = UTIF._binBE.readASCII( data, 0, 2 );
85
-
86
- if ( img[ 't256' ] == null ) return; // No width => probably not an image
87
- img.isLE = id == 'II';
88
- img.width = img[ 't256' ][ 0 ]; //delete img["t256"];
89
- img.height = img[ 't257' ][ 0 ]; //delete img["t257"];
90
-
91
- var cmpr = img[ 't259' ] ? img[ 't259' ][ 0 ] : 1; //delete img["t259"];
92
- var fo = img[ 't266' ] ? img[ 't266' ][ 0 ] : 1; //delete img["t266"];
93
- if ( img[ 't284' ] && img[ 't284' ][ 0 ] == 2 ) console.log( 'PlanarConfiguration 2 should not be used!' );
94
- if ( cmpr == 7 && img[ 't258' ] && img[ 't258' ].length > 3 ) img[ 't258' ] = img[ 't258' ].slice( 0, 3 );
95
-
96
- var bipp; // bits per pixel
97
- if ( img[ 't258' ] ) bipp = Math.min( 32, img[ 't258' ][ 0 ] ) * img[ 't258' ].length;
98
- else bipp = ( img[ 't277' ] ? img[ 't277' ][ 0 ] : 1 );
99
- // Some .NEF files have t258==14, even though they use 16 bits per pixel
100
- if ( cmpr == 1 && img[ 't279' ] != null && img[ 't278' ] && img[ 't262' ][ 0 ] == 32803 ) {
101
-
102
- bipp = Math.round( ( img[ 't279' ][ 0 ] * 8 ) / ( img.width * img[ 't278' ][ 0 ] ) );
103
-
104
- }
105
-
106
- var bipl = Math.ceil( img.width * bipp / 8 ) * 8;
107
- var soff = img[ 't273' ]; if ( soff == null ) soff = img[ 't324' ];
108
- var bcnt = img[ 't279' ]; if ( cmpr == 1 && soff.length == 1 ) bcnt = [ img.height * ( bipl >>> 3 ) ]; if ( bcnt == null ) bcnt = img[ 't325' ];
109
- //bcnt[0] = Math.min(bcnt[0], data.length); // Hasselblad, "RAW_HASSELBLAD_H3D39II.3FR"
110
- var bytes = new Uint8Array( img.height * ( bipl >>> 3 ) ), bilen = 0;
111
-
112
- if ( img[ 't322' ] != null ) {
113
-
114
- var tw = img[ 't322' ][ 0 ], th = img[ 't323' ][ 0 ];
115
- var tx = Math.floor( ( img.width + tw - 1 ) / tw );
116
- var ty = Math.floor( ( img.height + th - 1 ) / th );
117
- var tbuff = new Uint8Array( Math.ceil( tw * th * bipp / 8 ) | 0 );
118
- for ( var y = 0; y < ty; y ++ )
119
- for ( var x = 0; x < tx; x ++ ) {
120
-
121
- var i = y * tx + x; for ( var j = 0; j < tbuff.length; j ++ ) tbuff[ j ] = 0;
122
- UTIF.decode._decompress( img, ifds, data, soff[ i ], bcnt[ i ], cmpr, tbuff, 0, fo );
123
- // Might be required for 7 too. Need to check
124
- if ( cmpr == 6 ) bytes = tbuff;
125
- else UTIF._copyTile( tbuff, Math.ceil( tw * bipp / 8 ) | 0, th, bytes, Math.ceil( img.width * bipp / 8 ) | 0, img.height, Math.ceil( x * tw * bipp / 8 ) | 0, y * th );
126
-
127
- }
128
-
129
- bilen = bytes.length * 8;
130
-
131
- } else {
132
-
133
- var rps = img[ 't278' ] ? img[ 't278' ][ 0 ] : img.height; rps = Math.min( rps, img.height );
134
- for ( var i = 0; i < soff.length; i ++ ) {
135
-
136
- UTIF.decode._decompress( img, ifds, data, soff[ i ], bcnt[ i ], cmpr, bytes, Math.ceil( bilen / 8 ) | 0, fo );
137
- bilen += bipl * rps;
138
-
139
- }
140
-
141
- bilen = Math.min( bilen, bytes.length * 8 );
142
-
143
- }
144
-
145
- img.data = new Uint8Array( bytes.buffer, 0, Math.ceil( bilen / 8 ) | 0 );
146
-
147
- };
148
-
149
- UTIF.decode._decompress = function ( img, ifds, data, off, len, cmpr, tgt, toff ) {
150
-
151
- //console.log("compression", cmpr);
152
- //var time = Date.now();
153
- if ( cmpr == 34676 ) UTIF.decode._decodeLogLuv32( img, data, off, len, tgt, toff );
154
- else console.log( 'Unsupported compression', cmpr );
155
-
156
- //console.log(Date.now()-time);
157
-
158
- var bps = ( img[ 't258' ] ? Math.min( 32, img[ 't258' ][ 0 ] ) : 1 );
159
- var noc = ( img[ 't277' ] ? img[ 't277' ][ 0 ] : 1 ), bpp = ( bps * noc ) >>> 3, h = ( img[ 't278' ] ? img[ 't278' ][ 0 ] : img.height ), bpl = Math.ceil( bps * noc * img.width / 8 );
160
-
161
- // convert to Little Endian /*
162
- if ( bps == 16 && ! img.isLE && img[ 't33422' ] == null ) // not DNG
163
- for ( var y = 0; y < h; y ++ ) {
164
-
165
- //console.log("fixing endianity");
166
- var roff = toff + y * bpl;
167
- for ( var x = 1; x < bpl; x += 2 ) {
168
-
169
- var t = tgt[ roff + x ]; tgt[ roff + x ] = tgt[ roff + x - 1 ]; tgt[ roff + x - 1 ] = t;
170
-
171
- }
172
-
173
- } //*/
174
-
175
- if ( img[ 't317' ] && img[ 't317' ][ 0 ] == 2 ) {
176
-
177
- for ( var y = 0; y < h; y ++ ) {
178
-
179
- var ntoff = toff + y * bpl;
180
- if ( bps == 16 ) for ( var j = bpp; j < bpl; j += 2 ) {
181
-
182
- var nv = ( ( tgt[ ntoff + j + 1 ] << 8 ) | tgt[ ntoff + j ] ) + ( ( tgt[ ntoff + j - bpp + 1 ] << 8 ) | tgt[ ntoff + j - bpp ] );
183
- tgt[ ntoff + j ] = nv & 255; tgt[ ntoff + j + 1 ] = ( nv >>> 8 ) & 255;
184
-
185
- }
186
- else if ( noc == 3 ) for ( var j = 3; j < bpl; j += 3 ) {
187
-
188
- tgt[ ntoff + j ] = ( tgt[ ntoff + j ] + tgt[ ntoff + j - 3 ] ) & 255;
189
- tgt[ ntoff + j + 1 ] = ( tgt[ ntoff + j + 1 ] + tgt[ ntoff + j - 2 ] ) & 255;
190
- tgt[ ntoff + j + 2 ] = ( tgt[ ntoff + j + 2 ] + tgt[ ntoff + j - 1 ] ) & 255;
191
-
192
- }
193
- else for ( var j = bpp; j < bpl; j ++ ) tgt[ ntoff + j ] = ( tgt[ ntoff + j ] + tgt[ ntoff + j - bpp ] ) & 255;
194
-
195
- }
196
-
197
- }
198
-
199
- };
200
-
201
- UTIF.decode._decodeLogLuv32 = function ( img, data, off, len, tgt, toff ) {
202
-
203
- var w = img.width, qw = w * 4;
204
- var io = 0, out = new Uint8Array( qw );
205
-
206
- while ( io < len ) {
207
-
208
- var oo = 0;
209
- while ( oo < qw ) {
210
-
211
- var c = data[ off + io ]; io ++;
212
- if ( c < 128 ) {
213
-
214
- for ( var j = 0; j < c; j ++ ) out[ oo + j ] = data[ off + io + j ]; oo += c; io += c;
215
-
216
- } else {
217
-
218
- c = c - 126; for ( var j = 0; j < c; j ++ ) out[ oo + j ] = data[ off + io ]; oo += c; io ++;
219
-
220
- }
221
-
222
- }
223
-
224
- for ( var x = 0; x < w; x ++ ) {
225
-
226
- tgt[ toff + 0 ] = out[ x ];
227
- tgt[ toff + 1 ] = out[ x + w ];
228
- tgt[ toff + 2 ] = out[ x + w * 2 ];
229
- tgt[ toff + 4 ] = out[ x + w * 3 ];
230
- toff += 6;
231
-
232
- }
233
-
234
- }
235
-
236
- };
237
-
238
- UTIF.tags = {};
239
- //UTIF.ttypes = { 256:3,257:3,258:3, 259:3, 262:3, 273:4, 274:3, 277:3,278:4,279:4, 282:5, 283:5, 284:3, 286:5,287:5, 296:3, 305:2, 306:2, 338:3, 513:4, 514:4, 34665:4 };
240
- // start at tag 250
241
- UTIF._types = function () {
242
-
243
- var main = new Array( 250 ); main.fill( 0 );
244
- main = main.concat( [ 0, 0, 0, 0, 4, 3, 3, 3, 3, 3, 0, 0, 3, 0, 0, 0, 3, 0, 0, 2, 2, 2, 2, 4, 3, 0, 0, 3, 4, 4, 3, 3, 5, 5, 3, 2, 5, 5, 0, 0, 0, 0, 4, 4, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 3, 5, 5, 3, 0, 3, 3, 4, 4, 4, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] );
245
- var rest = { 33432: 2, 33434: 5, 33437: 5, 34665: 4, 34850: 3, 34853: 4, 34855: 3, 34864: 3, 34866: 4, 36864: 7, 36867: 2, 36868: 2, 37121: 7, 37377: 10, 37378: 5, 37380: 10, 37381: 5, 37383: 3, 37384: 3, 37385: 3, 37386: 5, 37510: 7, 37520: 2, 37521: 2, 37522: 2, 40960: 7, 40961: 3, 40962: 4, 40963: 4, 40965: 4, 41486: 5, 41487: 5, 41488: 3, 41985: 3, 41986: 3, 41987: 3, 41988: 5, 41989: 3, 41990: 3, 41993: 3, 41994: 3, 41995: 7, 41996: 3, 42032: 2, 42033: 2, 42034: 5, 42036: 2, 42037: 2, 59932: 7 };
246
- return {
247
- basic: {
248
- main: main,
249
- rest: rest
250
- },
251
- gps: {
252
- main: [ 1, 2, 5, 2, 5, 1, 5, 5, 0, 9 ],
253
- rest: { 18: 2, 29: 2 }
254
- }
255
- };
256
-
257
- }();
258
-
259
- UTIF._readIFD = function ( bin, data, offset, ifds, depth, prm ) {
260
-
261
- var cnt = bin.readUshort( data, offset ); offset += 2;
262
- var ifd = {};
263
-
264
- if ( prm.debug ) console.log( ' '.repeat( depth ), ifds.length - 1, '>>>----------------' );
265
- for ( var i = 0; i < cnt; i ++ ) {
266
-
267
- var tag = bin.readUshort( data, offset ); offset += 2;
268
- var type = bin.readUshort( data, offset ); offset += 2;
269
- var num = bin.readUint( data, offset ); offset += 4;
270
- var voff = bin.readUint( data, offset ); offset += 4;
271
-
272
- var arr = [];
273
- //ifd["t"+tag+"-"+UTIF.tags[tag]] = arr;
274
- if ( type == 1 || type == 7 ) {
275
-
276
- arr = new Uint8Array( data.buffer, ( num < 5 ? offset - 4 : voff ), num );
277
-
278
- }
279
-
280
- if ( type == 2 ) {
281
-
282
- var o0 = ( num < 5 ? offset - 4 : voff ), c = data[ o0 ], len = Math.max( 0, Math.min( num - 1, data.length - o0 ) );
283
- if ( c < 128 || len == 0 ) arr.push( bin.readASCII( data, o0, len ) );
284
- else arr = new Uint8Array( data.buffer, o0, len );
285
-
286
- }
287
-
288
- if ( type == 3 ) {
289
-
290
- for ( var j = 0; j < num; j ++ ) arr.push( bin.readUshort( data, ( num < 3 ? offset - 4 : voff ) + 2 * j ) );
291
-
292
- }
293
-
294
- if ( type == 4
295
- || type == 13 ) {
296
-
297
- for ( var j = 0; j < num; j ++ ) arr.push( bin.readUint( data, ( num < 2 ? offset - 4 : voff ) + 4 * j ) );
298
-
299
- }
300
-
301
- if ( type == 5 || type == 10 ) {
302
-
303
- var ri = type == 5 ? bin.readUint : bin.readInt;
304
- for ( var j = 0; j < num; j ++ ) arr.push( [ ri( data, voff + j * 8 ), ri( data, voff + j * 8 + 4 ) ] );
305
-
306
- }
307
-
308
- if ( type == 8 ) {
309
-
310
- for ( var j = 0; j < num; j ++ ) arr.push( bin.readShort( data, ( num < 3 ? offset - 4 : voff ) + 2 * j ) );
311
-
312
- }
313
-
314
- if ( type == 9 ) {
315
-
316
- for ( var j = 0; j < num; j ++ ) arr.push( bin.readInt( data, ( num < 2 ? offset - 4 : voff ) + 4 * j ) );
317
-
318
- }
319
-
320
- if ( type == 11 ) {
321
-
322
- for ( var j = 0; j < num; j ++ ) arr.push( bin.readFloat( data, voff + j * 4 ) );
323
-
324
- }
325
-
326
- if ( type == 12 ) {
327
-
328
- for ( var j = 0; j < num; j ++ ) arr.push( bin.readDouble( data, voff + j * 8 ) );
329
-
330
- }
331
-
332
- if ( num != 0 && arr.length == 0 ) {
333
-
334
- console.log( tag, 'unknown TIFF tag type: ', type, 'num:', num ); if ( i == 0 ) return; continue;
335
-
336
- }
337
-
338
- if ( prm.debug ) console.log( ' '.repeat( depth ), tag, type, UTIF.tags[ tag ], arr );
339
-
340
- ifd[ 't' + tag ] = arr;
341
-
342
- if ( tag == 330 || tag == 34665 || tag == 34853 || ( tag == 50740 && bin.readUshort( data, bin.readUint( arr, 0 ) ) < 300 ) || tag == 61440 ) {
343
-
344
- var oarr = tag == 50740 ? [ bin.readUint( arr, 0 ) ] : arr;
345
- var subfd = [];
346
- for ( var j = 0; j < oarr.length; j ++ ) UTIF._readIFD( bin, data, oarr[ j ], subfd, depth + 1, prm );
347
- if ( tag == 330 ) ifd.subIFD = subfd;
348
- if ( tag == 34665 ) ifd.exifIFD = subfd[ 0 ];
349
- if ( tag == 34853 ) ifd.gpsiIFD = subfd[ 0 ]; //console.log("gps", subfd[0]); }
350
- if ( tag == 50740 ) ifd.dngPrvt = subfd[ 0 ];
351
- if ( tag == 61440 ) ifd.fujiIFD = subfd[ 0 ];
352
-
353
- }
354
-
355
- if ( tag == 37500 && prm.parseMN ) {
356
-
357
- var mn = arr;
358
- //console.log(bin.readASCII(mn,0,mn.length), mn);
359
- if ( bin.readASCII( mn, 0, 5 ) == 'Nikon' ) ifd.makerNote = UTIF[ 'decode' ]( mn.slice( 10 ).buffer )[ 0 ];
360
- else if ( bin.readUshort( data, voff ) < 300 && bin.readUshort( data, voff + 4 ) <= 12 ) {
361
-
362
- var subsub = []; UTIF._readIFD( bin, data, voff, subsub, depth + 1, prm );
363
- ifd.makerNote = subsub[ 0 ];
364
-
365
- }
366
-
367
- }
368
-
369
- }
370
-
371
- ifds.push( ifd );
372
- if ( prm.debug ) console.log( ' '.repeat( depth ), '<<<---------------' );
373
- return offset;
374
-
375
- };
376
-
377
- UTIF.toRGBA = function ( out, type ) {
378
-
379
- const w = out.width, h = out.height, area = w * h, data = out.data;
380
-
381
- let img;
382
-
383
- switch ( type ) {
384
-
385
- case HalfFloatType:
386
-
387
- img = new Uint16Array( area * 4 );
388
- break;
389
-
390
- case FloatType:
391
-
392
- img = new Float32Array( area * 4 );
393
- break;
394
-
395
- default:
396
- console.error( 'THREE.LogLuvLoader: Unsupported texture data type:', type );
397
-
398
- }
399
-
400
- let intp = out[ 't262' ] ? out[ 't262' ][ 0 ] : 2;
401
- const bps = out[ 't258' ] ? Math.min( 32, out[ 't258' ][ 0 ] ) : 1;
402
-
403
- if ( out[ 't262' ] == null && bps == 1 ) intp = 0;
404
-
405
- if ( intp == 32845 ) {
406
-
407
- for ( let y = 0; y < h; y ++ ) {
408
-
409
- for ( let x = 0; x < w; x ++ ) {
410
-
411
- const si = ( y * w + x ) * 6, qi = ( y * w + x ) * 4;
412
- let L = ( data[ si + 1 ] << 8 ) | data[ si ];
413
-
414
- L = Math.pow( 2, ( L + 0.5 ) / 256 - 64 );
415
- const u = ( data[ si + 3 ] + 0.5 ) / 410;
416
- const v = ( data[ si + 5 ] + 0.5 ) / 410;
417
-
418
- // Luv to xyY
419
- const sX = ( 9 * u ) / ( 6 * u - 16 * v + 12 );
420
- const sY = ( 4 * v ) / ( 6 * u - 16 * v + 12 );
421
- const bY = L;
422
-
423
- // xyY to XYZ
424
- const X = ( sX * bY ) / sY, Y = bY, Z = ( 1 - sX - sY ) * bY / sY;
425
-
426
- // XYZ to linear RGB
427
- const r = 2.690 * X - 1.276 * Y - 0.414 * Z;
428
- const g = - 1.022 * X + 1.978 * Y + 0.044 * Z;
429
- const b = 0.061 * X - 0.224 * Y + 1.163 * Z;
430
-
431
- if ( type === HalfFloatType ) {
432
-
433
- img[ qi ] = DataUtils.toHalfFloat( Math.min( r, 65504 ) );
434
- img[ qi + 1 ] = DataUtils.toHalfFloat( Math.min( g, 65504 ) );
435
- img[ qi + 2 ] = DataUtils.toHalfFloat( Math.min( b, 65504 ) );
436
- img[ qi + 3 ] = DataUtils.toHalfFloat( 1 );
437
-
438
-
439
- } else {
440
-
441
- img[ qi ] = r;
442
- img[ qi + 1 ] = g;
443
- img[ qi + 2 ] = b;
444
- img[ qi + 3 ] = 1;
445
-
446
- }
447
-
448
- }
449
-
450
- }
451
-
452
- } else {
453
-
454
- console.log( 'Unsupported Photometric interpretation: ' + intp );
455
-
456
- }
457
-
458
- return img;
459
-
460
- };
461
-
462
- UTIF._binBE =
463
- {
464
- nextZero: function ( data, o ) {
465
-
466
- while ( data[ o ] != 0 ) o ++; return o;
467
-
468
- },
469
- readUshort: function ( buff, p ) {
470
-
471
- return ( buff[ p ] << 8 ) | buff[ p + 1 ];
472
-
473
- },
474
- readShort: function ( buff, p ) {
475
-
476
- var a = UTIF._binBE.ui8; a[ 0 ] = buff[ p + 1 ]; a[ 1 ] = buff[ p + 0 ]; return UTIF._binBE.i16[ 0 ];
477
-
478
- },
479
- readInt: function ( buff, p ) {
480
-
481
- var a = UTIF._binBE.ui8; a[ 0 ] = buff[ p + 3 ]; a[ 1 ] = buff[ p + 2 ]; a[ 2 ] = buff[ p + 1 ]; a[ 3 ] = buff[ p + 0 ]; return UTIF._binBE.i32[ 0 ];
482
-
483
- },
484
- readUint: function ( buff, p ) {
485
-
486
- var a = UTIF._binBE.ui8; a[ 0 ] = buff[ p + 3 ]; a[ 1 ] = buff[ p + 2 ]; a[ 2 ] = buff[ p + 1 ]; a[ 3 ] = buff[ p + 0 ]; return UTIF._binBE.ui32[ 0 ];
487
-
488
- },
489
- readASCII: function ( buff, p, l ) {
490
-
491
- var s = ''; for ( var i = 0; i < l; i ++ ) s += String.fromCharCode( buff[ p + i ] ); return s;
492
-
493
- },
494
- readFloat: function ( buff, p ) {
495
-
496
- var a = UTIF._binBE.ui8; for ( var i = 0; i < 4; i ++ ) a[ i ] = buff[ p + 3 - i ]; return UTIF._binBE.fl32[ 0 ];
497
-
498
- },
499
- readDouble: function ( buff, p ) {
500
-
501
- var a = UTIF._binBE.ui8; for ( var i = 0; i < 8; i ++ ) a[ i ] = buff[ p + 7 - i ]; return UTIF._binBE.fl64[ 0 ];
502
-
503
- },
504
-
505
- writeUshort: function ( buff, p, n ) {
506
-
507
- buff[ p ] = ( n >> 8 ) & 255; buff[ p + 1 ] = n & 255;
508
-
509
- },
510
- writeInt: function ( buff, p, n ) {
511
-
512
- var a = UTIF._binBE.ui8; UTIF._binBE.i32[ 0 ] = n; buff[ p + 3 ] = a[ 0 ]; buff[ p + 2 ] = a[ 1 ]; buff[ p + 1 ] = a[ 2 ]; buff[ p + 0 ] = a[ 3 ];
513
-
514
- },
515
- writeUint: function ( buff, p, n ) {
516
-
517
- buff[ p ] = ( n >> 24 ) & 255; buff[ p + 1 ] = ( n >> 16 ) & 255; buff[ p + 2 ] = ( n >> 8 ) & 255; buff[ p + 3 ] = ( n >> 0 ) & 255;
518
-
519
- },
520
- writeASCII: function ( buff, p, s ) {
521
-
522
- for ( var i = 0; i < s.length; i ++ ) buff[ p + i ] = s.charCodeAt( i );
523
-
524
- },
525
- writeDouble: function ( buff, p, n ) {
526
-
527
- UTIF._binBE.fl64[ 0 ] = n;
528
- for ( var i = 0; i < 8; i ++ ) buff[ p + i ] = UTIF._binBE.ui8[ 7 - i ];
529
-
530
- }
531
- };
532
- UTIF._binBE.ui8 = new Uint8Array( 8 );
533
- UTIF._binBE.i16 = new Int16Array( UTIF._binBE.ui8.buffer );
534
- UTIF._binBE.i32 = new Int32Array( UTIF._binBE.ui8.buffer );
535
- UTIF._binBE.ui32 = new Uint32Array( UTIF._binBE.ui8.buffer );
536
- UTIF._binBE.fl32 = new Float32Array( UTIF._binBE.ui8.buffer );
537
- UTIF._binBE.fl64 = new Float64Array( UTIF._binBE.ui8.buffer );
538
-
539
- UTIF._binLE =
540
- {
541
- nextZero: UTIF._binBE.nextZero,
542
- readUshort: function ( buff, p ) {
543
-
544
- return ( buff[ p + 1 ] << 8 ) | buff[ p ];
545
-
546
- },
547
- readShort: function ( buff, p ) {
548
-
549
- var a = UTIF._binBE.ui8; a[ 0 ] = buff[ p + 0 ]; a[ 1 ] = buff[ p + 1 ]; return UTIF._binBE.i16[ 0 ];
550
-
551
- },
552
- readInt: function ( buff, p ) {
553
-
554
- var a = UTIF._binBE.ui8; a[ 0 ] = buff[ p + 0 ]; a[ 1 ] = buff[ p + 1 ]; a[ 2 ] = buff[ p + 2 ]; a[ 3 ] = buff[ p + 3 ]; return UTIF._binBE.i32[ 0 ];
555
-
556
- },
557
- readUint: function ( buff, p ) {
558
-
559
- var a = UTIF._binBE.ui8; a[ 0 ] = buff[ p + 0 ]; a[ 1 ] = buff[ p + 1 ]; a[ 2 ] = buff[ p + 2 ]; a[ 3 ] = buff[ p + 3 ]; return UTIF._binBE.ui32[ 0 ];
560
-
561
- },
562
- readASCII: UTIF._binBE.readASCII,
563
- readFloat: function ( buff, p ) {
564
-
565
- var a = UTIF._binBE.ui8; for ( var i = 0; i < 4; i ++ ) a[ i ] = buff[ p + i ]; return UTIF._binBE.fl32[ 0 ];
566
-
567
- },
568
- readDouble: function ( buff, p ) {
569
-
570
- var a = UTIF._binBE.ui8; for ( var i = 0; i < 8; i ++ ) a[ i ] = buff[ p + i ]; return UTIF._binBE.fl64[ 0 ];
571
-
572
- },
573
-
574
- writeUshort: function ( buff, p, n ) {
575
-
576
- buff[ p ] = ( n ) & 255; buff[ p + 1 ] = ( n >> 8 ) & 255;
577
-
578
- },
579
- writeInt: function ( buff, p, n ) {
580
-
581
- var a = UTIF._binBE.ui8; UTIF._binBE.i32[ 0 ] = n; buff[ p + 0 ] = a[ 0 ]; buff[ p + 1 ] = a[ 1 ]; buff[ p + 2 ] = a[ 2 ]; buff[ p + 3 ] = a[ 3 ];
582
-
583
- },
584
- writeUint: function ( buff, p, n ) {
585
-
586
- buff[ p ] = ( n >>> 0 ) & 255; buff[ p + 1 ] = ( n >>> 8 ) & 255; buff[ p + 2 ] = ( n >>> 16 ) & 255; buff[ p + 3 ] = ( n >>> 24 ) & 255;
587
-
588
- },
589
- writeASCII: UTIF._binBE.writeASCII
590
- };
591
- UTIF._copyTile = function ( tb, tw, th, b, w, h, xoff, yoff ) {
592
-
593
- //log("copyTile", tw, th, w, h, xoff, yoff);
594
- var xlim = Math.min( tw, w - xoff );
595
- var ylim = Math.min( th, h - yoff );
596
- for ( var y = 0; y < ylim; y ++ ) {
597
-
598
- var tof = ( yoff + y ) * w + xoff;
599
- var sof = y * tw;
600
- for ( var x = 0; x < xlim; x ++ ) b[ tof + x ] = tb[ sof + x ];
601
-
602
- }
603
-
604
- };
605
-
606
- export { LogLuvLoader };
@@ -1,77 +0,0 @@
1
- import {
2
- FileLoader,
3
- Loader,
4
- CanvasTexture,
5
- NearestFilter,
6
- SRGBColorSpace
7
- } from 'three';
8
-
9
- import lottie from '../libs/lottie_canvas.module.js';
10
-
11
- class LottieLoader extends Loader {
12
-
13
- setQuality( value ) {
14
-
15
- this._quality = value;
16
-
17
- }
18
-
19
- load( url, onLoad, onProgress, onError ) {
20
-
21
- const quality = this._quality || 1;
22
-
23
- const texture = new CanvasTexture();
24
- texture.minFilter = NearestFilter;
25
- texture.colorSpace = SRGBColorSpace;
26
-
27
- const loader = new FileLoader( this.manager );
28
- loader.setPath( this.path );
29
- loader.setWithCredentials( this.withCredentials );
30
-
31
- loader.load( url, function ( text ) {
32
-
33
- const data = JSON.parse( text );
34
-
35
- // lottie uses container.offetWidth and offsetHeight
36
- // to define width/height
37
-
38
- const container = document.createElement( 'div' );
39
- container.style.width = data.w + 'px';
40
- container.style.height = data.h + 'px';
41
- document.body.appendChild( container );
42
-
43
- const animation = lottie.loadAnimation( {
44
- container: container,
45
- animType: 'canvas',
46
- loop: true,
47
- autoplay: true,
48
- animationData: data,
49
- rendererSettings: { dpr: quality }
50
- } );
51
-
52
- texture.animation = animation;
53
- texture.image = animation.container;
54
-
55
- animation.addEventListener( 'enterFrame', function () {
56
-
57
- texture.needsUpdate = true;
58
-
59
- } );
60
-
61
- container.style.display = 'none';
62
-
63
- if ( onLoad !== undefined ) {
64
-
65
- onLoad( texture );
66
-
67
- }
68
-
69
- }, onProgress, onError );
70
-
71
- return texture;
72
-
73
- }
74
-
75
- }
76
-
77
- export { LottieLoader };