melonjs 20.2.0 → 20.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (515) hide show
  1. package/README.md +86 -8
  2. package/build/application/application.d.ts +0 -17
  3. package/build/application/application.d.ts.map +1 -1
  4. package/build/application/settings.d.ts +6 -2
  5. package/build/application/settings.d.ts.map +1 -1
  6. package/build/audio/audio.d.ts +2 -2
  7. package/build/audio/audio.d.ts.map +1 -1
  8. package/build/audio/backend/buffer.d.ts +26 -0
  9. package/build/audio/backend/buffer.d.ts.map +1 -0
  10. package/build/audio/backend/cache.d.ts +2 -0
  11. package/build/audio/backend/cache.d.ts.map +1 -0
  12. package/build/audio/backend/core.d.ts +24 -0
  13. package/build/audio/backend/core.d.ts.map +1 -0
  14. package/build/audio/backend/engine.d.ts +35 -0
  15. package/build/audio/backend/engine.d.ts.map +1 -0
  16. package/build/audio/backend/sound.d.ts +29 -0
  17. package/build/audio/backend/sound.d.ts.map +1 -0
  18. package/build/audio/backend/spatial.d.ts +191 -0
  19. package/build/audio/backend/spatial.d.ts.map +1 -0
  20. package/build/audio/backend/types.d.ts +107 -0
  21. package/build/audio/backend/types.d.ts.map +1 -0
  22. package/build/audio/backend/voice.d.ts +8 -0
  23. package/build/audio/backend/voice.d.ts.map +1 -0
  24. package/build/audio/playback.d.ts +49 -4
  25. package/build/audio/playback.d.ts.map +1 -1
  26. package/build/audio/procedural.d.ts.map +1 -1
  27. package/build/audio/state.d.ts +69 -0
  28. package/build/audio/state.d.ts.map +1 -0
  29. package/build/audio/types.d.ts +93 -1
  30. package/build/audio/types.d.ts.map +1 -1
  31. package/build/camera/camera2d.d.ts +0 -68
  32. package/build/camera/camera2d.d.ts.map +1 -1
  33. package/build/camera/camera3d.d.ts +91 -84
  34. package/build/camera/camera3d.d.ts.map +1 -1
  35. package/build/camera/effects/fade_effect.d.ts +0 -5
  36. package/build/camera/effects/fade_effect.d.ts.map +1 -1
  37. package/build/camera/effects/mask_effect.d.ts +0 -5
  38. package/build/camera/effects/mask_effect.d.ts.map +1 -1
  39. package/build/camera/fog.d.ts +118 -0
  40. package/build/camera/fog.d.ts.map +1 -0
  41. package/build/const.d.ts +2 -2
  42. package/build/geometries/box3d.d.ts +0 -28
  43. package/build/geometries/box3d.d.ts.map +1 -1
  44. package/build/geometries/ellipse.d.ts +0 -20
  45. package/build/geometries/ellipse.d.ts.map +1 -1
  46. package/build/geometries/observablePoint.d.ts +0 -3
  47. package/build/geometries/observablePoint.d.ts.map +1 -1
  48. package/build/geometries/path2d.d.ts +0 -19
  49. package/build/geometries/path2d.d.ts.map +1 -1
  50. package/build/geometries/polygon.d.ts +0 -12
  51. package/build/geometries/polygon.d.ts.map +1 -1
  52. package/build/geometries/roundrect.d.ts +0 -18
  53. package/build/geometries/roundrect.d.ts.map +1 -1
  54. package/build/geometries/sphere.d.ts +0 -9
  55. package/build/geometries/sphere.d.ts.map +1 -1
  56. package/build/geometries/toarccanvas.d.ts.map +1 -1
  57. package/build/index.d.ts +1 -0
  58. package/build/index.d.ts.map +1 -1
  59. package/build/index.js +12150 -11289
  60. package/build/index.js.map +4 -4
  61. package/build/input/gamepad.d.ts.map +1 -1
  62. package/build/input/input.d.ts +19 -0
  63. package/build/input/input.d.ts.map +1 -1
  64. package/build/input/pointer.d.ts +0 -4
  65. package/build/input/pointer.d.ts.map +1 -1
  66. package/build/input/pointerevent.d.ts +0 -6
  67. package/build/input/pointerevent.d.ts.map +1 -1
  68. package/build/lang/deprecated.d.ts +4 -2
  69. package/build/lang/deprecated.d.ts.map +1 -1
  70. package/build/level/gltf/GLTFModel.d.ts +0 -81
  71. package/build/level/gltf/GLTFModel.d.ts.map +1 -1
  72. package/build/level/gltf/GLTFScene.d.ts +13 -44
  73. package/build/level/gltf/GLTFScene.d.ts.map +1 -1
  74. package/build/level/gltf/gltf_sampler.d.ts +1 -48
  75. package/build/level/gltf/gltf_sampler.d.ts.map +1 -1
  76. package/build/level/level.d.ts +195 -113
  77. package/build/level/level.d.ts.map +1 -1
  78. package/build/level/tiled/TMXGroup.d.ts +1 -65
  79. package/build/level/tiled/TMXGroup.d.ts.map +1 -1
  80. package/build/level/tiled/TMXLayer.d.ts +0 -44
  81. package/build/level/tiled/TMXLayer.d.ts.map +1 -1
  82. package/build/level/tiled/TMXObject.d.ts +1 -136
  83. package/build/level/tiled/TMXObject.d.ts.map +1 -1
  84. package/build/level/tiled/TMXObjectFactory.d.ts +1 -40
  85. package/build/level/tiled/TMXObjectFactory.d.ts.map +1 -1
  86. package/build/level/tiled/TMXTile.d.ts +1 -30
  87. package/build/level/tiled/TMXTile.d.ts.map +1 -1
  88. package/build/level/tiled/TMXTileMap.d.ts +0 -10
  89. package/build/level/tiled/TMXTileMap.d.ts.map +1 -1
  90. package/build/level/tiled/TMXTileset.d.ts +0 -113
  91. package/build/level/tiled/TMXTileset.d.ts.map +1 -1
  92. package/build/level/tiled/TMXTilesetGroup.d.ts +0 -1
  93. package/build/level/tiled/TMXTilesetGroup.d.ts.map +1 -1
  94. package/build/level/tiled/TMXUtils.d.ts +1 -43
  95. package/build/level/tiled/TMXUtils.d.ts.map +1 -1
  96. package/build/level/tiled/factories/shape.d.ts +1 -7
  97. package/build/level/tiled/factories/shape.d.ts.map +1 -1
  98. package/build/level/tiled/factories/text.d.ts +1 -7
  99. package/build/level/tiled/factories/text.d.ts.map +1 -1
  100. package/build/level/tiled/factories/tile.d.ts +1 -7
  101. package/build/level/tiled/factories/tile.d.ts.map +1 -1
  102. package/build/level/tiled/renderer/TMXHexagonalRenderer.d.ts +0 -60
  103. package/build/level/tiled/renderer/TMXHexagonalRenderer.d.ts.map +1 -1
  104. package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts +0 -42
  105. package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts.map +1 -1
  106. package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts +0 -5
  107. package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts.map +1 -1
  108. package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts +0 -31
  109. package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts.map +1 -1
  110. package/build/level/tiled/renderer/TMXRenderer.d.ts +2 -2
  111. package/build/level/tiled/renderer/TMXRenderer.d.ts.map +1 -1
  112. package/build/level/tiled/renderer/TMXStaggeredRenderer.d.ts.map +1 -1
  113. package/build/level/tiled/renderer/autodetect.d.ts +1 -6
  114. package/build/level/tiled/renderer/autodetect.d.ts.map +1 -1
  115. package/build/lighting/light2d.d.ts +0 -25
  116. package/build/lighting/light2d.d.ts.map +1 -1
  117. package/build/lighting/light3d.d.ts +0 -16
  118. package/build/lighting/light3d.d.ts.map +1 -1
  119. package/build/loader/loader.d.ts +46 -73
  120. package/build/loader/loader.d.ts.map +1 -1
  121. package/build/loader/loadingscreen.d.ts +0 -33
  122. package/build/loader/loadingscreen.d.ts.map +1 -1
  123. package/build/loader/parsers/aseprite.d.ts +0 -13
  124. package/build/loader/parsers/aseprite.d.ts.map +1 -1
  125. package/build/loader/parsers/audio.d.ts +2 -0
  126. package/build/loader/parsers/audio.d.ts.map +1 -0
  127. package/build/loader/parsers/binary.d.ts +1 -10
  128. package/build/loader/parsers/binary.d.ts.map +1 -1
  129. package/build/loader/parsers/compressed_textures/compressed_image.d.ts.map +1 -1
  130. package/build/loader/parsers/compressed_textures/parseDDS.d.ts +1 -7
  131. package/build/loader/parsers/compressed_textures/parseDDS.d.ts.map +1 -1
  132. package/build/loader/parsers/compressed_textures/parseKTX.d.ts +1 -7
  133. package/build/loader/parsers/compressed_textures/parseKTX.d.ts.map +1 -1
  134. package/build/loader/parsers/compressed_textures/parseKTX2.d.ts +1 -7
  135. package/build/loader/parsers/compressed_textures/parseKTX2.d.ts.map +1 -1
  136. package/build/loader/parsers/compressed_textures/parsePKM.d.ts +1 -7
  137. package/build/loader/parsers/compressed_textures/parsePKM.d.ts.map +1 -1
  138. package/build/loader/parsers/compressed_textures/parsePVR.d.ts +1 -7
  139. package/build/loader/parsers/compressed_textures/parsePVR.d.ts.map +1 -1
  140. package/build/loader/parsers/fontface.d.ts +1 -13
  141. package/build/loader/parsers/fontface.d.ts.map +1 -1
  142. package/build/loader/parsers/gltf.d.ts +1 -70
  143. package/build/loader/parsers/gltf.d.ts.map +1 -1
  144. package/build/loader/parsers/image.d.ts +1 -22
  145. package/build/loader/parsers/image.d.ts.map +1 -1
  146. package/build/loader/parsers/json.d.ts +1 -10
  147. package/build/loader/parsers/json.d.ts.map +1 -1
  148. package/build/loader/parsers/mtl.d.ts +1 -28
  149. package/build/loader/parsers/mtl.d.ts.map +1 -1
  150. package/build/loader/parsers/obj.d.ts +1 -59
  151. package/build/loader/parsers/obj.d.ts.map +1 -1
  152. package/build/loader/parsers/pbr.d.ts +1 -62
  153. package/build/loader/parsers/pbr.d.ts.map +1 -1
  154. package/build/loader/parsers/script.d.ts +1 -10
  155. package/build/loader/parsers/script.d.ts.map +1 -1
  156. package/build/loader/parsers/shader.d.ts +1 -52
  157. package/build/loader/parsers/shader.d.ts.map +1 -1
  158. package/build/loader/parsers/tmx.d.ts +1 -10
  159. package/build/loader/parsers/tmx.d.ts.map +1 -1
  160. package/build/loader/parsers/video.d.ts +1 -10
  161. package/build/loader/parsers/video.d.ts.map +1 -1
  162. package/build/math/color.d.ts.map +1 -1
  163. package/build/math/noise.d.ts +0 -40
  164. package/build/math/noise.d.ts.map +1 -1
  165. package/build/math/observableVector2d.d.ts +0 -3
  166. package/build/math/observableVector2d.d.ts.map +1 -1
  167. package/build/math/observableVector3d.d.ts +0 -3
  168. package/build/math/observableVector3d.d.ts.map +1 -1
  169. package/build/math/vector2d.d.ts +0 -6
  170. package/build/math/vector2d.d.ts.map +1 -1
  171. package/build/math/vertex.d.ts +25 -0
  172. package/build/math/vertex.d.ts.map +1 -1
  173. package/build/particles/emitter.d.ts +0 -65
  174. package/build/particles/emitter.d.ts.map +1 -1
  175. package/build/particles/particle.d.ts +0 -81
  176. package/build/particles/particle.d.ts.map +1 -1
  177. package/build/physics/adapter.d.ts +3 -3
  178. package/build/physics/bounds.d.ts +0 -1
  179. package/build/physics/bounds.d.ts.map +1 -1
  180. package/build/physics/broadphase/broadphase.d.ts +0 -7
  181. package/build/physics/broadphase/broadphase.d.ts.map +1 -1
  182. package/build/physics/broadphase/octree.d.ts +0 -91
  183. package/build/physics/broadphase/octree.d.ts.map +1 -1
  184. package/build/physics/broadphase/quadtree.d.ts +0 -47
  185. package/build/physics/broadphase/quadtree.d.ts.map +1 -1
  186. package/build/physics/builtin/body.d.ts +5 -69
  187. package/build/physics/builtin/body.d.ts.map +1 -1
  188. package/build/physics/builtin/detector.d.ts +0 -312
  189. package/build/physics/builtin/detector.d.ts.map +1 -1
  190. package/build/physics/builtin/sat.d.ts +1 -48
  191. package/build/physics/builtin/sat.d.ts.map +1 -1
  192. package/build/physics/builtin/sat3d.d.ts +1 -56
  193. package/build/physics/builtin/sat3d.d.ts.map +1 -1
  194. package/build/physics/collision.d.ts +0 -2
  195. package/build/physics/collision.d.ts.map +1 -1
  196. package/build/physics/response.d.ts +0 -1
  197. package/build/physics/response.d.ts.map +1 -1
  198. package/build/physics/world.d.ts.map +1 -1
  199. package/build/plugin/plugin.d.ts +9 -1
  200. package/build/plugin/plugin.d.ts.map +1 -1
  201. package/build/polyfill/index.d.ts +1 -4
  202. package/build/polyfill/index.d.ts.map +1 -1
  203. package/build/renderable/anchorPoint.d.ts +1 -73
  204. package/build/renderable/anchorPoint.d.ts.map +1 -1
  205. package/build/renderable/animation.d.ts +0 -7
  206. package/build/renderable/animation.d.ts.map +1 -1
  207. package/build/renderable/colorlayer.d.ts +0 -5
  208. package/build/renderable/colorlayer.d.ts.map +1 -1
  209. package/build/renderable/container.d.ts +0 -55
  210. package/build/renderable/container.d.ts.map +1 -1
  211. package/build/renderable/draggable.d.ts +0 -5
  212. package/build/renderable/draggable.d.ts.map +1 -1
  213. package/build/renderable/dragndrop.d.ts +1 -12
  214. package/build/renderable/dragndrop.d.ts.map +1 -1
  215. package/build/renderable/entity/entity.d.ts +0 -8
  216. package/build/renderable/entity/entity.d.ts.map +1 -1
  217. package/build/renderable/frameAnimation.d.ts +0 -41
  218. package/build/renderable/frameAnimation.d.ts.map +1 -1
  219. package/build/renderable/groundshadow.d.ts +1 -91
  220. package/build/renderable/groundshadow.d.ts.map +1 -1
  221. package/build/renderable/imagelayer.d.ts +0 -29
  222. package/build/renderable/imagelayer.d.ts.map +1 -1
  223. package/build/renderable/instanced_mesh.d.ts +26 -104
  224. package/build/renderable/instanced_mesh.d.ts.map +1 -1
  225. package/build/renderable/mesh.d.ts +145 -140
  226. package/build/renderable/mesh.d.ts.map +1 -1
  227. package/build/renderable/nineslicesprite.d.ts +0 -4
  228. package/build/renderable/nineslicesprite.d.ts.map +1 -1
  229. package/build/renderable/renderable.d.ts +17 -54
  230. package/build/renderable/renderable.d.ts.map +1 -1
  231. package/build/renderable/sprite.d.ts +7 -52
  232. package/build/renderable/sprite.d.ts.map +1 -1
  233. package/build/renderable/sprite3d.d.ts +0 -95
  234. package/build/renderable/sprite3d.d.ts.map +1 -1
  235. package/build/renderable/text/bitmaptext.d.ts +0 -14
  236. package/build/renderable/text/bitmaptext.d.ts.map +1 -1
  237. package/build/renderable/text/bitmaptextdata.d.ts +0 -22
  238. package/build/renderable/text/bitmaptextdata.d.ts.map +1 -1
  239. package/build/renderable/text/glyph.d.ts +1 -39
  240. package/build/renderable/text/glyph.d.ts.map +1 -1
  241. package/build/renderable/text/text.d.ts +0 -20
  242. package/build/renderable/text/text.d.ts.map +1 -1
  243. package/build/renderable/text/textstyle.d.ts +1 -5
  244. package/build/renderable/text/textstyle.d.ts.map +1 -1
  245. package/build/renderable/trail.d.ts +0 -29
  246. package/build/renderable/trail.d.ts.map +1 -1
  247. package/build/renderable/trigger.d.ts +0 -6
  248. package/build/renderable/trigger.d.ts.map +1 -1
  249. package/build/renderable/ui/uibaseelement.d.ts +0 -40
  250. package/build/renderable/ui/uibaseelement.d.ts.map +1 -1
  251. package/build/renderable/ui/uispriteelement.d.ts +0 -35
  252. package/build/renderable/ui/uispriteelement.d.ts.map +1 -1
  253. package/build/state/stage.d.ts +4 -68
  254. package/build/state/stage.d.ts.map +1 -1
  255. package/build/state/state.d.ts.map +1 -1
  256. package/build/system/device.d.ts +0 -12
  257. package/build/system/device.d.ts.map +1 -1
  258. package/build/system/dom.d.ts +1 -8
  259. package/build/system/dom.d.ts.map +1 -1
  260. package/build/system/event.d.ts +1 -1
  261. package/build/system/legacy_pool.d.ts +1 -6
  262. package/build/system/legacy_pool.d.ts.map +1 -1
  263. package/build/system/platform.d.ts +21 -2
  264. package/build/system/platform.d.ts.map +1 -1
  265. package/build/system/pool.d.ts +0 -9
  266. package/build/system/pool.d.ts.map +1 -1
  267. package/build/system/save.d.ts.map +1 -1
  268. package/build/system/timer.d.ts +0 -20
  269. package/build/system/timer.d.ts.map +1 -1
  270. package/build/tweens/tween.d.ts +0 -62
  271. package/build/tweens/tween.d.ts.map +1 -1
  272. package/build/utils/array-multimap.d.ts +1 -13
  273. package/build/utils/array-multimap.d.ts.map +1 -1
  274. package/build/utils/decode.d.ts.map +1 -1
  275. package/build/utils/fetchdata.d.ts +2 -0
  276. package/build/utils/fetchdata.d.ts.map +1 -0
  277. package/build/utils/utils.d.ts +0 -13
  278. package/build/utils/utils.d.ts.map +1 -1
  279. package/build/video/blendmodes.d.ts +1 -106
  280. package/build/video/blendmodes.d.ts.map +1 -1
  281. package/build/video/buffer/index.d.ts +1 -39
  282. package/build/video/buffer/index.d.ts.map +1 -1
  283. package/build/video/buffer/vertex.d.ts +1 -82
  284. package/build/video/buffer/vertex.d.ts.map +1 -1
  285. package/build/video/canvas/canvas_renderer.d.ts +7 -25
  286. package/build/video/canvas/canvas_renderer.d.ts.map +1 -1
  287. package/build/video/canvas_factory.d.ts +1 -24
  288. package/build/video/canvas_factory.d.ts.map +1 -1
  289. package/build/video/effects/blendEffect.d.ts +0 -54
  290. package/build/video/effects/blendEffect.d.ts.map +1 -1
  291. package/build/video/effects/blur.d.ts +4 -4
  292. package/build/video/effects/blur.d.ts.map +1 -1
  293. package/build/video/effects/chromaticAberration.d.ts +5 -5
  294. package/build/video/effects/chromaticAberration.d.ts.map +1 -1
  295. package/build/video/effects/colorMatrix.d.ts +5 -15
  296. package/build/video/effects/colorMatrix.d.ts.map +1 -1
  297. package/build/video/effects/desaturate.d.ts +5 -5
  298. package/build/video/effects/desaturate.d.ts.map +1 -1
  299. package/build/video/effects/dissolve.d.ts +4 -4
  300. package/build/video/effects/dissolve.d.ts.map +1 -1
  301. package/build/video/effects/dropShadow.d.ts +5 -5
  302. package/build/video/effects/dropShadow.d.ts.map +1 -1
  303. package/build/video/effects/flash.d.ts +4 -4
  304. package/build/video/effects/flash.d.ts.map +1 -1
  305. package/build/video/effects/glow.d.ts +5 -5
  306. package/build/video/effects/glow.d.ts.map +1 -1
  307. package/build/video/effects/glsl_realization.d.ts +1 -17
  308. package/build/video/effects/glsl_realization.d.ts.map +1 -1
  309. package/build/video/effects/hologram.d.ts +4 -4
  310. package/build/video/effects/hologram.d.ts.map +1 -1
  311. package/build/video/effects/invert.d.ts +5 -5
  312. package/build/video/effects/invert.d.ts.map +1 -1
  313. package/build/video/effects/outline.d.ts +6 -6
  314. package/build/video/effects/outline.d.ts.map +1 -1
  315. package/build/video/effects/pixelate.d.ts +4 -4
  316. package/build/video/effects/pixelate.d.ts.map +1 -1
  317. package/build/video/effects/radialGradient.d.ts +2 -3
  318. package/build/video/effects/radialGradient.d.ts.map +1 -1
  319. package/build/video/effects/scanline.d.ts +6 -6
  320. package/build/video/effects/scanline.d.ts.map +1 -1
  321. package/build/video/effects/sepia.d.ts +5 -5
  322. package/build/video/effects/sepia.d.ts.map +1 -1
  323. package/build/video/effects/shadereffect.d.ts +12 -123
  324. package/build/video/effects/shadereffect.d.ts.map +1 -1
  325. package/build/video/effects/shine.d.ts +3 -3
  326. package/build/video/effects/shine.d.ts.map +1 -1
  327. package/build/video/effects/tintPulse.d.ts +4 -4
  328. package/build/video/effects/tintPulse.d.ts.map +1 -1
  329. package/build/video/effects/vignette.d.ts +6 -6
  330. package/build/video/effects/vignette.d.ts.map +1 -1
  331. package/build/video/effects/wave.d.ts +4 -4
  332. package/build/video/effects/wave.d.ts.map +1 -1
  333. package/build/video/effects/wgsl/layout.d.ts +1 -27
  334. package/build/video/effects/wgsl/layout.d.ts.map +1 -1
  335. package/build/video/effects/wgsl/parse.d.ts +1 -8
  336. package/build/video/effects/wgsl/parse.d.ts.map +1 -1
  337. package/build/video/effects/wgsl/scaffold.d.ts +1 -42
  338. package/build/video/effects/wgsl/scaffold.d.ts.map +1 -1
  339. package/build/video/effects/wgsl_realization.d.ts +1 -82
  340. package/build/video/effects/wgsl_realization.d.ts.map +1 -1
  341. package/build/video/gpu/batcher.d.ts +1 -13
  342. package/build/video/gpu/batcher.d.ts.map +1 -1
  343. package/build/video/gpu/instancerecord.d.ts +1 -163
  344. package/build/video/gpu/instancerecord.d.ts.map +1 -1
  345. package/build/video/gpu/meshchunk.d.ts +1 -48
  346. package/build/video/gpu/meshchunk.d.ts.map +1 -1
  347. package/build/video/gpu/meshvertex.d.ts +1 -53
  348. package/build/video/gpu/meshvertex.d.ts.map +1 -1
  349. package/build/video/gpu/primitives.d.ts +1 -59
  350. package/build/video/gpu/primitives.d.ts.map +1 -1
  351. package/build/video/gpu/quadcorners.d.ts +1 -10
  352. package/build/video/gpu/quadcorners.d.ts.map +1 -1
  353. package/build/video/gpu/textureslots.d.ts +1 -121
  354. package/build/video/gpu/textureslots.d.ts.map +1 -1
  355. package/build/video/gpu/texturestore.d.ts +1 -138
  356. package/build/video/gpu/texturestore.d.ts.map +1 -1
  357. package/build/video/gpu/topology.d.ts.map +1 -1
  358. package/build/video/gpu/vertexformat.d.ts +0 -28
  359. package/build/video/gpu/vertexformat.d.ts.map +1 -1
  360. package/build/video/gradient.d.ts +0 -81
  361. package/build/video/gradient.d.ts.map +1 -1
  362. package/build/video/renderer.d.ts +21 -102
  363. package/build/video/renderer.d.ts.map +1 -1
  364. package/build/video/renderstate.d.ts +0 -51
  365. package/build/video/renderstate.d.ts.map +1 -1
  366. package/build/video/rendertarget/canvasrendertarget.d.ts +0 -10
  367. package/build/video/rendertarget/canvasrendertarget.d.ts.map +1 -1
  368. package/build/video/rendertarget/render_target_pool.d.ts +1 -82
  369. package/build/video/rendertarget/render_target_pool.d.ts.map +1 -1
  370. package/build/video/rendertarget/webglrendertarget.d.ts +1 -64
  371. package/build/video/rendertarget/webglrendertarget.d.ts.map +1 -1
  372. package/build/video/rendertarget/webgpurendertarget.d.ts +0 -8
  373. package/build/video/rendertarget/webgpurendertarget.d.ts.map +1 -1
  374. package/build/video/texture/atlas.d.ts +2 -76
  375. package/build/video/texture/atlas.d.ts.map +1 -1
  376. package/build/video/texture/cache.d.ts +0 -136
  377. package/build/video/texture/cache.d.ts.map +1 -1
  378. package/build/video/texture/frametexture.d.ts +1 -71
  379. package/build/video/texture/frametexture.d.ts.map +1 -1
  380. package/build/video/texture/noise_texture2d.d.ts +0 -43
  381. package/build/video/texture/noise_texture2d.d.ts.map +1 -1
  382. package/build/video/texture/parser/aseprite.d.ts +1 -8
  383. package/build/video/texture/parser/aseprite.d.ts.map +1 -1
  384. package/build/video/texture/parser/spritesheet.d.ts +1 -8
  385. package/build/video/texture/parser/spritesheet.d.ts.map +1 -1
  386. package/build/video/texture/parser/texturepacker.d.ts +1 -8
  387. package/build/video/texture/parser/texturepacker.d.ts.map +1 -1
  388. package/build/video/texture/resource.d.ts +0 -9
  389. package/build/video/texture/resource.d.ts.map +1 -1
  390. package/build/video/texture/texture2d.d.ts +0 -11
  391. package/build/video/texture/texture2d.d.ts.map +1 -1
  392. package/build/video/utils/autodetect.d.ts +1 -5
  393. package/build/video/utils/autodetect.d.ts.map +1 -1
  394. package/build/video/webgl/batchers/batcher.d.ts +0 -55
  395. package/build/video/webgl/batchers/batcher.d.ts.map +1 -1
  396. package/build/video/webgl/batchers/lit_mesh_batcher.d.ts +0 -14
  397. package/build/video/webgl/batchers/lit_mesh_batcher.d.ts.map +1 -1
  398. package/build/video/webgl/batchers/lit_quad_batcher.d.ts +0 -72
  399. package/build/video/webgl/batchers/lit_quad_batcher.d.ts.map +1 -1
  400. package/build/video/webgl/batchers/material_batcher.d.ts +0 -89
  401. package/build/video/webgl/batchers/material_batcher.d.ts.map +1 -1
  402. package/build/video/webgl/batchers/mesh_batcher.d.ts +14 -343
  403. package/build/video/webgl/batchers/mesh_batcher.d.ts.map +1 -1
  404. package/build/video/webgl/batchers/primitive_batcher.d.ts +0 -10
  405. package/build/video/webgl/batchers/primitive_batcher.d.ts.map +1 -1
  406. package/build/video/webgl/batchers/quad_batcher.d.ts +0 -30
  407. package/build/video/webgl/batchers/quad_batcher.d.ts.map +1 -1
  408. package/build/video/webgl/buffer/index.d.ts +1 -36
  409. package/build/video/webgl/buffer/index.d.ts.map +1 -1
  410. package/build/video/webgl/buffer/instance_buffer.d.ts +1 -53
  411. package/build/video/webgl/buffer/instance_buffer.d.ts.map +1 -1
  412. package/build/video/webgl/buffer/retained_geometry.d.ts +1 -81
  413. package/build/video/webgl/buffer/retained_geometry.d.ts.map +1 -1
  414. package/build/video/webgl/buffer/uniformblock.d.ts +1 -80
  415. package/build/video/webgl/buffer/uniformblock.d.ts.map +1 -1
  416. package/build/video/webgl/buffer/vertexstate.d.ts +1 -100
  417. package/build/video/webgl/buffer/vertexstate.d.ts.map +1 -1
  418. package/build/video/webgl/glshader.d.ts +2 -51
  419. package/build/video/webgl/glshader.d.ts.map +1 -1
  420. package/build/video/webgl/lighting/pack3d.d.ts +1 -47
  421. package/build/video/webgl/lighting/pack3d.d.ts.map +1 -1
  422. package/build/video/webgl/lighting/std140.d.ts +1 -109
  423. package/build/video/webgl/lighting/std140.d.ts.map +1 -1
  424. package/build/video/webgl/renderers/tmxlayer/orthogonal.d.ts +1 -103
  425. package/build/video/webgl/renderers/tmxlayer/orthogonal.d.ts.map +1 -1
  426. package/build/video/webgl/shaders/multitexture-lit.d.ts +1 -26
  427. package/build/video/webgl/shaders/multitexture-lit.d.ts.map +1 -1
  428. package/build/video/webgl/shaders/multitexture.d.ts +1 -9
  429. package/build/video/webgl/shaders/multitexture.d.ts.map +1 -1
  430. package/build/video/webgl/texture/store.d.ts +1 -50
  431. package/build/video/webgl/texture/store.d.ts.map +1 -1
  432. package/build/video/webgl/utils/attributes.d.ts +1 -11
  433. package/build/video/webgl/utils/attributes.d.ts.map +1 -1
  434. package/build/video/webgl/utils/maxtextures.d.ts +1 -36
  435. package/build/video/webgl/utils/maxtextures.d.ts.map +1 -1
  436. package/build/video/webgl/utils/precision.d.ts +1 -14
  437. package/build/video/webgl/utils/precision.d.ts.map +1 -1
  438. package/build/video/webgl/utils/program.d.ts +1 -5
  439. package/build/video/webgl/utils/program.d.ts.map +1 -1
  440. package/build/video/webgl/utils/samplercache.d.ts +1 -68
  441. package/build/video/webgl/utils/samplercache.d.ts.map +1 -1
  442. package/build/video/webgl/utils/string.d.ts +1 -21
  443. package/build/video/webgl/utils/string.d.ts.map +1 -1
  444. package/build/video/webgl/utils/topology.d.ts +1 -23
  445. package/build/video/webgl/utils/topology.d.ts.map +1 -1
  446. package/build/video/webgl/utils/uniforms.d.ts +1 -25
  447. package/build/video/webgl/utils/uniforms.d.ts.map +1 -1
  448. package/build/video/webgl/utils/vertexformat.d.ts +1 -26
  449. package/build/video/webgl/utils/vertexformat.d.ts.map +1 -1
  450. package/build/video/webgl/webgl_renderer.d.ts +24 -286
  451. package/build/video/webgl/webgl_renderer.d.ts.map +1 -1
  452. package/build/video/webgpu/batchers/lit_mesh_batcher.d.ts +0 -6
  453. package/build/video/webgpu/batchers/lit_mesh_batcher.d.ts.map +1 -1
  454. package/build/video/webgpu/batchers/lit_quad_batcher.d.ts +0 -8
  455. package/build/video/webgpu/batchers/lit_quad_batcher.d.ts.map +1 -1
  456. package/build/video/webgpu/batchers/mesh_batcher.d.ts +1 -230
  457. package/build/video/webgpu/batchers/mesh_batcher.d.ts.map +1 -1
  458. package/build/video/webgpu/batchers/primitive_batcher.d.ts.map +1 -1
  459. package/build/video/webgpu/batchers/quad_batcher.d.ts +0 -82
  460. package/build/video/webgpu/batchers/quad_batcher.d.ts.map +1 -1
  461. package/build/video/webgpu/buffer/arena.d.ts +1 -63
  462. package/build/video/webgpu/buffer/arena.d.ts.map +1 -1
  463. package/build/video/webgpu/buffer/instance_buffer.d.ts +1 -64
  464. package/build/video/webgpu/buffer/instance_buffer.d.ts.map +1 -1
  465. package/build/video/webgpu/buffer/retained_geometry.d.ts +1 -54
  466. package/build/video/webgpu/buffer/retained_geometry.d.ts.map +1 -1
  467. package/build/video/webgpu/buffer/uniformring.d.ts +1 -67
  468. package/build/video/webgpu/buffer/uniformring.d.ts.map +1 -1
  469. package/build/video/webgpu/effect_binding.d.ts +1 -16
  470. package/build/video/webgpu/effect_binding.d.ts.map +1 -1
  471. package/build/video/webgpu/pipeline/bindgroups.d.ts +1 -32
  472. package/build/video/webgpu/pipeline/bindgroups.d.ts.map +1 -1
  473. package/build/video/webgpu/pipeline/cache.d.ts +1 -163
  474. package/build/video/webgpu/pipeline/cache.d.ts.map +1 -1
  475. package/build/video/webgpu/renderers/tmxlayer/orthogonal.d.ts +1 -87
  476. package/build/video/webgpu/renderers/tmxlayer/orthogonal.d.ts.map +1 -1
  477. package/build/video/webgpu/shaders/mesh-instanced.d.ts +1 -43
  478. package/build/video/webgpu/shaders/mesh-instanced.d.ts.map +1 -1
  479. package/build/video/webgpu/texture/compressed.d.ts +1 -32
  480. package/build/video/webgpu/texture/compressed.d.ts.map +1 -1
  481. package/build/video/webgpu/texture/frametexture.d.ts +1 -62
  482. package/build/video/webgpu/texture/frametexture.d.ts.map +1 -1
  483. package/build/video/webgpu/texture/store.d.ts +1 -147
  484. package/build/video/webgpu/texture/store.d.ts.map +1 -1
  485. package/build/video/webgpu/webgpu_renderer.d.ts +2 -89
  486. package/build/video/webgpu/webgpu_renderer.d.ts.map +1 -1
  487. package/package.json +8 -11
  488. package/skills/AGENTS.md +67 -0
  489. package/skills/melonjs/SKILL.md +156 -0
  490. package/skills/melonjs-20-migration/SKILL.md +160 -0
  491. package/skills/melonjs-3d/SKILL.md +525 -0
  492. package/skills/melonjs-3d-assets/SKILL.md +258 -0
  493. package/skills/melonjs-audio/SKILL.md +236 -0
  494. package/skills/melonjs-camera-and-drawing/SKILL.md +175 -0
  495. package/skills/melonjs-deployment/SKILL.md +113 -0
  496. package/skills/melonjs-effects-and-shaders/SKILL.md +178 -0
  497. package/skills/melonjs-events/SKILL.md +159 -0
  498. package/skills/melonjs-getting-started/SKILL.md +183 -0
  499. package/skills/melonjs-input/SKILL.md +166 -0
  500. package/skills/melonjs-lighting/SKILL.md +139 -0
  501. package/skills/melonjs-loading-assets/SKILL.md +186 -0
  502. package/skills/melonjs-particles-and-trails/SKILL.md +136 -0
  503. package/skills/melonjs-performance/SKILL.md +183 -0
  504. package/skills/melonjs-physics/SKILL.md +321 -0
  505. package/skills/melonjs-plugins/SKILL.md +191 -0
  506. package/skills/melonjs-renderables/SKILL.md +214 -0
  507. package/skills/melonjs-renderer-backends/SKILL.md +173 -0
  508. package/skills/melonjs-scenes-and-state/SKILL.md +180 -0
  509. package/skills/melonjs-sprites-and-animation/SKILL.md +173 -0
  510. package/skills/melonjs-tilemaps/SKILL.md +213 -0
  511. package/skills/melonjs-ui-and-text/SKILL.md +65 -0
  512. package/build/audio/backend.d.ts +0 -140
  513. package/build/audio/backend.d.ts.map +0 -1
  514. package/build/loader/parsers/fetchdata.d.ts +0 -32
  515. package/build/loader/parsers/fetchdata.d.ts.map +0 -1
@@ -1,54 +1,2 @@
1
- /**
2
- * The GPU half of an {@link InstancedMesh}'s instance records — one
3
- * `ARRAY_BUFFER` holding the packed per-instance transforms (and the opt-in
4
- * colour / custom slots), uploaded with `bufferSubData` over only the range
5
- * the CPU side actually touched.
6
- *
7
- * This is the instancing counterpart of {@link RetainedGeometry}: the mesh's
8
- * geometry is uploaded once and never rewritten, and this buffer carries
9
- * everything that differs between the copies. Moving one tree in a forest of
10
- * five thousand therefore re-uploads 48 bytes, not the geometry and not the
11
- * other 4 999 records.
12
- *
13
- * The buffer is sized to the mesh's capacity rather than its live instance
14
- * count, so growing by one instance does not reallocate on the GPU until the
15
- * CPU-side array itself grows.
16
- * @ignore
17
- */
18
- export default class WebGLInstanceBuffer {
19
- /**
20
- * @param {WebGL2RenderingContext} gl - the WebGL context
21
- */
22
- constructor(gl: WebGL2RenderingContext);
23
- gl: WebGL2RenderingContext;
24
- /**
25
- * the GL buffer holding the packed instance records
26
- * @type {WebGLBuffer}
27
- */
28
- buffer: WebGLBuffer;
29
- /**
30
- * byte capacity currently allocated on the GPU; a CPU-side array
31
- * larger than this forces a full reallocation rather than a sub-update
32
- * @type {number}
33
- */
34
- capacity: number;
35
- /**
36
- * Push the dirty span of `data` to the GPU.
37
- *
38
- * Three cases, cheapest last: the CPU array outgrew the allocation (full
39
- * `bufferData`), nothing is dirty (no call at all), or a span changed
40
- * (one `bufferSubData` covering exactly it).
41
- * @param {Float32Array} data - the CPU-side instance records
42
- * @param {number} firstFloat - first dirty float offset (inclusive)
43
- * @param {number} floatCount - number of dirty floats, 0 when clean
44
- * @param {number} usedBytes - bytes of `data` actually in use
45
- */
46
- upload(data: Float32Array, firstFloat: number, floatCount: number, usedBytes: number): void;
47
- /**
48
- * Release the GL buffer. Safe to call twice, and on a lost context — the
49
- * `isBuffer` probe is itself error-free, whereas deleting a handle whose
50
- * context died raises INVALID_OPERATION.
51
- */
52
- destroy(): void;
53
- }
1
+
54
2
  //# sourceMappingURL=instance_buffer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"instance_buffer.d.ts","sourceRoot":"","sources":["../../../../src/video/webgl/buffer/instance_buffer.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH;IACC;;OAEG;IACH,gBAFW,sBAAsB,EAiBhC;IAdA,2BAAY;IAEZ;;;OAGG;IACH,QAFU,WAAW,CAEU;IAE/B;;;;OAIG;IACH,UAFU,MAAM,CAEC;IAGlB;;;;;;;;;;OAUG;IACH,aALW,YAAY,cACZ,MAAM,cACN,MAAM,aACN,MAAM,QAgChB;IAED;;;;OAIG;IACH,gBASC;CACD"}
1
+ {"version":3,"file":"instance_buffer.d.ts","sourceRoot":"","sources":["../../../../src/video/webgl/buffer/instance_buffer.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH;IACC;;OAEG;IACH,gBAFW,sBAAsB,EAiBhC;IAdA,2BAAY;IAEZ;;;OAGG;IACH,QAFU,WAAW,CAEU;IAE/B;;;;OAIG;IACH,UAFU,MAAM,CAEC;IAGlB;;;;;;;;;;OAUG;IACH,aALW,YAAY,cACZ,MAAM,cACN,MAAM,aACN,MAAM,QAgChB;IAED;;;;OAIG;IACH,gBASC;CACD"}
@@ -1,83 +1,3 @@
1
- /**
2
- * Persistent GPU geometry for one mesh — a vertex buffer, an index buffer
3
- * and the {@link WebGLVertexState} that binds them together, all uploaded
4
- * once and re-drawn from VRAM on subsequent frames.
5
- *
6
- * This is what makes the mesh path retained rather than immediate: the
7
- * geometry it holds is in model space and carries no camera, placement or
8
- * tint information, so moving, rotating, scaling or re-tinting a mesh
9
- * changes only uniforms and never touches these buffers. They are rewritten
10
- * only when the geometry itself changes, which the owning mesh signals by
11
- * bumping its geometry version.
12
- *
13
- * Uploads go through a `Uint8Array` view of the float data rather than the
14
- * `Float32Array` itself: some drivers canonicalize NaN bit patterns on a
15
- * float upload, which would corrupt packed values. See `VertexArrayBuffer`.
16
- * @ignore
17
- */
18
- export default class RetainedGeometry {
19
- /**
20
- * @param {WebGL2RenderingContext} gl - the WebGL context
21
- * @param {object[]} attributes - the owning batcher's attribute definitions
22
- * @param {number} stride - the owning batcher's vertex stride in bytes
23
- * @param {Function} resolveLocation - maps an attribute name to its shader location
24
- */
25
- constructor(gl: WebGL2RenderingContext, attributes: object[], stride: number, resolveLocation: Function);
26
- gl: WebGL2RenderingContext;
27
- attributes: object[];
28
- stride: number;
29
- resolveLocation: Function;
30
- /**
31
- * the GL buffer holding the interleaved model-space vertex data
32
- * @type {WebGLBuffer}
33
- */
34
- vertexBuffer: WebGLBuffer;
35
- /**
36
- * the GL buffer holding the index data, as authored
37
- * @type {WebGLBuffer}
38
- */
39
- glIndexBuffer: WebGLBuffer;
40
- /**
41
- * `gl.UNSIGNED_SHORT` or `gl.UNSIGNED_INT`, matching the index array
42
- * the mesh supplied — WebGL 2 draws 32-bit indices natively, so a
43
- * mesh past 65 535 vertices is still a single draw call.
44
- * @type {number}
45
- */
46
- indexType: number;
47
- /**
48
- * number of indices to draw
49
- * @type {number}
50
- */
51
- indexCount: number;
52
- /**
53
- * the mesh geometry version this upload reflects; a mismatch against
54
- * the mesh means the buffers are stale and must be rewritten
55
- * @type {number}
56
- */
57
- uploadedVersion: number;
58
- /**
59
- * the frozen vertex state binding this geometry's buffers
60
- * @type {WebGLVertexState}
61
- */
62
- vertexState: WebGLVertexState;
63
- /**
64
- * Upload interleaved vertex data and indices, replacing whatever this
65
- * geometry held before.
66
- * @param {Float32Array} vertexData - interleaved vertex data in the batcher's layout
67
- * @param {number} floatCount - how many floats of `vertexData` are in use
68
- * @param {Uint16Array|Uint32Array|number[]} indices - the index data, as authored
69
- * @param {number} version - the mesh geometry version this data reflects
70
- */
71
- upload(vertexData: Float32Array, floatCount: number, indices: Uint16Array | Uint32Array | number[], version: number): void;
72
- /**
73
- * Make this geometry current for drawing.
74
- */
75
- bind(): void;
76
- /**
77
- * Release every GL object this geometry owns. Safe to call twice, and on
78
- * a lost context.
79
- */
80
- destroy(): void;
81
- }
1
+
82
2
  import WebGLVertexState from "./vertexstate.js";
83
3
  //# sourceMappingURL=retained_geometry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"retained_geometry.d.ts","sourceRoot":"","sources":["../../../../src/video/webgl/buffer/retained_geometry.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;GAgBG;AACH;IACC;;;;;OAKG;IACH,gBALW,sBAAsB,cACtB,MAAM,EAAE,UACR,MAAM,6BA+DhB;IA3DA,2BAAY;IACZ,qBAA4B;IAC5B,eAAoB;IACpB,0BAAsC;IAEtC;;;OAGG;IACH,cAFU,WAAW,CAEgB;IAErC;;;OAGG;IACH,eAFU,WAAW,CAEiB;IAEtC;;;;;OAKG;IACH,WAFU,MAAM,CAEkB;IAElC;;;OAGG;IACH,YAFU,MAAM,CAEG;IAEnB;;;;OAIG;IACH,iBAFU,MAAM,CAES;IAYzB;;;OAGG;IACH,aAFU,gBAAgB,CAQxB;IAGH;;;;;;;OAOG;IACH,mBALW,YAAY,cACZ,MAAM,WACN,WAAW,GAAC,WAAW,GAAC,MAAM,EAAE,WAChC,MAAM,QAsChB;IAED;;OAEG;IACH,aAEC;IAED;;;OAGG;IACH,gBAwBC;CACD;6BA1K4B,kBAAkB"}
1
+ {"version":3,"file":"retained_geometry.d.ts","sourceRoot":"","sources":["../../../../src/video/webgl/buffer/retained_geometry.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AACH;IACC;;;;;OAKG;IACH,gBALW,sBAAsB,cACtB,MAAM,EAAE,UACR,MAAM,6BA+DhB;IA3DA,2BAAY;IACZ,qBAA4B;IAC5B,eAAoB;IACpB,0BAAsC;IAEtC;;;OAGG;IACH,cAFU,WAAW,CAEgB;IAErC;;;OAGG;IACH,eAFU,WAAW,CAEiB;IAEtC;;;;;OAKG;IACH,WAFU,MAAM,CAEkB;IAElC;;;OAGG;IACH,YAFU,MAAM,CAEG;IAEnB;;;;OAIG;IACH,iBAFU,MAAM,CAES;IAYzB;;;OAGG;IACH,aAFU,gBAAgB,CAQxB;IAGH;;;;;;;OAOG;IACH,mBALW,YAAY,cACZ,MAAM,WACN,WAAW,GAAC,WAAW,GAAC,MAAM,EAAE,WAChC,MAAM,QAsChB;IAED;;OAEG;IACH,aAEC;IAED;;;OAGG;IACH,gBAwBC;CACD;6BA3K4B,kBAAkB"}
@@ -1,81 +1,2 @@
1
- /**
2
- * A uniform buffer bound to a named block in one or more shader programs.
3
- *
4
- * Uniform arrays are charged against `MAX_FRAGMENT_UNIFORM_VECTORS`, a
5
- * driver-reported budget that is small on weak devices. A uniform buffer is
6
- * charged against `MAX_UNIFORM_BLOCK_SIZE` instead — guaranteed at least
7
- * 16 KB, typically 64 KB — so bulk per-frame data stops competing with
8
- * everything else the shader declares.
9
- *
10
- * Data is staged in a `Float32Array` and uploaded with `bufferSubData`, so
11
- * only the live prefix crosses the bus. Uploads are skipped entirely when the
12
- * staged bytes have not changed, which preserves the property the uniform
13
- * cache gives today: a scene whose lights are static costs nothing per frame.
14
- *
15
- * ## Context loss
16
- *
17
- * A block binding is program state, not buffer state, and every program is
18
- * recompiled on restore — so the binding has to be re-established afterwards
19
- * or the shader reads an unbound block and renders black. Callers re-bind
20
- * lazily, whenever the program they last bound is no longer the current one;
21
- * that covers a context restore without anyone subscribing to an event. The
22
- * buffer itself needs no recovery hook — the renderer re-runs each batcher's
23
- * `init()` on restore, which releases this block and builds a new one.
24
- * @ignore
25
- */
26
- export default class UniformBlock {
27
- /**
28
- * @param {WebGL2RenderingContext} gl - the rendering context
29
- * @param {number} floats - capacity in floats
30
- * @param {number} bindingPoint - the indexed binding point to occupy
31
- */
32
- constructor(gl: WebGL2RenderingContext, floats: number, bindingPoint: number);
33
- gl: WebGL2RenderingContext;
34
- /**
35
- * staging buffer; callers write into this then call `upload`
36
- * @type {Float32Array}
37
- */
38
- data: Float32Array;
39
- /**
40
- * mirror of what was last uploaded, so an unchanged frame can skip the
41
- * `bufferSubData` entirely
42
- * @type {Float32Array}
43
- */
44
- _uploaded: Float32Array;
45
- /** nothing has been uploaded yet, so the mirror is not yet valid */
46
- _everUploaded: boolean;
47
- /** live length of the last upload; -1 until there has been one */
48
- _uploadedLength: number;
49
- /** @type {number} */
50
- bindingPoint: number;
51
- /** @type {WebGLBuffer|null} */
52
- buffer: WebGLBuffer | null;
53
- /**
54
- * Point a program's named block at this buffer's binding point.
55
- *
56
- * Safe to call repeatedly — after a context restore the program is a new
57
- * object and must be re-bound, and there is no way to ask whether it
58
- * already was.
59
- * @param {WebGLProgram} program - the linked program
60
- * @param {string} blockName - the block's name in GLSL
61
- * @returns {boolean} `false` when the program does not declare the block
62
- */
63
- bindTo(program: WebGLProgram, blockName: string): boolean;
64
- /**
65
- * Upload the first `floats` entries of {@link UniformBlock#data}.
66
- *
67
- * Compares against the previous upload first and does nothing when the
68
- * bytes are identical. Uniform writes are already skipped when unchanged
69
- * (`utils/uniforms.js`), so uploading unconditionally here would make a
70
- * static scene more expensive than it was before the buffer existed.
71
- * @param {number} floats - how many floats of the staging buffer are live
72
- * @returns {boolean} whether anything was actually sent to the GPU
73
- */
74
- upload(floats: number): boolean;
75
- /**
76
- * Release the GL buffer. Safe to call twice, and on a lost context.
77
- */
78
- destroy(): void;
79
- #private;
80
- }
1
+
81
2
  //# sourceMappingURL=uniformblock.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"uniformblock.d.ts","sourceRoot":"","sources":["../../../../src/video/webgl/buffer/uniformblock.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH;IACC;;;;OAIG;IACH,gBAJW,sBAAsB,UACtB,MAAM,gBACN,MAAM,EAkChB;IA/BA,2BAAY;IAEZ;;;OAGG;IACH,MAFU,YAAY,CAEc;IAEpC;;;;OAIG;IACH,WAFU,YAAY,CAEmB;IAEzC,oEAAoE;IACpE,uBAA0B;IAE1B,kEAAkE;IAClE,wBAAyB;IAEzB,qBAAqB;IACrB,cADW,MAAM,CACe;IAEhC,+BAA+B;IAC/B,QADW,WAAW,GAAC,IAAI,CACI;IAQhC;;;;;;;;;OASG;IACH,gBAJW,YAAY,aACZ,MAAM,GACJ,OAAO,CAanB;IAED;;;;;;;;;OASG;IACH,eAHW,MAAM,GACJ,OAAO,CAmBnB;IAoBD;;OAEG;IACH,gBAYC;;CACD"}
1
+ {"version":3,"file":"uniformblock.d.ts","sourceRoot":"","sources":["../../../../src/video/webgl/buffer/uniformblock.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH;IACC;;;;OAIG;IACH,gBAJW,sBAAsB,UACtB,MAAM,gBACN,MAAM,EA+DhB;IA5DA,2BAAY;IAEZ;;;OAGG;IACH,MAFU,YAAY,CAEc;IAEpC;;;;;;OAMG;IACH,WAJU,YAAY,CAImB;IAEzC;;;;OAIG;IACH,uBAA0B;IAE1B;;;;OAIG;IACH,wBAAyB;IAEzB,qBAAqB;IACrB,cADW,MAAM,CACe;IAEhC;;;;;;;;;;;;;;;;OAgBG;IACH,eAJU,OAAO,CAAC,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAIlB;IAElC,+BAA+B;IAC/B,QADW,WAAW,GAAC,IAAI,CACI;IAQhC;;;;;;;;;;;OAWG;IACH,gBAJW,YAAY,aACZ,MAAM,GACJ,OAAO,CAyBnB;IAED;;;;;;;;;OASG;IACH,eAHW,MAAM,GACJ,OAAO,CAmBnB;IAqBD;;OAEG;IACH,gBAYC;;CACD"}
@@ -1,101 +1,2 @@
1
- /**
2
- * A WebGL Vertex State — a Vertex Array Object owning a frozen vertex
3
- * buffer layout: one `vertexAttribPointer` / `enableVertexAttribArray` per
4
- * attribute against a given vertex buffer, plus the ELEMENT_ARRAY_BUFFER
5
- * binding when the geometry is indexed.
6
- *
7
- * This is the engine's `GPUVertexState` analogue, and the layout it is built
8
- * from is a `GPUVertexBufferLayout[]`: a list of buffer groups, each with its
9
- * own buffer, `arrayStride` and `stepMode`. Attributes in a `"vertex"` group
10
- * advance once per vertex (the ordinary case); attributes in an
11
- * `"instance"` group advance once per *instance*, which is what
12
- * `drawElementsInstanced` reads to stamp out N copies of one geometry.
13
- * The layout is immutable once built, exactly like a vertex layout baked
14
- * into a render pipeline.
15
- *
16
- * Attribute divisors are vertex-array state, so a fresh VAO starts with every
17
- * divisor at 0 and `build()` creates one each time — an instanced layout can
18
- * therefore never leak its divisors into an unrelated vertex state, and the
19
- * single-buffer path issues no `vertexAttribDivisor` calls at all.
20
- *
21
- * Every method that mutates GL binding state saves and restores the live
22
- * bindings itself, so building or rebuilding one vertex state can never
23
- * disturb whichever one is mid-frame. Callers never touch
24
- * `bindVertexArray` directly.
25
- * @ignore
26
- */
27
- export default class WebGLVertexState {
28
- /**
29
- * Accepts either shape — the single-buffer one (`attributes` + `stride` +
30
- * `buffer`) or a list of buffer groups (`buffers`). They are equivalent;
31
- * the former is the latter with one `"vertex"` group.
32
- * @param {WebGL2RenderingContext} gl - the WebGL context
33
- * @param {object} descriptor - the vertex layout to realize
34
- * @param {object[]} [descriptor.attributes] - attribute definitions (`name`, `size`, `type`, `normalized`, `offset`)
35
- * @param {number} [descriptor.stride] - size of a single vertex in bytes (`arrayStride`)
36
- * @param {WebGLBuffer} [descriptor.buffer] - the vertex buffer the attribute pointers read from
37
- * @param {object[]} [descriptor.buffers] - buffer groups, each `{buffer, stride, attributes, stepMode}` where `stepMode` is `"vertex"` (default) or `"instance"`
38
- * @param {Function} descriptor.resolveLocation - maps an attribute name to its shader location (`-1` when absent)
39
- * @param {WebGLIndexBuffer} [descriptor.indexBuffer] - index buffer to capture, for indexed geometry
40
- */
41
- constructor(gl: WebGL2RenderingContext, descriptor: {
42
- attributes?: object[] | undefined;
43
- stride?: number | undefined;
44
- buffer?: WebGLBuffer | undefined;
45
- buffers?: object[] | undefined;
46
- resolveLocation: Function;
47
- indexBuffer?: any;
48
- });
49
- gl: WebGL2RenderingContext;
50
- descriptor: {
51
- attributes?: object[] | undefined;
52
- stride?: number | undefined;
53
- buffer?: WebGLBuffer | undefined;
54
- buffers?: object[] | undefined;
55
- resolveLocation: Function;
56
- indexBuffer?: WebGLIndexBuffer;
57
- };
58
- /**
59
- * the underlying GL vertex array object
60
- * @type {WebGLVertexArrayObject}
61
- */
62
- handle: WebGLVertexArrayObject;
63
- /**
64
- * (Re)build the vertex array object from this state's descriptor,
65
- * replacing any previous one. Called on construction and from every
66
- * buffer-recreation path — a vertex state referencing a deleted buffer
67
- * keeps it alive per the GL spec and draws stale data.
68
- * @param {object} [changes] - descriptor fields to replace first (e.g. recreated `buffer` / `buffers` / `indexBuffer`)
69
- */
70
- build(changes?: object): void;
71
- /**
72
- * Capture an ELEMENT_ARRAY_BUFFER binding into this vertex state.
73
- * Used when an index buffer is (re)created after the state was built —
74
- * the quad batchers' static pattern buffer — since that binding is
75
- * vertex-array state and would otherwise land in whichever state
76
- * happens to be bound.
77
- * @param {WebGLIndexBuffer} indexBuffer - the index buffer to capture
78
- * @param {Function} [fill] - optional work to run with this state bound (buffer creation/upload)
79
- */
80
- captureIndexBuffer(indexBuffer: WebGLIndexBuffer, fill?: Function): void;
81
- /**
82
- * Make this vertex state current. One call restores the entire frozen
83
- * layout — the WebGL analogue of `setPipeline` + `setVertexBuffer` +
84
- * `setIndexBuffer`.
85
- */
86
- bind(): void;
87
- /**
88
- * Delete the underlying vertex array object, if any. Idempotent, and
89
- * safe on a lost context: deleting an object belonging to a lost
90
- * context would queue `INVALID_OPERATION` (deletion counts as *using*
91
- * it — only the `is*` queries are exempt), so probe first.
92
- */
93
- release(): void;
94
- /**
95
- * Release the vertex array object. The vertex state must not be used
96
- * after calling destroy.
97
- */
98
- destroy(): void;
99
- #private;
100
- }
1
+
101
2
  //# sourceMappingURL=vertexstate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"vertexstate.d.ts","sourceRoot":"","sources":["../../../../src/video/webgl/buffer/vertexstate.js"],"names":[],"mappings":"AAyBA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH;IACC;;;;;;;;;;;;OAYG;IACH,gBATW,sBAAsB,cAE9B;QAA8B,UAAU;QACZ,MAAM;QACD,MAAM;QACT,OAAO;QACR,eAAe;QACN,WAAW;KACnD,EAUA;IARA,2BAAY;IACZ;;;;;;sBAJU,gBAAgB;MAIE;IAC5B;;;OAGG;IACH,QAFU,sBAAsB,CAEd;IAyBnB;;;;;;OAMG;IACH,gBAFW,MAAM,QA4EhB;IAED;;;;;;;;OAQG;IACH,gCAHW,gBAAgB,yBAa1B;IAED;;;;OAIG;IACH,aAEC;IAED;;;;;OAKG;IACH,gBAOC;IAED;;;OAGG;IACH,gBAGC;;CACD"}
1
+ {"version":3,"file":"vertexstate.d.ts","sourceRoot":"","sources":["../../../../src/video/webgl/buffer/vertexstate.js"],"names":[],"mappings":"AA0BA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH;IACC;;;;;;;;;;;;OAYG;IACH,gBATW,sBAAsB,cAE9B;QAA8B,UAAU;QACZ,MAAM;QACD,MAAM;QACT,OAAO;QACR,eAAe;QACN,WAAW;KACnD,EAUA;IARA,2BAAY;IACZ;;;;;;sBAJU,gBAAgB;MAIE;IAC5B;;;OAGG;IACH,QAFU,sBAAsB,CAEd;IA6BnB;;;;;;OAMG;IACH,gBAFW,MAAM,QA4EhB;IAED;;;;;;;;OAQG;IACH,gCAHW,gBAAgB,yBAa1B;IAED;;;;OAIG;IACH,aAEC;IAED;;;;;OAKG;IACH,gBAOC;IAED;;;OAGG;IACH,gBAGC;;CACD"}
@@ -60,11 +60,11 @@ export default class GLShader {
60
60
  * @example
61
61
  * // a dual-backend custom mesh shader: the same object hosts on
62
62
  * // whichever GPU renderer is active (gl is undefined on WebGPU)
63
- * myMesh.shader = new me.GLShader(app.renderer.gl, {
63
+ * myMesh.addPostEffect(new me.GLShader(app.renderer.gl, {
64
64
  * vertex: toonVertexGLSL,
65
65
  * fragment: toonFragmentGLSL,
66
66
  * wgsl: toonModuleWGSL,
67
- * });
67
+ * }));
68
68
  */
69
69
  constructor(gl?: WebGLRenderingContext, vertex: string | object, fragment?: string, precision?: string);
70
70
  /**
@@ -98,10 +98,6 @@ export default class GLShader {
98
98
  */
99
99
  label: string | undefined;
100
100
  wgslValid: boolean;
101
- _wgslRegistrations: {
102
- epoch: number;
103
- keys: Map<any, any>;
104
- };
105
101
  /**
106
102
  * `true` once {@link destroy} has been called. After this flag is
107
103
  * `true`, every method on the shader is a silent no-op — callers
@@ -134,37 +130,11 @@ export default class GLShader {
134
130
  * @readonly
135
131
  */
136
132
  readonly suspended: boolean;
137
- _sourceVertex: string | object;
138
- _sourceFragment: string | undefined;
139
- _precision: string | undefined;
140
- _uniformCache: any;
141
133
  program: WebGLProgram;
142
134
  uniforms: object;
143
135
  attributes: number[];
144
- /**
145
- * (Re)compile the shader program against `this.gl` from the
146
- * preserved source. Called from the constructor and from
147
- * {@link _onContextRestored}. Replays any cached uniform values
148
- * against the freshly-extracted uniforms proxy.
149
- * @private
150
- */
151
- private _compile;
152
136
  vertex: any;
153
137
  fragment: any;
154
- /**
155
- * Handler for {@link ONCONTEXT_LOST}. Tears down the GL program
156
- * but preserves the shader source + cached uniform values so the
157
- * shader can be transparently rebuilt on context restore.
158
- * @private
159
- */
160
- private _onContextLost;
161
- /**
162
- * Handler for {@link ONCONTEXT_RESTORED}. Re-compiles and
163
- * re-links the shader against the new GL context, then replays
164
- * any cached uniform values via {@link _compile}.
165
- * @private
166
- */
167
- private _onContextRestored;
168
138
  /**
169
139
  * Installs this shader program as part of current rendering state
170
140
  */
@@ -216,25 +186,6 @@ export default class GLShader {
216
186
  * @returns {GLShader} a new, caller-owned shader (`shared === false`)
217
187
  */
218
188
  clone(): GLShader;
219
- /**
220
- * Register this shader's WGSL module as a pipeline family for one
221
- * hosting mesh batcher, against that host's positional group-layout
222
- * list and frozen vertex layout. Registered once per host per device
223
- * generation; the module text is namespaced by the host key so the
224
- * same shader yields distinct families (distinct pipeline layouts) on
225
- * the unlit and lit hosts. Asynchronous WGSL validation errors flip
226
- * {@link GLShader#wgslValid} and the host falls back to its built-in
227
- * shading (warn-and-degrade, never fatal).
228
- * @param {object} cache - the WebGPU renderer's pipeline cache
229
- * @param {string} host - the hosting family's vertex-layout key
230
- * @param {GPUBindGroupLayout[]} bindGroupLayouts - the host's group list
231
- * @param {string} vertexLayoutKey - the host's registered vertex layout
232
- * @returns {string|null} the family key to pass to the pipeline cache's
233
- * `get`, or null when the module failed validation on this device
234
- * generation (the host then uses its built-in family)
235
- * @ignore
236
- */
237
- registerWGSL(cache: object, host: string, bindGroupLayouts: GPUBindGroupLayout[], vertexLayoutKey: string): string | null;
238
189
  /**
239
190
  * destroy this shader objects resources (program, attributes, uniforms).
240
191
  * Idempotent — calling destroy twice (or after a context-lost suspend)
@@ -1 +1 @@
1
- {"version":3,"file":"glshader.d.ts","sourceRoot":"","sources":["../../../src/video/webgl/glshader.js"],"names":[],"mappings":"AAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH;IACC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;IACH,iBAtCW,qBAAqB,UAGrB,MAAM,GAAC,MAAM,aAGb,MAAM,cACN,MAAM,EAiKhB;IArHA;;;OAGG;IACH,IAFU,qBAAqB,CAEnB;IAEZ;;;;;OAKG;IACH,kBAHU,OAAO,CAIwD;IAEzE;;;;;OAKG;IACH,mBAHU,OAAO,CAGuB;IAExC;;;OAGG;IACH,MAFU,MAAM,GAAC,SAAS,CAEV;IAEhB;;;;OAIG;IACH,OAFU,MAAM,GAAC,SAAS,CAER;IAIlB,mBAAqB;IAKrB;;;MAAwD;IAWxD;;;;;;;OAOG;IACH,oBAHU,OAAO,CAGK;IAEtB;;;;;;;;;OASG;IACH,QAHU,OAAO,CAGE;IAEnB;;;;;;;;;;OAUG;IACH,oBAHU,OAAO,CAGK;IAGtB,+BAA2B;IAC3B,oCAA+B;IAC/B,+BAA2B;IAG3B,mBAAwC;IAMtC,sBAAmB;IACnB,iBAAoB;IACpB,qBAAsB;IAgBzB;;;;;;OAMG;IACH,iBA0CC;IAzCA,YAGC;IACD,cAGC;IAoCF;;;;;OAKG;IACH,uBAgBC;IAED;;;;;OAKG;IACH,2BAMC;IAED;;OAEG;IACH,aAcC;IAED;;;;OAIG;IACH,wBAHW,MAAM,GACJ,KAAK,CAcjB;IAED;;;;;;OAMG;IACH,iBALW,MAAM,SACN,MAAM,GAAC,YAAY,QA4C7B;IAED;;;;;;;;;;;;;OAaG;IACH,wBAJW,qBAAqB,cACrB,MAAM,EAAE,UACR,MAAM,QAmBhB;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,SAFa,QAAQ,CA8BpB;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,oBATW,MAAM,QACN,MAAM,oBACN,kBAAkB,EAAE,mBACpB,MAAM,GACJ,MAAM,GAAC,IAAI,CAgFvB;IAED;;;;;OAKG;IACH,gBAkCC;CACD"}
1
+ {"version":3,"file":"glshader.d.ts","sourceRoot":"","sources":["../../../src/video/webgl/glshader.js"],"names":[],"mappings":"AAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH;IACC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;IACH,iBAtCW,qBAAqB,UAGrB,MAAM,GAAC,MAAM,aAGb,MAAM,cACN,MAAM,EAqLhB;IAzIA;;;OAGG;IACH,IAFU,qBAAqB,CAEnB;IAEZ;;;;;OAKG;IACH,kBAHU,OAAO,CAIwD;IAEzE;;;;;OAKG;IACH,mBAHU,OAAO,CAGuB;IAExC;;;OAGG;IACH,MAFU,MAAM,GAAC,SAAS,CAEV;IAEhB;;;;OAIG;IACH,OAFU,MAAM,GAAC,SAAS,CAER;IAIlB,mBAAqB;IAKrB;;;OAGG;IACH;;;MAAwD;IAWxD;;;;;;;OAOG;IACH,oBAHU,OAAO,CAGK;IAEtB;;;;;;;;;OASG;IACH,QAHU,OAAO,CAGE;IAEnB;;;;;;;;;;OAUG;IACH,oBAHU,OAAO,CAGK;IAGtB;;;OAGG;IACH,+BAA2B;IAC3B;;;OAGG;IACH,oCAA+B;IAC/B;;;OAGG;IACH,+BAA2B;IAG3B;;;OAGG;IACH,mBAAwC;IAMtC,sBAAmB;IACnB,iBAAoB;IACpB,qBAAsB;IAgBzB;;;;;;;;OAQG;IACH,iBA0CC;IAzCA,YAGC;IACD,cAGC;IAoCF;;;;;;;OAOG;IACH,uBAgBC;IAED;;;;;;;OAOG;IACH,2BAMC;IAED;;OAEG;IACH,aAcC;IAED;;;;OAIG;IACH,wBAHW,MAAM,GACJ,KAAK,CAcjB;IAED;;;;;;OAMG;IACH,iBALW,MAAM,SACN,MAAM,GAAC,YAAY,QA4C7B;IAED;;;;;;;;;;;;;OAaG;IACH,wBAJW,qBAAqB,cACrB,MAAM,EAAE,UACR,MAAM,QAmBhB;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,SAFa,QAAQ,CA8BpB;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,oBAVW,MAAM,QACN,MAAM,oBACN,kBAAkB,EAAE,mBACpB,MAAM,GACJ,MAAM,GAAC,IAAI,CAiFvB;IAED;;;;;OAKG;IACH,gBAkCC;CACD"}
@@ -1,48 +1,2 @@
1
- import type { Light3d } from "../../../lighting/light3d.ts";
2
- /**
3
- * Uniform-ready packing of the active 3D lights for the mesh-lit shader.
4
- * @ignore
5
- */
6
- export interface PackedMeshLighting {
7
- /** number of active shaded lights, clamped to `MAX_LIGHTS`. */
8
- count: number;
9
- /**
10
- * `MAX_LIGHTS × 4` — `[x, y, z, range]` per light; `range` is `-1` for
11
- * directional lights (the shader's type sentinel).
12
- */
13
- posRange: Float32Array;
14
- /**
15
- * `MAX_LIGHTS × 4` — `[dx, dy, dz, cos(outerConeAngle)]` per light;
16
- * `cosOuter` is `-1` when no cone applies (directional carries the
17
- * pre-negated surface→light vector, point carries no direction).
18
- */
19
- dirCone: Float32Array;
20
- /**
21
- * `MAX_LIGHTS × 4` — `[r, g, b, cos(innerConeAngle)]` per light,
22
- * color premultiplied by intensity.
23
- */
24
- colorInner: Float32Array;
25
- /** the summed ambient color (RGB, 0..1+). */
26
- ambient: Float32Array;
27
- }
28
- /**
29
- * Pack an iterable of {@link Light3d} (e.g. the active `Stage`'s 3D-light set)
30
- * into the std140-ready arrays the mesh-lit shader reads:
31
- * - **directional** lights contribute a surface→light direction (negated
32
- * travel direction, normalized) + a color premultiplied by intensity.
33
- * Re-normalized here so a direction mutated at runtime without
34
- * re-normalizing still shades correctly.
35
- * - **point** lights contribute their world position, `range` (quadratic
36
- * falloff over the range — the Light2d model) and premultiplied color.
37
- * - **spot** lights add their travel direction and the cone cosines
38
- * (`innerConeAngle` clamped just inside `outerConeAngle`, so the
39
- * smoothstep denominator never collapses).
40
- * - **ambient** lights are summed into a single flat ambient color.
41
- *
42
- * The same buffers are returned each call (overwritten in place).
43
- * @param lights - iterable of lights, or `null`/`undefined` (treated as empty)
44
- * @returns the packed lighting (reused instance)
45
- * @ignore
46
- */
47
- export declare function packMeshLights(lights: Iterable<Light3d> | null | undefined): PackedMeshLighting;
1
+ export {};
48
2
  //# sourceMappingURL=pack3d.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pack3d.d.ts","sourceRoot":"","sources":["../../../../src/video/webgl/lighting/pack3d.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAG5D;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IAClC,+DAA+D;IAC/D,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,EAAE,YAAY,CAAC;IACvB;;;;OAIG;IACH,OAAO,EAAE,YAAY,CAAC;IACtB;;;OAGG;IACH,UAAU,EAAE,YAAY,CAAC;IACzB,6CAA6C;IAC7C,OAAO,EAAE,YAAY,CAAC;CACtB;AAgBD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,cAAc,CAC7B,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,GAC1C,kBAAkB,CAuFpB"}
1
+ {"version":3,"file":"pack3d.d.ts","sourceRoot":"","sources":["../../../../src/video/webgl/lighting/pack3d.ts"],"names":[],"mappings":""}
@@ -1,110 +1,2 @@
1
- /**
2
- * Header, occupying two `vec4`s before the light array begins.
3
- *
4
- * ```glsl
5
- * int count; // offset 0
6
- * vec3 ambient; // offset 16 — a vec3 aligns to 16, so it cannot share
7
- * ```
8
- *
9
- * `count` is written as a float and read back with `int(...)` in the
10
- * shader. Declaring it `int` in the block would be tidier, but mixing int
11
- * and float members means the staging buffer can no longer be a single
12
- * `Float32Array` view, and the cast is free on every GPU that matters.
13
- * @ignore
14
- */
15
- export declare const HEADER_FLOATS: number;
16
- /**
17
- * floats occupied by one light: two `vec4`s
18
- * @ignore
19
- */
20
- export declare const LIGHT_FLOATS: number;
21
- /**
22
- * total floats in a light block, header included
23
- * @ignore
24
- */
25
- export declare const BLOCK_FLOATS: number;
26
- /**
27
- * total bytes in a light block
28
- * @ignore
29
- */
30
- export declare const BLOCK_BYTES: number;
31
- /**
32
- * Lay out 2D (`Light2d`) data.
33
- *
34
- * ```glsl
35
- * struct Light2dData {
36
- * vec4 posRadiusIntensity; // x, y, radius, intensity
37
- * vec4 colorHeight; // r, g, b, lightHeight
38
- * };
39
- * ```
40
- * @param out - staging buffer, at least `BLOCK_FLOATS` long
41
- * @param packed - what {@link packLights} produced
42
- * @param packed.count - number of live lights, clamped to `MAX_LIGHTS`
43
- * @param packed.positions - `[x, y, radius, intensity]` per light
44
- * @param packed.colors - `[r, g, b]` per light, 0..1 per channel
45
- * @param packed.heights - per-light height; absent means 0
46
- * @param packed.ambient - `[r, g, b]` ambient floor; absent means black
47
- * @returns how many floats of `out` are live, for a partial upload
48
- * @ignore
49
- */
50
- export declare function writeLight2dBlock(out: Float32Array, packed: {
51
- count: number;
52
- positions: Float32Array;
53
- colors: Float32Array;
54
- heights?: Float32Array;
55
- ambient?: ArrayLike<number>;
56
- }): number;
57
- /**
58
- * floats occupied by one 3D light: three `vec4`s. The 3D block grew from
59
- * two when point/spot shading landed (#1536) — a spot light needs position
60
- * + range + direction + both cone cosines + color, which cannot fold into
61
- * two vec4s' padding. The 2D block keeps its two-vec4 stride.
62
- * @ignore
63
- */
64
- export declare const LIGHT3D_FLOATS: number;
65
- /**
66
- * total floats in a 3D light block, header included
67
- * @ignore
68
- */
69
- export declare const BLOCK3D_FLOATS: number;
70
- /**
71
- * total bytes in a 3D light block
72
- * @ignore
73
- */
74
- export declare const BLOCK3D_BYTES: number;
75
- /**
76
- * Lay out 3D (`Light3d`) data.
77
- *
78
- * ```glsl
79
- * struct Light3dData {
80
- * vec4 posRange; // x, y, z = world position · w = range;
81
- * // w < 0 marks a DIRECTIONAL light (xyz unused)
82
- * vec4 dirCone; // x, y, z = direction · w = cos(outerConeAngle);
83
- * // w = -1 marks "no cone" (directional dir is the
84
- * // pre-negated surface→light vector; a point light
85
- * // carries no direction)
86
- * vec4 colorInner; // r, g, b = color × intensity · w = cos(innerConeAngle)
87
- * };
88
- * ```
89
- *
90
- * The type is inferred from the sentinels rather than a tag slot:
91
- * `posRange.w < 0` → directional; otherwise positional, with a cone
92
- * applied when `dirCone.w > -1`.
93
- * @param out - staging buffer, at least `BLOCK3D_FLOATS` long
94
- * @param packed - what {@link packMeshLights} produced
95
- * @param packed.count - number of live lights, clamped to `MAX_LIGHTS`
96
- * @param packed.posRange - `[x, y, z, range]` per light (range -1 for directional)
97
- * @param packed.dirCone - `[dx, dy, dz, cosOuter]` per light (cosOuter -1 for none)
98
- * @param packed.colorInner - `[r, g, b, cosInner]` per light
99
- * @param packed.ambient - `[r, g, b]` ambient floor; absent means black
100
- * @returns how many floats of `out` are live, for a partial upload
101
- * @ignore
102
- */
103
- export declare function writeLight3dBlock(out: Float32Array, packed: {
104
- count: number;
105
- posRange: Float32Array;
106
- dirCone: Float32Array;
107
- colorInner: Float32Array;
108
- ambient?: ArrayLike<number>;
109
- }): number;
1
+ export {};
110
2
  //# sourceMappingURL=std140.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"std140.d.ts","sourceRoot":"","sources":["../../../../src/video/webgl/lighting/std140.ts"],"names":[],"mappings":"AAsCA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,aAAa,QAAW,CAAC;AAEtC;;;GAGG;AACH,eAAO,MAAM,YAAY,QAAW,CAAC;AAErC;;;GAGG;AACH,eAAO,MAAM,YAAY,QAA4C,CAAC;AAEtE;;;GAGG;AACH,eAAO,MAAM,WAAW,QAAgD,CAAC;AA0BzE;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,iBAAiB,CAChC,GAAG,EAAE,YAAY,EACjB,MAAM,EAAE;IACP,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,YAAY,CAAC;IACxB,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,OAAO,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;CAC5B,GACC,MAAM,CAkCR;AAED;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,QAAW,CAAC;AAEvC;;;GAGG;AACH,eAAO,MAAM,cAAc,QAA8C,CAAC;AAE1E;;;GAGG;AACH,eAAO,MAAM,aAAa,QAAkD,CAAC;AAE7E;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,iBAAiB,CAChC,GAAG,EAAE,YAAY,EACjB,MAAM,EAAE;IACP,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,EAAE,YAAY,CAAC;IACtB,UAAU,EAAE,YAAY,CAAC;IACzB,OAAO,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;CAC5B,GACC,MAAM,CA4BR"}
1
+ {"version":3,"file":"std140.d.ts","sourceRoot":"","sources":["../../../../src/video/webgl/lighting/std140.ts"],"names":[],"mappings":""}