@zephyr3d/scene 0.9.2 → 0.9.4

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 (513) hide show
  1. package/dist/animation/animationset.js +135 -135
  2. package/dist/animation/animationset.js.map +1 -1
  3. package/dist/animation/ik/ik_chain_builder.js +68 -0
  4. package/dist/animation/ik/ik_chain_builder.js.map +1 -0
  5. package/dist/animation/ik/ik_pole_constraint.js +2 -7
  6. package/dist/animation/ik/ik_pole_constraint.js.map +1 -1
  7. package/dist/animation/joint_dynamics/controller.js +146 -146
  8. package/dist/animation/joint_dynamics/controller.js.map +1 -1
  9. package/dist/animation/joint_dynamics/math.js +16 -0
  10. package/dist/animation/joint_dynamics/math.js.map +1 -0
  11. package/dist/animation/spring/spring_system.js +75 -75
  12. package/dist/animation/spring/spring_system.js.map +1 -1
  13. package/dist/animation/spring2/constraints.js.map +1 -1
  14. package/dist/animation/spring2/controller.js +64 -64
  15. package/dist/animation/spring2/controller.js.map +1 -1
  16. package/dist/animation/spring2/math.js.map +1 -1
  17. package/dist/animation/spring2/spring_system.js +8 -8
  18. package/dist/animation/spring2/spring_system.js.map +1 -1
  19. package/dist/app/engine.js +119 -71
  20. package/dist/app/engine.js.map +1 -1
  21. package/dist/asset/assetmanager.js +296 -244
  22. package/dist/asset/assetmanager.js.map +1 -1
  23. package/dist/asset/loaders/gltf/gltf_loader.js +1 -0
  24. package/dist/asset/loaders/gltf/gltf_loader.js.map +1 -1
  25. package/dist/camera/camera.js +184 -184
  26. package/dist/camera/camera.js.map +1 -1
  27. package/dist/index.d.ts +685 -38
  28. package/dist/index.js +11 -2
  29. package/dist/index.js.map +1 -1
  30. package/dist/material/material.js +290 -290
  31. package/dist/material/material.js.map +1 -1
  32. package/dist/material/msdf_text.js +180 -0
  33. package/dist/material/msdf_text.js.map +1 -0
  34. package/dist/material/msdf_text_sprite.js +64 -0
  35. package/dist/material/msdf_text_sprite.js.map +1 -0
  36. package/dist/material/pbrblueprint.js +123 -108
  37. package/dist/material/pbrblueprint.js.map +1 -1
  38. package/dist/material/shader/helper.js +6 -3
  39. package/dist/material/shader/helper.js.map +1 -1
  40. package/dist/material/sprite_sdf.js +106 -0
  41. package/dist/material/sprite_sdf.js.map +1 -0
  42. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/runtimemgr.js +38 -0
  43. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/runtimemgr.js.map +1 -0
  44. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/runtimescript.js +10 -0
  45. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/runtimescript.js.map +1 -0
  46. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/scriptingsystem.js +127 -0
  47. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/scriptingsystem.js.map +1 -0
  48. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/scriptregistry.js +263 -0
  49. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/scriptregistry.js.map +1 -0
  50. package/dist/posteffect/ssr.js +1 -0
  51. package/dist/posteffect/ssr.js.map +1 -1
  52. package/dist/render/abuffer_oit.js +1 -0
  53. package/dist/render/abuffer_oit.js.map +1 -1
  54. package/dist/render/cluster_light.js +3 -4
  55. package/dist/render/cluster_light.js.map +1 -1
  56. package/dist/render/cull_visitor.js +28 -0
  57. package/dist/render/cull_visitor.js.map +1 -1
  58. package/dist/render/drawable.js.map +1 -1
  59. package/dist/render/drawable_mixin.js +1 -0
  60. package/dist/render/drawable_mixin.js.map +1 -1
  61. package/dist/render/fbm_wavegenerator.js +1 -0
  62. package/dist/render/fbm_wavegenerator.js.map +1 -1
  63. package/dist/render/gerstner_wavegenerator.js +1 -0
  64. package/dist/render/gerstner_wavegenerator.js.map +1 -1
  65. package/dist/render/globalbindgroup_allocator.js +1 -0
  66. package/dist/render/globalbindgroup_allocator.js.map +1 -1
  67. package/dist/render/render_queue.js +1 -0
  68. package/dist/render/render_queue.js.map +1 -1
  69. package/dist/render/rendergraph/history_resource_manager.js +93 -93
  70. package/dist/render/rendergraph/history_resource_manager.js.map +1 -1
  71. package/dist/render/rendergraph/history_resources.js +3 -3
  72. package/dist/render/rendergraph/history_resources.js.map +1 -1
  73. package/dist/render/rendergraph/types.js +22 -22
  74. package/dist/render/rendergraph/types.js.map +1 -1
  75. package/dist/scene/basesprite.js +1 -5
  76. package/dist/scene/basesprite.js.map +1 -1
  77. package/dist/scene/batchgroup.js +29 -17
  78. package/dist/scene/batchgroup.js.map +1 -1
  79. package/dist/scene/environment.js +1 -0
  80. package/dist/scene/environment.js.map +1 -1
  81. package/dist/scene/mesh.js +8 -9
  82. package/dist/scene/mesh.js.map +1 -1
  83. package/dist/scene/meshdrawable.js +96 -0
  84. package/dist/scene/meshdrawable.js.map +1 -0
  85. package/dist/scene/msdftext.js +341 -0
  86. package/dist/scene/msdftext.js.map +1 -0
  87. package/dist/scene/msdftextsprite.js +349 -0
  88. package/dist/scene/msdftextsprite.js.map +1 -0
  89. package/dist/scene/particlesys.js +1 -0
  90. package/dist/scene/particlesys.js.map +1 -1
  91. package/dist/scene/scene.js +1 -0
  92. package/dist/scene/scene.js.map +1 -1
  93. package/dist/scene/scene_node.js +6 -0
  94. package/dist/scene/scene_node.js.map +1 -1
  95. package/dist/scene/sdftextsprite.js +322 -0
  96. package/dist/scene/sdftextsprite.js.map +1 -0
  97. package/dist/scene/terrain-cm/grass.js +1 -0
  98. package/dist/scene/terrain-cm/grass.js.map +1 -1
  99. package/dist/scene/terrain-cm/grassmaterial.js +1 -0
  100. package/dist/scene/terrain-cm/grassmaterial.js.map +1 -1
  101. package/dist/scene/terrain-cm/terrain-cm.js +1 -0
  102. package/dist/scene/terrain-cm/terrain-cm.js.map +1 -1
  103. package/dist/scene/textsprite.js +120 -0
  104. package/dist/scene/textsprite.js.map +1 -0
  105. package/dist/scene/water.js +1 -0
  106. package/dist/scene/water.js.map +1 -1
  107. package/dist/shadow/shader.js +1 -0
  108. package/dist/shadow/shader.js.map +1 -1
  109. package/dist/shapes/torus.js +90 -59
  110. package/dist/shapes/torus.js.map +1 -1
  111. package/dist/src/animation/animation.js +127 -0
  112. package/dist/src/animation/animation.js.map +1 -0
  113. package/dist/src/animation/animationset.js +255 -0
  114. package/dist/src/animation/animationset.js.map +1 -0
  115. package/dist/src/animation/animationtrack.js +34 -0
  116. package/dist/src/animation/animationtrack.js.map +1 -0
  117. package/dist/src/animation/eulerrotationtrack.js +52 -0
  118. package/dist/src/animation/eulerrotationtrack.js.map +1 -0
  119. package/dist/src/animation/morphtarget.js +93 -0
  120. package/dist/src/animation/morphtarget.js.map +1 -0
  121. package/dist/src/animation/morphtrack.js +70 -0
  122. package/dist/src/animation/morphtrack.js.map +1 -0
  123. package/dist/src/animation/proptrack.js +161 -0
  124. package/dist/src/animation/proptrack.js.map +1 -0
  125. package/dist/src/animation/rotationtrack.js +51 -0
  126. package/dist/src/animation/rotationtrack.js.map +1 -0
  127. package/dist/src/animation/scaletrack.js +50 -0
  128. package/dist/src/animation/scaletrack.js.map +1 -0
  129. package/dist/src/animation/skeleton.js +204 -0
  130. package/dist/src/animation/skeleton.js.map +1 -0
  131. package/dist/src/animation/translationtrack.js +50 -0
  132. package/dist/src/animation/translationtrack.js.map +1 -0
  133. package/dist/src/app/app.js +129 -0
  134. package/dist/src/app/app.js.map +1 -0
  135. package/dist/src/app/inputmgr.js +267 -0
  136. package/dist/src/app/inputmgr.js.map +1 -0
  137. package/dist/src/asset/assetmanager.js +404 -0
  138. package/dist/src/asset/assetmanager.js.map +1 -0
  139. package/dist/src/asset/builtin.js +337 -0
  140. package/dist/src/asset/builtin.js.map +1 -0
  141. package/dist/src/asset/loaders/dds/dds.js +470 -0
  142. package/dist/src/asset/loaders/dds/dds.js.map +1 -0
  143. package/dist/src/asset/loaders/dds/dds_loader.js +28 -0
  144. package/dist/src/asset/loaders/dds/dds_loader.js.map +1 -0
  145. package/dist/src/asset/loaders/gltf/gltf_loader.js +1265 -0
  146. package/dist/src/asset/loaders/gltf/gltf_loader.js.map +1 -0
  147. package/dist/src/asset/loaders/gltf/helpers.js +327 -0
  148. package/dist/src/asset/loaders/gltf/helpers.js.map +1 -0
  149. package/dist/src/asset/loaders/hdr/hdr.js +180 -0
  150. package/dist/src/asset/loaders/hdr/hdr.js.map +1 -0
  151. package/dist/src/asset/loaders/image/tga_Loader.js +116 -0
  152. package/dist/src/asset/loaders/image/tga_Loader.js.map +1 -0
  153. package/dist/src/asset/loaders/image/webimage_loader.js +63 -0
  154. package/dist/src/asset/loaders/image/webimage_loader.js.map +1 -0
  155. package/dist/src/asset/loaders/loader.js +45 -0
  156. package/dist/src/asset/loaders/loader.js.map +1 -0
  157. package/dist/src/asset/model.js +414 -0
  158. package/dist/src/asset/model.js.map +1 -0
  159. package/dist/src/blitter/bilateralblur.js +221 -0
  160. package/dist/src/blitter/bilateralblur.js.map +1 -0
  161. package/dist/src/blitter/blitter.js +390 -0
  162. package/dist/src/blitter/blitter.js.map +1 -0
  163. package/dist/src/blitter/box.js +118 -0
  164. package/dist/src/blitter/box.js.map +1 -0
  165. package/dist/src/blitter/copy.js +22 -0
  166. package/dist/src/blitter/copy.js.map +1 -0
  167. package/dist/src/blitter/gaussianblur.js +228 -0
  168. package/dist/src/blitter/gaussianblur.js.map +1 -0
  169. package/dist/src/camera/base.js +92 -0
  170. package/dist/src/camera/base.js.map +1 -0
  171. package/dist/src/camera/camera.js +1005 -0
  172. package/dist/src/camera/camera.js.map +1 -0
  173. package/dist/src/camera/fps.js +238 -0
  174. package/dist/src/camera/fps.js.map +1 -0
  175. package/dist/src/camera/orbit.js +245 -0
  176. package/dist/src/camera/orbit.js.map +1 -0
  177. package/dist/src/camera/orthocamera.js +167 -0
  178. package/dist/src/camera/orthocamera.js.map +1 -0
  179. package/dist/src/camera/perspectivecamera.js +141 -0
  180. package/dist/src/camera/perspectivecamera.js.map +1 -0
  181. package/dist/src/index.js +120 -0
  182. package/dist/src/index.js.map +1 -0
  183. package/dist/src/material/blinn.js +81 -0
  184. package/dist/src/material/blinn.js.map +1 -0
  185. package/dist/src/material/grassmaterial.js +113 -0
  186. package/dist/src/material/grassmaterial.js.map +1 -0
  187. package/dist/src/material/lambert.js +92 -0
  188. package/dist/src/material/lambert.js.map +1 -0
  189. package/dist/src/material/material.js +301 -0
  190. package/dist/src/material/material.js.map +1 -0
  191. package/dist/src/material/meshmaterial.js +704 -0
  192. package/dist/src/material/meshmaterial.js.map +1 -0
  193. package/dist/src/material/mixins/albedocolor.js +76 -0
  194. package/dist/src/material/mixins/albedocolor.js.map +1 -0
  195. package/dist/src/material/mixins/foliage.js +47 -0
  196. package/dist/src/material/mixins/foliage.js.map +1 -0
  197. package/dist/src/material/mixins/lightmodel/blinnphong.js +112 -0
  198. package/dist/src/material/mixins/lightmodel/blinnphong.js.map +1 -0
  199. package/dist/src/material/mixins/lightmodel/lambert.js +58 -0
  200. package/dist/src/material/mixins/lightmodel/lambert.js.map +1 -0
  201. package/dist/src/material/mixins/lightmodel/pbrmetallicroughness.js +178 -0
  202. package/dist/src/material/mixins/lightmodel/pbrmetallicroughness.js.map +1 -0
  203. package/dist/src/material/mixins/lightmodel/pbrspecularglossness.js +139 -0
  204. package/dist/src/material/mixins/lightmodel/pbrspecularglossness.js.map +1 -0
  205. package/dist/src/material/mixins/lit.js +476 -0
  206. package/dist/src/material/mixins/lit.js.map +1 -0
  207. package/dist/src/material/mixins/pbr/common.js +918 -0
  208. package/dist/src/material/mixins/pbr/common.js.map +1 -0
  209. package/dist/src/material/mixins/texture.js +172 -0
  210. package/dist/src/material/mixins/texture.js.map +1 -0
  211. package/dist/src/material/mixins/vertexcolor.js +56 -0
  212. package/dist/src/material/mixins/vertexcolor.js.map +1 -0
  213. package/dist/src/material/particle.js +178 -0
  214. package/dist/src/material/particle.js.map +1 -0
  215. package/dist/src/material/pbrmr.js +97 -0
  216. package/dist/src/material/pbrmr.js.map +1 -0
  217. package/dist/src/material/pbrsg.js +97 -0
  218. package/dist/src/material/pbrsg.js.map +1 -0
  219. package/dist/src/material/shader/helper.js +1209 -0
  220. package/dist/src/material/shader/helper.js.map +1 -0
  221. package/dist/src/material/terrain-cm.js +606 -0
  222. package/dist/src/material/terrain-cm.js.map +1 -0
  223. package/dist/src/material/terrainmaterial.js +375 -0
  224. package/dist/src/material/terrainmaterial.js.map +1 -0
  225. package/dist/src/material/unlit.js +41 -0
  226. package/dist/src/material/unlit.js.map +1 -0
  227. package/dist/src/material/water.js +417 -0
  228. package/dist/src/material/water.js.map +1 -0
  229. package/dist/src/posteffect/bloom.js +361 -0
  230. package/dist/src/posteffect/bloom.js.map +1 -0
  231. package/dist/src/posteffect/compositor.js +226 -0
  232. package/dist/src/posteffect/compositor.js.map +1 -0
  233. package/dist/src/posteffect/fxaa.js +273 -0
  234. package/dist/src/posteffect/fxaa.js.map +1 -0
  235. package/dist/src/posteffect/grayscale.js +69 -0
  236. package/dist/src/posteffect/grayscale.js.map +1 -0
  237. package/dist/src/posteffect/motionblur.js +96 -0
  238. package/dist/src/posteffect/motionblur.js.map +1 -0
  239. package/dist/src/posteffect/posteffect.js +126 -0
  240. package/dist/src/posteffect/posteffect.js.map +1 -0
  241. package/dist/src/posteffect/sao.js +324 -0
  242. package/dist/src/posteffect/sao.js.map +1 -0
  243. package/dist/src/posteffect/ssr.js +489 -0
  244. package/dist/src/posteffect/ssr.js.map +1 -0
  245. package/dist/src/posteffect/taa.js +172 -0
  246. package/dist/src/posteffect/taa.js.map +1 -0
  247. package/dist/src/posteffect/tonemap.js +94 -0
  248. package/dist/src/posteffect/tonemap.js.map +1 -0
  249. package/dist/src/render/abuffer_oit.js +361 -0
  250. package/dist/src/render/abuffer_oit.js.map +1 -0
  251. package/dist/src/render/clipmap.js +851 -0
  252. package/dist/src/render/clipmap.js.map +1 -0
  253. package/dist/src/render/cluster_light.js +333 -0
  254. package/dist/src/render/cluster_light.js.map +1 -0
  255. package/dist/src/render/cull_visitor.js +187 -0
  256. package/dist/src/render/cull_visitor.js.map +1 -0
  257. package/dist/src/render/depthpass.js +68 -0
  258. package/dist/src/render/depthpass.js.map +1 -0
  259. package/dist/src/render/drawable_mixin.js +227 -0
  260. package/dist/src/render/drawable_mixin.js.map +1 -0
  261. package/dist/src/render/envlight.js +463 -0
  262. package/dist/src/render/envlight.js.map +1 -0
  263. package/dist/src/render/fbm_wavegenerator.js +251 -0
  264. package/dist/src/render/fbm_wavegenerator.js.map +1 -0
  265. package/dist/src/render/fft_wavegenerator.js +1006 -0
  266. package/dist/src/render/fft_wavegenerator.js.map +1 -0
  267. package/dist/src/render/fullscreenquad.js +38 -0
  268. package/dist/src/render/fullscreenquad.js.map +1 -0
  269. package/dist/src/render/gerstner_wavegenerator.js +314 -0
  270. package/dist/src/render/gerstner_wavegenerator.js.map +1 -0
  271. package/dist/src/render/globalbindgroup_allocator.js +60 -0
  272. package/dist/src/render/globalbindgroup_allocator.js.map +1 -0
  273. package/dist/src/render/hzb.js +273 -0
  274. package/dist/src/render/hzb.js.map +1 -0
  275. package/dist/src/render/lightpass.js +172 -0
  276. package/dist/src/render/lightpass.js.map +1 -0
  277. package/dist/src/render/objectcolorpass.js +51 -0
  278. package/dist/src/render/objectcolorpass.js.map +1 -0
  279. package/dist/src/render/primitive.js +364 -0
  280. package/dist/src/render/primitive.js.map +1 -0
  281. package/dist/src/render/render_queue.js +467 -0
  282. package/dist/src/render/render_queue.js.map +1 -0
  283. package/dist/src/render/renderbundle_wrapper.js +152 -0
  284. package/dist/src/render/renderbundle_wrapper.js.map +1 -0
  285. package/dist/src/render/renderer.js +455 -0
  286. package/dist/src/render/renderer.js.map +1 -0
  287. package/dist/src/render/renderpass.js +200 -0
  288. package/dist/src/render/renderpass.js.map +1 -0
  289. package/dist/src/render/shadowmap_pass.js +56 -0
  290. package/dist/src/render/shadowmap_pass.js.map +1 -0
  291. package/dist/src/render/sky.js +1103 -0
  292. package/dist/src/render/sky.js.map +1 -0
  293. package/dist/src/render/weightedblended_oit.js +168 -0
  294. package/dist/src/render/weightedblended_oit.js.map +1 -0
  295. package/dist/src/scene/batchgroup.js +162 -0
  296. package/dist/src/scene/batchgroup.js.map +1 -0
  297. package/dist/src/scene/environment.js +209 -0
  298. package/dist/src/scene/environment.js.map +1 -0
  299. package/dist/src/scene/graph_node.js +72 -0
  300. package/dist/src/scene/graph_node.js.map +1 -0
  301. package/dist/src/scene/light.js +416 -0
  302. package/dist/src/scene/light.js.map +1 -0
  303. package/dist/src/scene/mesh.js +341 -0
  304. package/dist/src/scene/mesh.js.map +1 -0
  305. package/dist/src/scene/octree.js +649 -0
  306. package/dist/src/scene/octree.js.map +1 -0
  307. package/dist/src/scene/particlesys.js +738 -0
  308. package/dist/src/scene/particlesys.js.map +1 -0
  309. package/dist/src/scene/raycast_visitor.js +103 -0
  310. package/dist/src/scene/raycast_visitor.js.map +1 -0
  311. package/dist/src/scene/scene.js +284 -0
  312. package/dist/src/scene/scene.js.map +1 -0
  313. package/dist/src/scene/scene_node.js +732 -0
  314. package/dist/src/scene/scene_node.js.map +1 -0
  315. package/dist/src/scene/terrain/grass.js +278 -0
  316. package/dist/src/scene/terrain/grass.js.map +1 -0
  317. package/dist/src/scene/terrain/heightfield.js +475 -0
  318. package/dist/src/scene/terrain/heightfield.js.map +1 -0
  319. package/dist/src/scene/terrain/patch.js +530 -0
  320. package/dist/src/scene/terrain/patch.js.map +1 -0
  321. package/dist/src/scene/terrain/quadtree.js +461 -0
  322. package/dist/src/scene/terrain/quadtree.js.map +1 -0
  323. package/dist/src/scene/terrain/terrain.js +246 -0
  324. package/dist/src/scene/terrain/terrain.js.map +1 -0
  325. package/dist/src/scene/terrain-cm/grass.js +594 -0
  326. package/dist/src/scene/terrain-cm/grass.js.map +1 -0
  327. package/dist/src/scene/terrain-cm/grassmaterial.js +159 -0
  328. package/dist/src/scene/terrain-cm/grassmaterial.js.map +1 -0
  329. package/dist/src/scene/terrain-cm/terrain-cm.js +538 -0
  330. package/dist/src/scene/terrain-cm/terrain-cm.js.map +1 -0
  331. package/dist/src/scene/water.js +374 -0
  332. package/dist/src/scene/water.js.map +1 -0
  333. package/dist/src/shaders/atmosphere.js +957 -0
  334. package/dist/src/shaders/atmosphere.js.map +1 -0
  335. package/dist/src/shaders/fog.js +112 -0
  336. package/dist/src/shaders/fog.js.map +1 -0
  337. package/dist/src/shaders/misc.js +266 -0
  338. package/dist/src/shaders/misc.js.map +1 -0
  339. package/dist/src/shaders/noise.js +222 -0
  340. package/dist/src/shaders/noise.js.map +1 -0
  341. package/dist/src/shaders/pbr.js +51 -0
  342. package/dist/src/shaders/pbr.js.map +1 -0
  343. package/dist/src/shaders/shadow.js +636 -0
  344. package/dist/src/shaders/shadow.js.map +1 -0
  345. package/dist/src/shaders/ssr.js +490 -0
  346. package/dist/src/shaders/ssr.js.map +1 -0
  347. package/dist/src/shaders/temporal.js +215 -0
  348. package/dist/src/shaders/temporal.js.map +1 -0
  349. package/dist/src/shaders/water.js +756 -0
  350. package/dist/src/shaders/water.js.map +1 -0
  351. package/dist/src/shadow/esm.js +237 -0
  352. package/dist/src/shadow/esm.js.map +1 -0
  353. package/dist/src/shadow/pcf_opt.js +181 -0
  354. package/dist/src/shadow/pcf_opt.js.map +1 -0
  355. package/dist/src/shadow/pcf_pd.js +189 -0
  356. package/dist/src/shadow/pcf_pd.js.map +1 -0
  357. package/dist/src/shadow/shader.js +37 -0
  358. package/dist/src/shadow/shader.js.map +1 -0
  359. package/dist/src/shadow/shadow_impl.js +15 -0
  360. package/dist/src/shadow/shadow_impl.js.map +1 -0
  361. package/dist/src/shadow/shadowmapper.js +790 -0
  362. package/dist/src/shadow/shadowmapper.js.map +1 -0
  363. package/dist/src/shadow/ssm.js +159 -0
  364. package/dist/src/shadow/ssm.js.map +1 -0
  365. package/dist/src/shadow/vsm.js +297 -0
  366. package/dist/src/shadow/vsm.js.map +1 -0
  367. package/dist/src/shapes/box.js +386 -0
  368. package/dist/src/shapes/box.js.map +1 -0
  369. package/dist/src/shapes/cylinder.js +125 -0
  370. package/dist/src/shapes/cylinder.js.map +1 -0
  371. package/dist/src/shapes/plane.js +88 -0
  372. package/dist/src/shapes/plane.js.map +1 -0
  373. package/dist/src/shapes/shape.js +87 -0
  374. package/dist/src/shapes/shape.js.map +1 -0
  375. package/dist/src/shapes/sphere.js +114 -0
  376. package/dist/src/shapes/sphere.js.map +1 -0
  377. package/dist/src/shapes/tetrahedron.js +188 -0
  378. package/dist/src/shapes/tetrahedron.js.map +1 -0
  379. package/dist/src/shapes/torus.js +111 -0
  380. package/dist/src/shapes/torus.js.map +1 -0
  381. package/dist/src/utility/aabbtree.js +400 -0
  382. package/dist/src/utility/aabbtree.js.map +1 -0
  383. package/dist/src/utility/bounding_volume.js +29 -0
  384. package/dist/src/utility/bounding_volume.js.map +1 -0
  385. package/dist/src/utility/debug.js +28 -0
  386. package/dist/src/utility/debug.js.map +1 -0
  387. package/dist/src/utility/draco/decoder.js +116 -0
  388. package/dist/src/utility/draco/decoder.js.map +1 -0
  389. package/dist/src/utility/misc.js +105 -0
  390. package/dist/src/utility/misc.js.map +1 -0
  391. package/dist/src/utility/panorama.js +163 -0
  392. package/dist/src/utility/panorama.js.map +1 -0
  393. package/dist/src/utility/pmrem.js +354 -0
  394. package/dist/src/utility/pmrem.js.map +1 -0
  395. package/dist/src/utility/rendermipmap.js +115 -0
  396. package/dist/src/utility/rendermipmap.js.map +1 -0
  397. package/dist/src/utility/serialization/json.js +402 -0
  398. package/dist/src/utility/serialization/json.js.map +1 -0
  399. package/dist/src/utility/serialization/manager.js +623 -0
  400. package/dist/src/utility/serialization/manager.js.map +1 -0
  401. package/dist/src/utility/serialization/scene/animation.js +248 -0
  402. package/dist/src/utility/serialization/scene/animation.js.map +1 -0
  403. package/dist/src/utility/serialization/scene/batch.js +59 -0
  404. package/dist/src/utility/serialization/scene/batch.js.map +1 -0
  405. package/dist/src/utility/serialization/scene/camera.js +790 -0
  406. package/dist/src/utility/serialization/scene/camera.js.map +1 -0
  407. package/dist/src/utility/serialization/scene/common.js +222 -0
  408. package/dist/src/utility/serialization/scene/common.js.map +1 -0
  409. package/dist/src/utility/serialization/scene/light.js +575 -0
  410. package/dist/src/utility/serialization/scene/light.js.map +1 -0
  411. package/dist/src/utility/serialization/scene/material.js +1111 -0
  412. package/dist/src/utility/serialization/scene/material.js.map +1 -0
  413. package/dist/src/utility/serialization/scene/mesh.js +148 -0
  414. package/dist/src/utility/serialization/scene/mesh.js.map +1 -0
  415. package/dist/src/utility/serialization/scene/misc.js +39 -0
  416. package/dist/src/utility/serialization/scene/misc.js.map +1 -0
  417. package/dist/src/utility/serialization/scene/node.js +451 -0
  418. package/dist/src/utility/serialization/scene/node.js.map +1 -0
  419. package/dist/src/utility/serialization/scene/particle.js +425 -0
  420. package/dist/src/utility/serialization/scene/particle.js.map +1 -0
  421. package/dist/src/utility/serialization/scene/primitive.js +692 -0
  422. package/dist/src/utility/serialization/scene/primitive.js.map +1 -0
  423. package/dist/src/utility/serialization/scene/scene.js +704 -0
  424. package/dist/src/utility/serialization/scene/scene.js.map +1 -0
  425. package/dist/src/utility/serialization/scene/terrain.js +488 -0
  426. package/dist/src/utility/serialization/scene/terrain.js.map +1 -0
  427. package/dist/src/utility/serialization/scene/water.js +465 -0
  428. package/dist/src/utility/serialization/scene/water.js.map +1 -0
  429. package/dist/src/utility/shprojector.js +297 -0
  430. package/dist/src/utility/shprojector.js.map +1 -0
  431. package/dist/src/utility/textures/ggxlut.js +213 -0
  432. package/dist/src/utility/textures/ggxlut.js.map +1 -0
  433. package/dist/src/utility/textures/gradientnoise.js +62 -0
  434. package/dist/src/utility/textures/gradientnoise.js.map +1 -0
  435. package/dist/src/utility/textures/randomnoise.js +41 -0
  436. package/dist/src/utility/textures/randomnoise.js.map +1 -0
  437. package/dist/src/values.js +162 -0
  438. package/dist/src/values.js.map +1 -0
  439. package/dist/text/font/font_asset.js +884 -0
  440. package/dist/text/font/font_asset.js.map +1 -0
  441. package/dist/text/font/sfnt_reader.js +43 -0
  442. package/dist/text/font/sfnt_reader.js.map +1 -0
  443. package/dist/text/msdf/generator.js +417 -0
  444. package/dist/text/msdf/generator.js.map +1 -0
  445. package/dist/text/msdf/shape.js +143 -0
  446. package/dist/text/msdf/shape.js.map +1 -0
  447. package/dist/text/runtime/msdf_glyph_atlas.js +146 -0
  448. package/dist/text/runtime/msdf_glyph_atlas.js.map +1 -0
  449. package/dist/text/runtime/msdf_text_atlas_manager.js +47 -0
  450. package/dist/text/runtime/msdf_text_atlas_manager.js.map +1 -0
  451. package/dist/text/runtime/text_layout.js +96 -0
  452. package/dist/text/runtime/text_layout.js.map +1 -0
  453. package/dist/utility/blueprint/material/common.js +7 -0
  454. package/dist/utility/blueprint/material/common.js.map +1 -0
  455. package/dist/utility/blueprint/material/inputs.js +1275 -1091
  456. package/dist/utility/blueprint/material/inputs.js.map +1 -1
  457. package/dist/utility/blueprint/material/ir.js +505 -490
  458. package/dist/utility/blueprint/material/ir.js.map +1 -1
  459. package/dist/utility/blueprint/material/pbr.js +32 -0
  460. package/dist/utility/blueprint/material/pbr.js.map +1 -1
  461. package/dist/utility/serialization/blueprint/constants.js +255 -0
  462. package/dist/utility/serialization/blueprint/constants.js.map +1 -0
  463. package/dist/utility/serialization/blueprint/material/constants.js +203 -0
  464. package/dist/utility/serialization/blueprint/material/constants.js.map +1 -0
  465. package/dist/utility/serialization/blueprint/material/texture.js +165 -0
  466. package/dist/utility/serialization/blueprint/material/texture.js.map +1 -0
  467. package/dist/utility/serialization/manager.js +55 -11
  468. package/dist/utility/serialization/manager.js.map +1 -1
  469. package/dist/utility/serialization/scene/animation.js +2 -0
  470. package/dist/utility/serialization/scene/animation.js.map +1 -1
  471. package/dist/utility/serialization/scene/batch.js +2 -0
  472. package/dist/utility/serialization/scene/batch.js.map +1 -1
  473. package/dist/utility/serialization/scene/camera.js +2 -0
  474. package/dist/utility/serialization/scene/camera.js.map +1 -1
  475. package/dist/utility/serialization/scene/common.js.map +1 -1
  476. package/dist/utility/serialization/scene/light.js +2 -0
  477. package/dist/utility/serialization/scene/light.js.map +1 -1
  478. package/dist/utility/serialization/scene/material.js +1 -0
  479. package/dist/utility/serialization/scene/material.js.map +1 -1
  480. package/dist/utility/serialization/scene/mesh.js +2 -0
  481. package/dist/utility/serialization/scene/mesh.js.map +1 -1
  482. package/dist/utility/serialization/scene/node.js +2 -0
  483. package/dist/utility/serialization/scene/node.js.map +1 -1
  484. package/dist/utility/serialization/scene/particle.js +2 -0
  485. package/dist/utility/serialization/scene/particle.js.map +1 -1
  486. package/dist/utility/serialization/scene/primitive.js +1 -0
  487. package/dist/utility/serialization/scene/primitive.js.map +1 -1
  488. package/dist/utility/serialization/scene/scene.js.map +1 -1
  489. package/dist/utility/serialization/scene/sprite.js +2 -0
  490. package/dist/utility/serialization/scene/sprite.js.map +1 -1
  491. package/dist/utility/serialization/scene/terrain.js +2 -0
  492. package/dist/utility/serialization/scene/terrain.js.map +1 -1
  493. package/dist/utility/serialization/scene/text.js +516 -0
  494. package/dist/utility/serialization/scene/text.js.map +1 -0
  495. package/dist/utility/serialization/scene/water.js +2 -0
  496. package/dist/utility/serialization/scene/water.js.map +1 -1
  497. package/dist/utility/serialization/types.js +4 -4
  498. package/dist/utility/serialization/types.js.map +1 -1
  499. package/dist/values.js +1 -5
  500. package/dist/values.js.map +1 -1
  501. package/package.json +3 -3
  502. package/dist/animation/joint_dynamics/vrm_spring_bone.js +0 -46
  503. package/dist/animation/joint_dynamics/vrm_spring_bone.js.map +0 -1
  504. package/dist/animation/spring/spring_bone.js +0 -240
  505. package/dist/animation/spring/spring_bone.js.map +0 -1
  506. package/dist/animation/spring/spring_bone_collider.js +0 -198
  507. package/dist/animation/spring/spring_bone_collider.js.map +0 -1
  508. package/dist/animation/spring/spring_bone_constraint.js +0 -170
  509. package/dist/animation/spring/spring_bone_constraint.js.map +0 -1
  510. package/dist/animation/spring/spring_bone_system.js +0 -328
  511. package/dist/animation/spring/spring_bone_system.js.map +0 -1
  512. package/dist/render/sky_motion_vector.js +0 -85
  513. package/dist/render/sky_motion_vector.js.map +0 -1
@@ -0,0 +1,704 @@
1
+ import { Scene } from '../../../scene/scene.js';
2
+ import { Application } from '../../../app/app.js';
3
+ import { panoramaToCubemap } from '../../panorama.js';
4
+ import { prefilterCubemap } from '../../pmrem.js';
5
+ import { NodeHierarchy } from './node.js';
6
+ import { Vector3, Vector4 } from '@zephyr3d/base';
7
+ import { JSONData, JSONArray } from '../json.js';
8
+
9
+ /** @internal */ function getSceneClass(manager) {
10
+ return {
11
+ ctor: Scene,
12
+ name: 'Scene',
13
+ createFunc () {
14
+ return {
15
+ obj: new Scene()
16
+ };
17
+ },
18
+ getProps () {
19
+ return [
20
+ {
21
+ name: 'Name',
22
+ type: 'string',
23
+ default: '',
24
+ isHidden () {
25
+ return true;
26
+ },
27
+ get (value) {
28
+ value.str[0] = this.name;
29
+ },
30
+ set (value) {
31
+ this.name = value.str[0];
32
+ }
33
+ },
34
+ {
35
+ name: 'EnvLightType',
36
+ phase: 0,
37
+ type: 'string',
38
+ options: {
39
+ enum: {
40
+ labels: [
41
+ 'None',
42
+ 'Constant',
43
+ 'Hemispheric',
44
+ 'IBL',
45
+ 'IBL-SH'
46
+ ],
47
+ values: [
48
+ 'none',
49
+ 'constant',
50
+ 'hemisphere',
51
+ 'ibl',
52
+ 'ibl-sh'
53
+ ]
54
+ }
55
+ },
56
+ default: 'ibl',
57
+ get (value) {
58
+ value.str[0] = this.env.light.type;
59
+ },
60
+ set (value) {
61
+ this.env.light.type = value.str[0];
62
+ }
63
+ },
64
+ {
65
+ name: 'AmbientColor',
66
+ type: 'rgb',
67
+ phase: 1,
68
+ default: [
69
+ 0.2,
70
+ 0.2,
71
+ 0.2
72
+ ],
73
+ options: {
74
+ animatable: true
75
+ },
76
+ get (value) {
77
+ const color = this.env.light.ambientColor;
78
+ value.num[0] = color.x;
79
+ value.num[1] = color.y;
80
+ value.num[2] = color.z;
81
+ },
82
+ set (value) {
83
+ this.env.light.ambientColor.setXYZW(value.num[0], value.num[1], value.num[2], 1);
84
+ },
85
+ isValid () {
86
+ return this.env.light.type === 'constant';
87
+ }
88
+ },
89
+ {
90
+ name: 'AmbientUp',
91
+ type: 'rgb',
92
+ phase: 1,
93
+ default: [
94
+ 0.3,
95
+ 0.5,
96
+ 0.8
97
+ ],
98
+ options: {
99
+ animatable: true
100
+ },
101
+ get (value) {
102
+ const color = this.env.light.ambientUp;
103
+ value.num[0] = color.x;
104
+ value.num[1] = color.y;
105
+ value.num[2] = color.z;
106
+ },
107
+ set (value) {
108
+ this.env.light.ambientUp.setXYZW(value.num[0], value.num[1], value.num[2], 1);
109
+ },
110
+ isValid () {
111
+ return this.env.light.type === 'hemisphere';
112
+ }
113
+ },
114
+ {
115
+ name: 'AmbientDown',
116
+ type: 'rgb',
117
+ phase: 1,
118
+ default: [
119
+ 0.2,
120
+ 0.2,
121
+ 0.2
122
+ ],
123
+ options: {
124
+ animatable: true
125
+ },
126
+ get (value) {
127
+ const color = this.env.light.ambientDown;
128
+ value.num[0] = color.x;
129
+ value.num[1] = color.y;
130
+ value.num[2] = color.z;
131
+ },
132
+ set (value) {
133
+ this.env.light.ambientDown.setXYZW(value.num[0], value.num[1], value.num[2], 1);
134
+ },
135
+ isValid () {
136
+ return this.env.light.type === 'hemisphere';
137
+ }
138
+ },
139
+ {
140
+ name: 'EnvLightStrength',
141
+ type: 'float',
142
+ phase: 0,
143
+ options: {
144
+ animatable: true,
145
+ minValue: 0,
146
+ maxValue: 10
147
+ },
148
+ default: 1,
149
+ get (value) {
150
+ value.num[0] = this.env.light.strength;
151
+ },
152
+ set (value) {
153
+ this.env.light.strength = value.num[0];
154
+ }
155
+ },
156
+ {
157
+ name: 'SHWindowWeights',
158
+ type: 'vec3',
159
+ options: {
160
+ minValue: 0,
161
+ maxValue: 1
162
+ },
163
+ default: [
164
+ 1,
165
+ 1,
166
+ 1
167
+ ],
168
+ get (value) {
169
+ const weights = this.env.sky.shWindowWeights;
170
+ value.num[0] = weights.x;
171
+ value.num[1] = weights.y;
172
+ value.num[2] = weights.z;
173
+ },
174
+ set (value) {
175
+ this.env.sky.shWindowWeights = new Vector3(value.num[0], value.num[1], value.num[2]);
176
+ }
177
+ },
178
+ {
179
+ name: 'RadianceConvSamples',
180
+ type: 'int',
181
+ options: {
182
+ minValue: 1,
183
+ maxValue: 2048
184
+ },
185
+ default: 64,
186
+ get (value) {
187
+ value.num[0] = this.env.sky.radianceConvSamples;
188
+ },
189
+ set (value) {
190
+ this.env.sky.radianceConvSamples = value.num[0];
191
+ }
192
+ },
193
+ {
194
+ name: 'IrradianceConvSamples',
195
+ type: 'int',
196
+ options: {
197
+ minValue: 1,
198
+ maxValue: 2048
199
+ },
200
+ default: 256,
201
+ get (value) {
202
+ value.num[0] = this.env.sky.irradianceConvSamples;
203
+ },
204
+ set (value) {
205
+ this.env.sky.irradianceConvSamples = value.num[0];
206
+ }
207
+ },
208
+ {
209
+ name: 'SkyType',
210
+ type: 'string',
211
+ phase: 0,
212
+ options: {
213
+ enum: {
214
+ labels: [
215
+ 'None',
216
+ 'Color',
217
+ 'SkyBox',
218
+ 'Scatter'
219
+ ],
220
+ values: [
221
+ 'none',
222
+ 'color',
223
+ 'skybox',
224
+ 'scatter'
225
+ ]
226
+ }
227
+ },
228
+ default: 'scatter',
229
+ get (value) {
230
+ value.str[0] = this.env.sky.skyType;
231
+ },
232
+ set (value) {
233
+ this.env.sky.skyType = value.str[0];
234
+ }
235
+ },
236
+ {
237
+ name: 'SkyColor',
238
+ type: 'rgb',
239
+ phase: 1,
240
+ default: [
241
+ 1,
242
+ 1,
243
+ 1
244
+ ],
245
+ options: {
246
+ animatable: true
247
+ },
248
+ isValid () {
249
+ return this.env.sky.skyType === 'color';
250
+ },
251
+ get (value) {
252
+ const color = this.env.sky.skyColor;
253
+ value.num[0] = color.x;
254
+ value.num[1] = color.y;
255
+ value.num[2] = color.z;
256
+ },
257
+ set (value) {
258
+ this.env.sky.skyColor = new Vector4(value.num[0], value.num[1], value.num[2], 1);
259
+ this.env.sky.invalidate();
260
+ }
261
+ },
262
+ {
263
+ name: 'FogType',
264
+ type: 'string',
265
+ phase: 0,
266
+ options: {
267
+ enum: {
268
+ labels: [
269
+ 'None',
270
+ 'Linear',
271
+ 'Exp',
272
+ 'Exp2',
273
+ 'ExponentialHeight'
274
+ ],
275
+ values: [
276
+ 'none',
277
+ 'linear',
278
+ 'exp',
279
+ 'exp2',
280
+ 'height_fog'
281
+ ]
282
+ }
283
+ },
284
+ default: 'none',
285
+ get (value) {
286
+ value.str[0] = this.env.sky.fogType;
287
+ },
288
+ set (value) {
289
+ this.env.sky.fogType = value.str[0];
290
+ }
291
+ },
292
+ {
293
+ type: 'float',
294
+ name: 'HeightFogDensity',
295
+ default: 0.04,
296
+ options: {
297
+ group: 'HeightFog',
298
+ label: 'Density',
299
+ minValue: 0,
300
+ maxValue: 1
301
+ },
302
+ isValid () {
303
+ return this.env.sky.fogType === 'height_fog';
304
+ },
305
+ get (value) {
306
+ value.num[0] = this.env.sky.heightFogDensity;
307
+ },
308
+ set (value) {
309
+ this.env.sky.heightFogDensity = value.num[0];
310
+ }
311
+ },
312
+ {
313
+ name: 'HeightFogFalloff',
314
+ type: 'float',
315
+ default: 0.2,
316
+ options: {
317
+ group: 'HeightFog',
318
+ label: 'Falloff',
319
+ minValue: 0,
320
+ maxValue: 1
321
+ },
322
+ isValid () {
323
+ return this.env.sky.fogType === 'height_fog';
324
+ },
325
+ get (value) {
326
+ value.num[0] = this.env.sky.heightFogFalloff;
327
+ },
328
+ set (value) {
329
+ this.env.sky.heightFogFalloff = value.num[0];
330
+ }
331
+ },
332
+ {
333
+ name: 'HeightFogStartHeight',
334
+ type: 'float',
335
+ default: 0,
336
+ options: {
337
+ group: 'HeightFog',
338
+ label: 'StartHeight',
339
+ minValue: 0,
340
+ maxValue: 1000
341
+ },
342
+ isValid () {
343
+ return this.env.sky.fogType === 'height_fog';
344
+ },
345
+ get (value) {
346
+ value.num[0] = this.env.sky.heightFogStartHeight;
347
+ },
348
+ set (value) {
349
+ this.env.sky.heightFogStartHeight = value.num[0];
350
+ }
351
+ },
352
+ {
353
+ name: 'HeightFogColor',
354
+ type: 'rgb',
355
+ phase: 1,
356
+ default: [
357
+ 0,
358
+ 0,
359
+ 0
360
+ ],
361
+ options: {
362
+ group: 'HeightFog',
363
+ label: 'FogColor',
364
+ animatable: true
365
+ },
366
+ isValid () {
367
+ return this.env.sky.fogType === 'height_fog';
368
+ },
369
+ get (value) {
370
+ const color = this.env.sky.heightFogColor;
371
+ value.num[0] = color.x;
372
+ value.num[1] = color.y;
373
+ value.num[2] = color.z;
374
+ },
375
+ set (value) {
376
+ this.env.sky.heightFogColor = new Vector3(value.num[0], value.num[1], value.num[2]);
377
+ }
378
+ },
379
+ {
380
+ name: 'HeightFogStartDistance',
381
+ type: 'float',
382
+ default: 0,
383
+ options: {
384
+ group: 'HeightFog',
385
+ label: 'StartDistance'
386
+ },
387
+ isValid () {
388
+ return this.env.sky.fogType === 'height_fog';
389
+ },
390
+ get (value) {
391
+ value.num[0] = this.env.sky.heightFogStartDistance;
392
+ },
393
+ set (value) {
394
+ this.env.sky.heightFogStartDistance = value.num[0];
395
+ }
396
+ },
397
+ {
398
+ name: 'HeightFogMaxOpacity',
399
+ type: 'float',
400
+ options: {
401
+ group: 'HeightFog',
402
+ label: 'MaxOpacity',
403
+ minValue: 0,
404
+ maxValue: 1
405
+ },
406
+ default: 1,
407
+ isValid () {
408
+ return this.env.sky.fogType === 'height_fog';
409
+ },
410
+ get (value) {
411
+ value.num[0] = this.env.sky.heightFogMaxOpacity;
412
+ },
413
+ set (value) {
414
+ this.env.sky.heightFogMaxOpacity = value.num[0];
415
+ }
416
+ },
417
+ {
418
+ name: 'HeightFogAtmosphereStrength',
419
+ type: 'float',
420
+ options: {
421
+ group: 'HeightFog',
422
+ label: 'AtmosphereStrength',
423
+ minValue: 0,
424
+ maxValue: 10
425
+ },
426
+ default: 1,
427
+ isValid () {
428
+ return this.env.sky.fogType === 'height_fog';
429
+ },
430
+ get (value) {
431
+ value.num[0] = this.env.sky.heightFogAtmosphereContribution;
432
+ },
433
+ set (value) {
434
+ this.env.sky.heightFogAtmosphereContribution = value.num[0];
435
+ }
436
+ },
437
+ {
438
+ name: 'HeightFogDirExponent',
439
+ type: 'float',
440
+ default: 4,
441
+ options: {
442
+ group: 'HeightFog',
443
+ label: 'DirectionalExponent'
444
+ },
445
+ isValid () {
446
+ return this.env.sky.fogType === 'height_fog';
447
+ },
448
+ get (value) {
449
+ value.num[0] = this.env.sky.heightFogDirExponent;
450
+ },
451
+ set (value) {
452
+ this.env.sky.heightFogDirExponent = value.num[0];
453
+ }
454
+ },
455
+ {
456
+ name: 'HeightFogDirColor',
457
+ type: 'rgb',
458
+ default: [
459
+ 0,
460
+ 0,
461
+ 0
462
+ ],
463
+ options: {
464
+ group: 'HeightFog',
465
+ label: 'DirectionalInscattering'
466
+ },
467
+ isValid () {
468
+ return this.env.sky.fogType === 'height_fog';
469
+ },
470
+ get (value) {
471
+ value.num[0] = this.env.sky.heightFogDirColor.x;
472
+ value.num[1] = this.env.sky.heightFogDirColor.y;
473
+ value.num[2] = this.env.sky.heightFogDirColor.z;
474
+ },
475
+ set (value) {
476
+ this.env.sky.heightFogDirColor = new Vector3(value.num[0], value.num[1], value.num[2]);
477
+ }
478
+ },
479
+ {
480
+ name: 'AerialPerspectiveDistance',
481
+ type: 'float',
482
+ phase: 1,
483
+ options: {
484
+ animatable: true,
485
+ minValue: 1,
486
+ maxValue: 50000
487
+ },
488
+ default: 1,
489
+ get (value) {
490
+ value.num[0] = this.env.sky.aerialPerspectiveDistance;
491
+ },
492
+ set (value) {
493
+ this.env.sky.aerialPerspectiveDistance = value.num[0];
494
+ },
495
+ isValid () {
496
+ return this.env.sky.skyType === 'scatter';
497
+ }
498
+ },
499
+ {
500
+ name: 'CameraHeightScale',
501
+ type: 'float',
502
+ phase: 1,
503
+ options: {
504
+ animatable: true,
505
+ minValue: 1,
506
+ maxValue: 1000
507
+ },
508
+ default: 1,
509
+ get (value) {
510
+ value.num[0] = this.env.sky.cameraHeightScale;
511
+ },
512
+ set (value) {
513
+ this.env.sky.cameraHeightScale = value.num[0];
514
+ },
515
+ isValid () {
516
+ return this.env.sky.skyType === 'scatter';
517
+ }
518
+ },
519
+ {
520
+ name: 'AtmosphereExposure',
521
+ type: 'float',
522
+ options: {
523
+ animatable: true,
524
+ minValue: 0,
525
+ maxValue: 8
526
+ },
527
+ default: 1,
528
+ get (value) {
529
+ value.num[0] = this.env.sky.atmosphereExposure;
530
+ },
531
+ set (value) {
532
+ this.env.sky.atmosphereExposure = value.num[0];
533
+ },
534
+ isValid () {
535
+ return this.env.sky.skyType === 'scatter';
536
+ }
537
+ },
538
+ {
539
+ name: 'Cloudy',
540
+ type: 'float',
541
+ default: 0.6,
542
+ phase: 1,
543
+ options: {
544
+ animatable: true,
545
+ minValue: 0,
546
+ maxValue: 1
547
+ },
548
+ get (value) {
549
+ value.num[0] = this.env.sky.cloudy;
550
+ },
551
+ set (value) {
552
+ this.env.sky.cloudy = value.num[0];
553
+ },
554
+ isValid () {
555
+ return this.env.sky.skyType === 'scatter';
556
+ }
557
+ },
558
+ {
559
+ name: 'CloudIntensity',
560
+ type: 'float',
561
+ default: 40,
562
+ phase: 1,
563
+ options: {
564
+ animatable: true,
565
+ minValue: 0,
566
+ maxValue: 200
567
+ },
568
+ get (value) {
569
+ value.num[0] = this.env.sky.cloudIntensity;
570
+ },
571
+ set (value) {
572
+ this.env.sky.cloudIntensity = value.num[0];
573
+ },
574
+ isValid () {
575
+ return this.env.sky.skyType === 'scatter';
576
+ }
577
+ },
578
+ {
579
+ name: 'Wind',
580
+ type: 'vec2',
581
+ default: [
582
+ 0,
583
+ 0
584
+ ],
585
+ phase: 1,
586
+ options: {
587
+ animatable: true,
588
+ minValue: -100,
589
+ maxValue: 100
590
+ },
591
+ get (value) {
592
+ value.num[0] = this.env.sky.wind.x;
593
+ value.num[1] = this.env.sky.wind.y;
594
+ },
595
+ set (value) {
596
+ this.env.sky.wind.setXY(value.num[0], value.num[1]);
597
+ },
598
+ isValid () {
599
+ return this.env.sky.skyType === 'scatter';
600
+ }
601
+ },
602
+ {
603
+ name: 'PanoramaTexture',
604
+ type: 'object',
605
+ phase: 1,
606
+ get (value) {
607
+ value.str[0] = this.env.sky.panoramaTextureAsset;
608
+ },
609
+ async set (value) {
610
+ if (value.str[0]) {
611
+ const assetId = value.str[0];
612
+ let tex;
613
+ try {
614
+ tex = await manager.fetchTexture(assetId);
615
+ } catch (err) {
616
+ console.error(`Load asset failed: ${value.str[0]}: ${err}`);
617
+ tex = null;
618
+ }
619
+ if (tex?.isTexture2D()) {
620
+ const device = Application.instance.device;
621
+ const skyBoxTexture = this.env.sky.skyboxTexture ?? device.createCubeTexture('rgba16f', 1024);
622
+ const radianceMap = this.env.light.radianceMap ?? device.createCubeTexture('rgba16f', 256);
623
+ const irradianceMap = this.env.light.irradianceMap ?? device.createCubeTexture('rgba16f', 64, {
624
+ samplerOptions: {
625
+ mipFilter: 'none'
626
+ }
627
+ });
628
+ panoramaToCubemap(tex, skyBoxTexture);
629
+ prefilterCubemap(skyBoxTexture, 'ggx', radianceMap);
630
+ prefilterCubemap(skyBoxTexture, 'lambertian', irradianceMap);
631
+ this.env.sky.skyboxTexture = skyBoxTexture;
632
+ this.env.light.radianceMap = radianceMap;
633
+ this.env.light.irradianceMap = irradianceMap;
634
+ this.env.sky.panoramaTextureAsset = assetId;
635
+ this.env.sky.invalidate();
636
+ tex.dispose();
637
+ } else {
638
+ console.error('Invalid skybox texture');
639
+ }
640
+ }
641
+ },
642
+ isValid () {
643
+ return this.env.sky.skyType === 'skybox';
644
+ }
645
+ },
646
+ {
647
+ name: 'NodeHierarchy',
648
+ type: 'object',
649
+ isHidden () {
650
+ return true;
651
+ },
652
+ get (value) {
653
+ value.object = [
654
+ new NodeHierarchy(this, this.rootNode)
655
+ ];
656
+ },
657
+ set (value) {
658
+ const nodeHierarchy = value.object[0];
659
+ nodeHierarchy.rootNode.remove();
660
+ for (const child of nodeHierarchy.rootNode.children.slice()){
661
+ child.get().parent = this.rootNode;
662
+ }
663
+ }
664
+ },
665
+ {
666
+ name: 'MainCamera',
667
+ type: 'string',
668
+ isHidden () {
669
+ return true;
670
+ },
671
+ get (value) {
672
+ value.str[0] = this.mainCamera?.persistentId ?? '';
673
+ },
674
+ set (value) {
675
+ this.mainCamera = value.str[0] ? this.findNodeById(value.str[0]) : null;
676
+ }
677
+ },
678
+ {
679
+ name: 'Metadata',
680
+ type: 'object',
681
+ default: null,
682
+ options: {
683
+ objectTypes: [
684
+ JSONData,
685
+ JSONArray
686
+ ]
687
+ },
688
+ isNullable () {
689
+ return true;
690
+ },
691
+ get (value) {
692
+ value.object[0] = this.metaData ? Array.isArray(this.metaData) ? new JSONArray(null, this.metaData) : new JSONData(null, this.metaData) : null;
693
+ },
694
+ set (value) {
695
+ this.metaData = value?.object[0]?.data ?? null;
696
+ }
697
+ }
698
+ ];
699
+ }
700
+ };
701
+ }
702
+
703
+ export { getSceneClass };
704
+ //# sourceMappingURL=scene.js.map