@zephyr3d/scene 0.8.0 → 0.8.1

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 (387) hide show
  1. package/dist/animation/animationset.js +198 -1
  2. package/dist/animation/animationset.js.map +1 -1
  3. package/dist/animation/ik/ccd_solver.js +3 -4
  4. package/dist/animation/ik/ccd_solver.js.map +1 -1
  5. package/dist/animation/ik/fabrik_solver.js +3 -4
  6. package/dist/animation/ik/fabrik_solver.js.map +1 -1
  7. package/dist/animation/ik/ik_pole_constraint.js +7 -2
  8. package/dist/animation/ik/ik_pole_constraint.js.map +1 -1
  9. package/dist/animation/ik/ik_utils.js +0 -79
  10. package/dist/animation/ik/ik_utils.js.map +1 -1
  11. package/dist/animation/ik/two_bone_ik_solver.js +3 -4
  12. package/dist/animation/ik/two_bone_ik_solver.js.map +1 -1
  13. package/dist/animation/spring/spring_bone.js +240 -0
  14. package/dist/animation/spring/spring_bone.js.map +1 -0
  15. package/dist/animation/spring/spring_bone_collider.js +198 -0
  16. package/dist/animation/spring/spring_bone_collider.js.map +1 -0
  17. package/dist/animation/spring/spring_bone_constraint.js +170 -0
  18. package/dist/animation/spring/spring_bone_constraint.js.map +1 -0
  19. package/dist/animation/spring/spring_bone_system.js +328 -0
  20. package/dist/animation/spring/spring_bone_system.js.map +1 -0
  21. package/dist/asset/model.js +2 -2
  22. package/dist/index.d.ts +15 -0
  23. package/dist/material/mixins/pbr/common.js +20 -17
  24. package/dist/material/mixins/pbr/common.js.map +1 -1
  25. package/dist/render/gpu_picking.js +100 -0
  26. package/dist/render/gpu_picking.js.map +1 -0
  27. package/dist/render/rendergraph/device_pool_allocator.js +41 -0
  28. package/dist/render/rendergraph/device_pool_allocator.js.map +1 -0
  29. package/dist/render/rendergraph/executor.js +146 -0
  30. package/dist/render/rendergraph/executor.js.map +1 -0
  31. package/dist/render/rendergraph/forward_plus_builder.js +414 -0
  32. package/dist/render/rendergraph/forward_plus_builder.js.map +1 -0
  33. package/dist/render/rendergraph/rendergraph.js +306 -0
  34. package/dist/render/rendergraph/rendergraph.js.map +1 -0
  35. package/dist/render/rendergraph/types.js +57 -0
  36. package/dist/render/rendergraph/types.js.map +1 -0
  37. package/dist/render/sky_motion_vector.js +85 -0
  38. package/dist/render/sky_motion_vector.js.map +1 -0
  39. package/dist/utility/serialization/scene/animation.js +3 -3
  40. package/dist/utility/serialization/scene/node.js +1 -1
  41. package/package.json +2 -2
  42. package/dist/animation/ik/ik_chain_builder.js +0 -68
  43. package/dist/animation/ik/ik_chain_builder.js.map +0 -1
  44. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/runtimemgr.js +0 -38
  45. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/runtimemgr.js.map +0 -1
  46. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/runtimescript.js +0 -10
  47. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/runtimescript.js.map +0 -1
  48. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/scriptingsystem.js +0 -127
  49. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/scriptingsystem.js.map +0 -1
  50. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/scriptregistry.js +0 -263
  51. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/scriptregistry.js.map +0 -1
  52. package/dist/src/animation/animation.js +0 -127
  53. package/dist/src/animation/animation.js.map +0 -1
  54. package/dist/src/animation/animationset.js +0 -255
  55. package/dist/src/animation/animationset.js.map +0 -1
  56. package/dist/src/animation/animationtrack.js +0 -34
  57. package/dist/src/animation/animationtrack.js.map +0 -1
  58. package/dist/src/animation/eulerrotationtrack.js +0 -52
  59. package/dist/src/animation/eulerrotationtrack.js.map +0 -1
  60. package/dist/src/animation/morphtarget.js +0 -93
  61. package/dist/src/animation/morphtarget.js.map +0 -1
  62. package/dist/src/animation/morphtrack.js +0 -70
  63. package/dist/src/animation/morphtrack.js.map +0 -1
  64. package/dist/src/animation/proptrack.js +0 -161
  65. package/dist/src/animation/proptrack.js.map +0 -1
  66. package/dist/src/animation/rotationtrack.js +0 -51
  67. package/dist/src/animation/rotationtrack.js.map +0 -1
  68. package/dist/src/animation/scaletrack.js +0 -50
  69. package/dist/src/animation/scaletrack.js.map +0 -1
  70. package/dist/src/animation/skeleton.js +0 -204
  71. package/dist/src/animation/skeleton.js.map +0 -1
  72. package/dist/src/animation/translationtrack.js +0 -50
  73. package/dist/src/animation/translationtrack.js.map +0 -1
  74. package/dist/src/app/app.js +0 -129
  75. package/dist/src/app/app.js.map +0 -1
  76. package/dist/src/app/inputmgr.js +0 -267
  77. package/dist/src/app/inputmgr.js.map +0 -1
  78. package/dist/src/asset/assetmanager.js +0 -404
  79. package/dist/src/asset/assetmanager.js.map +0 -1
  80. package/dist/src/asset/builtin.js +0 -337
  81. package/dist/src/asset/builtin.js.map +0 -1
  82. package/dist/src/asset/loaders/dds/dds.js +0 -470
  83. package/dist/src/asset/loaders/dds/dds.js.map +0 -1
  84. package/dist/src/asset/loaders/dds/dds_loader.js +0 -28
  85. package/dist/src/asset/loaders/dds/dds_loader.js.map +0 -1
  86. package/dist/src/asset/loaders/gltf/gltf_loader.js +0 -1265
  87. package/dist/src/asset/loaders/gltf/gltf_loader.js.map +0 -1
  88. package/dist/src/asset/loaders/gltf/helpers.js +0 -327
  89. package/dist/src/asset/loaders/gltf/helpers.js.map +0 -1
  90. package/dist/src/asset/loaders/hdr/hdr.js +0 -180
  91. package/dist/src/asset/loaders/hdr/hdr.js.map +0 -1
  92. package/dist/src/asset/loaders/image/tga_Loader.js +0 -116
  93. package/dist/src/asset/loaders/image/tga_Loader.js.map +0 -1
  94. package/dist/src/asset/loaders/image/webimage_loader.js +0 -63
  95. package/dist/src/asset/loaders/image/webimage_loader.js.map +0 -1
  96. package/dist/src/asset/loaders/loader.js +0 -45
  97. package/dist/src/asset/loaders/loader.js.map +0 -1
  98. package/dist/src/asset/model.js +0 -414
  99. package/dist/src/asset/model.js.map +0 -1
  100. package/dist/src/blitter/bilateralblur.js +0 -221
  101. package/dist/src/blitter/bilateralblur.js.map +0 -1
  102. package/dist/src/blitter/blitter.js +0 -390
  103. package/dist/src/blitter/blitter.js.map +0 -1
  104. package/dist/src/blitter/box.js +0 -118
  105. package/dist/src/blitter/box.js.map +0 -1
  106. package/dist/src/blitter/copy.js +0 -22
  107. package/dist/src/blitter/copy.js.map +0 -1
  108. package/dist/src/blitter/gaussianblur.js +0 -228
  109. package/dist/src/blitter/gaussianblur.js.map +0 -1
  110. package/dist/src/camera/base.js +0 -92
  111. package/dist/src/camera/base.js.map +0 -1
  112. package/dist/src/camera/camera.js +0 -1005
  113. package/dist/src/camera/camera.js.map +0 -1
  114. package/dist/src/camera/fps.js +0 -238
  115. package/dist/src/camera/fps.js.map +0 -1
  116. package/dist/src/camera/orbit.js +0 -245
  117. package/dist/src/camera/orbit.js.map +0 -1
  118. package/dist/src/camera/orthocamera.js +0 -167
  119. package/dist/src/camera/orthocamera.js.map +0 -1
  120. package/dist/src/camera/perspectivecamera.js +0 -141
  121. package/dist/src/camera/perspectivecamera.js.map +0 -1
  122. package/dist/src/index.js +0 -120
  123. package/dist/src/index.js.map +0 -1
  124. package/dist/src/material/blinn.js +0 -81
  125. package/dist/src/material/blinn.js.map +0 -1
  126. package/dist/src/material/grassmaterial.js +0 -113
  127. package/dist/src/material/grassmaterial.js.map +0 -1
  128. package/dist/src/material/lambert.js +0 -92
  129. package/dist/src/material/lambert.js.map +0 -1
  130. package/dist/src/material/material.js +0 -301
  131. package/dist/src/material/material.js.map +0 -1
  132. package/dist/src/material/meshmaterial.js +0 -704
  133. package/dist/src/material/meshmaterial.js.map +0 -1
  134. package/dist/src/material/mixins/albedocolor.js +0 -76
  135. package/dist/src/material/mixins/albedocolor.js.map +0 -1
  136. package/dist/src/material/mixins/foliage.js +0 -47
  137. package/dist/src/material/mixins/foliage.js.map +0 -1
  138. package/dist/src/material/mixins/lightmodel/blinnphong.js +0 -112
  139. package/dist/src/material/mixins/lightmodel/blinnphong.js.map +0 -1
  140. package/dist/src/material/mixins/lightmodel/lambert.js +0 -58
  141. package/dist/src/material/mixins/lightmodel/lambert.js.map +0 -1
  142. package/dist/src/material/mixins/lightmodel/pbrmetallicroughness.js +0 -178
  143. package/dist/src/material/mixins/lightmodel/pbrmetallicroughness.js.map +0 -1
  144. package/dist/src/material/mixins/lightmodel/pbrspecularglossness.js +0 -139
  145. package/dist/src/material/mixins/lightmodel/pbrspecularglossness.js.map +0 -1
  146. package/dist/src/material/mixins/lit.js +0 -476
  147. package/dist/src/material/mixins/lit.js.map +0 -1
  148. package/dist/src/material/mixins/pbr/common.js +0 -918
  149. package/dist/src/material/mixins/pbr/common.js.map +0 -1
  150. package/dist/src/material/mixins/texture.js +0 -172
  151. package/dist/src/material/mixins/texture.js.map +0 -1
  152. package/dist/src/material/mixins/vertexcolor.js +0 -56
  153. package/dist/src/material/mixins/vertexcolor.js.map +0 -1
  154. package/dist/src/material/particle.js +0 -178
  155. package/dist/src/material/particle.js.map +0 -1
  156. package/dist/src/material/pbrmr.js +0 -97
  157. package/dist/src/material/pbrmr.js.map +0 -1
  158. package/dist/src/material/pbrsg.js +0 -97
  159. package/dist/src/material/pbrsg.js.map +0 -1
  160. package/dist/src/material/shader/helper.js +0 -1209
  161. package/dist/src/material/shader/helper.js.map +0 -1
  162. package/dist/src/material/terrain-cm.js +0 -606
  163. package/dist/src/material/terrain-cm.js.map +0 -1
  164. package/dist/src/material/terrainmaterial.js +0 -375
  165. package/dist/src/material/terrainmaterial.js.map +0 -1
  166. package/dist/src/material/unlit.js +0 -41
  167. package/dist/src/material/unlit.js.map +0 -1
  168. package/dist/src/material/water.js +0 -417
  169. package/dist/src/material/water.js.map +0 -1
  170. package/dist/src/posteffect/bloom.js +0 -361
  171. package/dist/src/posteffect/bloom.js.map +0 -1
  172. package/dist/src/posteffect/compositor.js +0 -226
  173. package/dist/src/posteffect/compositor.js.map +0 -1
  174. package/dist/src/posteffect/fxaa.js +0 -273
  175. package/dist/src/posteffect/fxaa.js.map +0 -1
  176. package/dist/src/posteffect/grayscale.js +0 -69
  177. package/dist/src/posteffect/grayscale.js.map +0 -1
  178. package/dist/src/posteffect/motionblur.js +0 -96
  179. package/dist/src/posteffect/motionblur.js.map +0 -1
  180. package/dist/src/posteffect/posteffect.js +0 -126
  181. package/dist/src/posteffect/posteffect.js.map +0 -1
  182. package/dist/src/posteffect/sao.js +0 -324
  183. package/dist/src/posteffect/sao.js.map +0 -1
  184. package/dist/src/posteffect/ssr.js +0 -489
  185. package/dist/src/posteffect/ssr.js.map +0 -1
  186. package/dist/src/posteffect/taa.js +0 -172
  187. package/dist/src/posteffect/taa.js.map +0 -1
  188. package/dist/src/posteffect/tonemap.js +0 -94
  189. package/dist/src/posteffect/tonemap.js.map +0 -1
  190. package/dist/src/render/abuffer_oit.js +0 -361
  191. package/dist/src/render/abuffer_oit.js.map +0 -1
  192. package/dist/src/render/clipmap.js +0 -851
  193. package/dist/src/render/clipmap.js.map +0 -1
  194. package/dist/src/render/cluster_light.js +0 -333
  195. package/dist/src/render/cluster_light.js.map +0 -1
  196. package/dist/src/render/cull_visitor.js +0 -187
  197. package/dist/src/render/cull_visitor.js.map +0 -1
  198. package/dist/src/render/depthpass.js +0 -68
  199. package/dist/src/render/depthpass.js.map +0 -1
  200. package/dist/src/render/drawable_mixin.js +0 -227
  201. package/dist/src/render/drawable_mixin.js.map +0 -1
  202. package/dist/src/render/envlight.js +0 -463
  203. package/dist/src/render/envlight.js.map +0 -1
  204. package/dist/src/render/fbm_wavegenerator.js +0 -251
  205. package/dist/src/render/fbm_wavegenerator.js.map +0 -1
  206. package/dist/src/render/fft_wavegenerator.js +0 -1006
  207. package/dist/src/render/fft_wavegenerator.js.map +0 -1
  208. package/dist/src/render/fullscreenquad.js +0 -38
  209. package/dist/src/render/fullscreenquad.js.map +0 -1
  210. package/dist/src/render/gerstner_wavegenerator.js +0 -314
  211. package/dist/src/render/gerstner_wavegenerator.js.map +0 -1
  212. package/dist/src/render/globalbindgroup_allocator.js +0 -60
  213. package/dist/src/render/globalbindgroup_allocator.js.map +0 -1
  214. package/dist/src/render/hzb.js +0 -273
  215. package/dist/src/render/hzb.js.map +0 -1
  216. package/dist/src/render/lightpass.js +0 -172
  217. package/dist/src/render/lightpass.js.map +0 -1
  218. package/dist/src/render/objectcolorpass.js +0 -51
  219. package/dist/src/render/objectcolorpass.js.map +0 -1
  220. package/dist/src/render/primitive.js +0 -364
  221. package/dist/src/render/primitive.js.map +0 -1
  222. package/dist/src/render/render_queue.js +0 -467
  223. package/dist/src/render/render_queue.js.map +0 -1
  224. package/dist/src/render/renderbundle_wrapper.js +0 -152
  225. package/dist/src/render/renderbundle_wrapper.js.map +0 -1
  226. package/dist/src/render/renderer.js +0 -455
  227. package/dist/src/render/renderer.js.map +0 -1
  228. package/dist/src/render/renderpass.js +0 -200
  229. package/dist/src/render/renderpass.js.map +0 -1
  230. package/dist/src/render/shadowmap_pass.js +0 -56
  231. package/dist/src/render/shadowmap_pass.js.map +0 -1
  232. package/dist/src/render/sky.js +0 -1103
  233. package/dist/src/render/sky.js.map +0 -1
  234. package/dist/src/render/weightedblended_oit.js +0 -168
  235. package/dist/src/render/weightedblended_oit.js.map +0 -1
  236. package/dist/src/scene/batchgroup.js +0 -162
  237. package/dist/src/scene/batchgroup.js.map +0 -1
  238. package/dist/src/scene/environment.js +0 -209
  239. package/dist/src/scene/environment.js.map +0 -1
  240. package/dist/src/scene/graph_node.js +0 -72
  241. package/dist/src/scene/graph_node.js.map +0 -1
  242. package/dist/src/scene/light.js +0 -416
  243. package/dist/src/scene/light.js.map +0 -1
  244. package/dist/src/scene/mesh.js +0 -341
  245. package/dist/src/scene/mesh.js.map +0 -1
  246. package/dist/src/scene/octree.js +0 -649
  247. package/dist/src/scene/octree.js.map +0 -1
  248. package/dist/src/scene/particlesys.js +0 -738
  249. package/dist/src/scene/particlesys.js.map +0 -1
  250. package/dist/src/scene/raycast_visitor.js +0 -103
  251. package/dist/src/scene/raycast_visitor.js.map +0 -1
  252. package/dist/src/scene/scene.js +0 -284
  253. package/dist/src/scene/scene.js.map +0 -1
  254. package/dist/src/scene/scene_node.js +0 -732
  255. package/dist/src/scene/scene_node.js.map +0 -1
  256. package/dist/src/scene/terrain/grass.js +0 -278
  257. package/dist/src/scene/terrain/grass.js.map +0 -1
  258. package/dist/src/scene/terrain/heightfield.js +0 -475
  259. package/dist/src/scene/terrain/heightfield.js.map +0 -1
  260. package/dist/src/scene/terrain/patch.js +0 -530
  261. package/dist/src/scene/terrain/patch.js.map +0 -1
  262. package/dist/src/scene/terrain/quadtree.js +0 -461
  263. package/dist/src/scene/terrain/quadtree.js.map +0 -1
  264. package/dist/src/scene/terrain/terrain.js +0 -246
  265. package/dist/src/scene/terrain/terrain.js.map +0 -1
  266. package/dist/src/scene/terrain-cm/grass.js +0 -594
  267. package/dist/src/scene/terrain-cm/grass.js.map +0 -1
  268. package/dist/src/scene/terrain-cm/grassmaterial.js +0 -159
  269. package/dist/src/scene/terrain-cm/grassmaterial.js.map +0 -1
  270. package/dist/src/scene/terrain-cm/terrain-cm.js +0 -538
  271. package/dist/src/scene/terrain-cm/terrain-cm.js.map +0 -1
  272. package/dist/src/scene/water.js +0 -374
  273. package/dist/src/scene/water.js.map +0 -1
  274. package/dist/src/shaders/atmosphere.js +0 -957
  275. package/dist/src/shaders/atmosphere.js.map +0 -1
  276. package/dist/src/shaders/fog.js +0 -112
  277. package/dist/src/shaders/fog.js.map +0 -1
  278. package/dist/src/shaders/misc.js +0 -266
  279. package/dist/src/shaders/misc.js.map +0 -1
  280. package/dist/src/shaders/noise.js +0 -222
  281. package/dist/src/shaders/noise.js.map +0 -1
  282. package/dist/src/shaders/pbr.js +0 -51
  283. package/dist/src/shaders/pbr.js.map +0 -1
  284. package/dist/src/shaders/shadow.js +0 -636
  285. package/dist/src/shaders/shadow.js.map +0 -1
  286. package/dist/src/shaders/ssr.js +0 -490
  287. package/dist/src/shaders/ssr.js.map +0 -1
  288. package/dist/src/shaders/temporal.js +0 -215
  289. package/dist/src/shaders/temporal.js.map +0 -1
  290. package/dist/src/shaders/water.js +0 -756
  291. package/dist/src/shaders/water.js.map +0 -1
  292. package/dist/src/shadow/esm.js +0 -237
  293. package/dist/src/shadow/esm.js.map +0 -1
  294. package/dist/src/shadow/pcf_opt.js +0 -181
  295. package/dist/src/shadow/pcf_opt.js.map +0 -1
  296. package/dist/src/shadow/pcf_pd.js +0 -189
  297. package/dist/src/shadow/pcf_pd.js.map +0 -1
  298. package/dist/src/shadow/shader.js +0 -37
  299. package/dist/src/shadow/shader.js.map +0 -1
  300. package/dist/src/shadow/shadow_impl.js +0 -15
  301. package/dist/src/shadow/shadow_impl.js.map +0 -1
  302. package/dist/src/shadow/shadowmapper.js +0 -790
  303. package/dist/src/shadow/shadowmapper.js.map +0 -1
  304. package/dist/src/shadow/ssm.js +0 -159
  305. package/dist/src/shadow/ssm.js.map +0 -1
  306. package/dist/src/shadow/vsm.js +0 -297
  307. package/dist/src/shadow/vsm.js.map +0 -1
  308. package/dist/src/shapes/box.js +0 -386
  309. package/dist/src/shapes/box.js.map +0 -1
  310. package/dist/src/shapes/cylinder.js +0 -125
  311. package/dist/src/shapes/cylinder.js.map +0 -1
  312. package/dist/src/shapes/plane.js +0 -88
  313. package/dist/src/shapes/plane.js.map +0 -1
  314. package/dist/src/shapes/shape.js +0 -87
  315. package/dist/src/shapes/shape.js.map +0 -1
  316. package/dist/src/shapes/sphere.js +0 -114
  317. package/dist/src/shapes/sphere.js.map +0 -1
  318. package/dist/src/shapes/tetrahedron.js +0 -188
  319. package/dist/src/shapes/tetrahedron.js.map +0 -1
  320. package/dist/src/shapes/torus.js +0 -111
  321. package/dist/src/shapes/torus.js.map +0 -1
  322. package/dist/src/utility/aabbtree.js +0 -400
  323. package/dist/src/utility/aabbtree.js.map +0 -1
  324. package/dist/src/utility/bounding_volume.js +0 -29
  325. package/dist/src/utility/bounding_volume.js.map +0 -1
  326. package/dist/src/utility/debug.js +0 -28
  327. package/dist/src/utility/debug.js.map +0 -1
  328. package/dist/src/utility/draco/decoder.js +0 -116
  329. package/dist/src/utility/draco/decoder.js.map +0 -1
  330. package/dist/src/utility/misc.js +0 -105
  331. package/dist/src/utility/misc.js.map +0 -1
  332. package/dist/src/utility/panorama.js +0 -163
  333. package/dist/src/utility/panorama.js.map +0 -1
  334. package/dist/src/utility/pmrem.js +0 -354
  335. package/dist/src/utility/pmrem.js.map +0 -1
  336. package/dist/src/utility/rendermipmap.js +0 -115
  337. package/dist/src/utility/rendermipmap.js.map +0 -1
  338. package/dist/src/utility/serialization/json.js +0 -402
  339. package/dist/src/utility/serialization/json.js.map +0 -1
  340. package/dist/src/utility/serialization/manager.js +0 -623
  341. package/dist/src/utility/serialization/manager.js.map +0 -1
  342. package/dist/src/utility/serialization/scene/animation.js +0 -248
  343. package/dist/src/utility/serialization/scene/animation.js.map +0 -1
  344. package/dist/src/utility/serialization/scene/batch.js +0 -59
  345. package/dist/src/utility/serialization/scene/batch.js.map +0 -1
  346. package/dist/src/utility/serialization/scene/camera.js +0 -790
  347. package/dist/src/utility/serialization/scene/camera.js.map +0 -1
  348. package/dist/src/utility/serialization/scene/common.js +0 -222
  349. package/dist/src/utility/serialization/scene/common.js.map +0 -1
  350. package/dist/src/utility/serialization/scene/light.js +0 -575
  351. package/dist/src/utility/serialization/scene/light.js.map +0 -1
  352. package/dist/src/utility/serialization/scene/material.js +0 -1111
  353. package/dist/src/utility/serialization/scene/material.js.map +0 -1
  354. package/dist/src/utility/serialization/scene/mesh.js +0 -148
  355. package/dist/src/utility/serialization/scene/mesh.js.map +0 -1
  356. package/dist/src/utility/serialization/scene/misc.js +0 -39
  357. package/dist/src/utility/serialization/scene/misc.js.map +0 -1
  358. package/dist/src/utility/serialization/scene/node.js +0 -451
  359. package/dist/src/utility/serialization/scene/node.js.map +0 -1
  360. package/dist/src/utility/serialization/scene/particle.js +0 -425
  361. package/dist/src/utility/serialization/scene/particle.js.map +0 -1
  362. package/dist/src/utility/serialization/scene/primitive.js +0 -692
  363. package/dist/src/utility/serialization/scene/primitive.js.map +0 -1
  364. package/dist/src/utility/serialization/scene/scene.js +0 -704
  365. package/dist/src/utility/serialization/scene/scene.js.map +0 -1
  366. package/dist/src/utility/serialization/scene/terrain.js +0 -488
  367. package/dist/src/utility/serialization/scene/terrain.js.map +0 -1
  368. package/dist/src/utility/serialization/scene/water.js +0 -465
  369. package/dist/src/utility/serialization/scene/water.js.map +0 -1
  370. package/dist/src/utility/shprojector.js +0 -297
  371. package/dist/src/utility/shprojector.js.map +0 -1
  372. package/dist/src/utility/textures/ggxlut.js +0 -213
  373. package/dist/src/utility/textures/ggxlut.js.map +0 -1
  374. package/dist/src/utility/textures/gradientnoise.js +0 -62
  375. package/dist/src/utility/textures/gradientnoise.js.map +0 -1
  376. package/dist/src/utility/textures/randomnoise.js +0 -41
  377. package/dist/src/utility/textures/randomnoise.js.map +0 -1
  378. package/dist/src/values.js +0 -162
  379. package/dist/src/values.js.map +0 -1
  380. package/dist/utility/blueprint/material/common.js +0 -7
  381. package/dist/utility/blueprint/material/common.js.map +0 -1
  382. package/dist/utility/serialization/blueprint/constants.js +0 -255
  383. package/dist/utility/serialization/blueprint/constants.js.map +0 -1
  384. package/dist/utility/serialization/blueprint/material/constants.js +0 -203
  385. package/dist/utility/serialization/blueprint/material/constants.js.map +0 -1
  386. package/dist/utility/serialization/blueprint/material/texture.js +0 -165
  387. package/dist/utility/serialization/blueprint/material/texture.js.map +0 -1
@@ -1,704 +0,0 @@
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