melonjs 20.3.0 → 20.5.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 (454) hide show
  1. package/README.md +19 -19
  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 +3 -0
  5. package/build/application/settings.d.ts.map +1 -1
  6. package/build/audio/audio.d.ts.map +1 -1
  7. package/build/audio/backend/engine.d.ts +0 -19
  8. package/build/audio/backend/engine.d.ts.map +1 -1
  9. package/build/audio/backend/sound.d.ts +1 -51
  10. package/build/audio/backend/sound.d.ts.map +1 -1
  11. package/build/audio/backend/spatial.d.ts.map +1 -1
  12. package/build/audio/backend/types.d.ts +11 -1
  13. package/build/audio/backend/types.d.ts.map +1 -1
  14. package/build/audio/backend/voice.d.ts +0 -25
  15. package/build/audio/backend/voice.d.ts.map +1 -1
  16. package/build/audio/playback.d.ts.map +1 -1
  17. package/build/audio/procedural.d.ts +7 -2
  18. package/build/audio/procedural.d.ts.map +1 -1
  19. package/build/audio/state.d.ts +6 -79
  20. package/build/audio/state.d.ts.map +1 -1
  21. package/build/audio/types.d.ts +22 -0
  22. package/build/audio/types.d.ts.map +1 -1
  23. package/build/camera/camera2d.d.ts +28 -68
  24. package/build/camera/camera2d.d.ts.map +1 -1
  25. package/build/camera/camera3d.d.ts +110 -82
  26. package/build/camera/camera3d.d.ts.map +1 -1
  27. package/build/camera/effects/fade_effect.d.ts +0 -5
  28. package/build/camera/effects/fade_effect.d.ts.map +1 -1
  29. package/build/camera/effects/mask_effect.d.ts +0 -5
  30. package/build/camera/effects/mask_effect.d.ts.map +1 -1
  31. package/build/camera/fog.d.ts +118 -0
  32. package/build/camera/fog.d.ts.map +1 -0
  33. package/build/geometries/box3d.d.ts +0 -28
  34. package/build/geometries/box3d.d.ts.map +1 -1
  35. package/build/geometries/ellipse.d.ts +0 -20
  36. package/build/geometries/ellipse.d.ts.map +1 -1
  37. package/build/geometries/observablePoint.d.ts +0 -3
  38. package/build/geometries/observablePoint.d.ts.map +1 -1
  39. package/build/geometries/path2d.d.ts +0 -19
  40. package/build/geometries/path2d.d.ts.map +1 -1
  41. package/build/geometries/polygon.d.ts +7 -13
  42. package/build/geometries/polygon.d.ts.map +1 -1
  43. package/build/geometries/roundrect.d.ts +0 -18
  44. package/build/geometries/roundrect.d.ts.map +1 -1
  45. package/build/geometries/sphere.d.ts +0 -9
  46. package/build/geometries/sphere.d.ts.map +1 -1
  47. package/build/geometries/toarccanvas.d.ts.map +1 -1
  48. package/build/index.d.ts +5 -0
  49. package/build/index.d.ts.map +1 -1
  50. package/build/index.js +3697 -563
  51. package/build/index.js.map +4 -4
  52. package/build/input/gamepad.d.ts.map +1 -1
  53. package/build/input/pointer.d.ts +0 -4
  54. package/build/input/pointer.d.ts.map +1 -1
  55. package/build/input/pointerevent.d.ts +0 -6
  56. package/build/input/pointerevent.d.ts.map +1 -1
  57. package/build/lang/deprecated.d.ts.map +1 -1
  58. package/build/level/gltf/GLTFModel.d.ts +44 -82
  59. package/build/level/gltf/GLTFModel.d.ts.map +1 -1
  60. package/build/level/gltf/GLTFScene.d.ts +1 -44
  61. package/build/level/gltf/GLTFScene.d.ts.map +1 -1
  62. package/build/level/gltf/gltf_sampler.d.ts +1 -48
  63. package/build/level/gltf/gltf_sampler.d.ts.map +1 -1
  64. package/build/level/level.d.ts +195 -113
  65. package/build/level/level.d.ts.map +1 -1
  66. package/build/level/tiled/TMXGroup.d.ts +1 -65
  67. package/build/level/tiled/TMXGroup.d.ts.map +1 -1
  68. package/build/level/tiled/TMXLayer.d.ts +0 -44
  69. package/build/level/tiled/TMXLayer.d.ts.map +1 -1
  70. package/build/level/tiled/TMXObject.d.ts +1 -136
  71. package/build/level/tiled/TMXObject.d.ts.map +1 -1
  72. package/build/level/tiled/TMXObjectFactory.d.ts +1 -40
  73. package/build/level/tiled/TMXObjectFactory.d.ts.map +1 -1
  74. package/build/level/tiled/TMXTile.d.ts +1 -30
  75. package/build/level/tiled/TMXTile.d.ts.map +1 -1
  76. package/build/level/tiled/TMXTileMap.d.ts +0 -10
  77. package/build/level/tiled/TMXTileMap.d.ts.map +1 -1
  78. package/build/level/tiled/TMXTileset.d.ts +0 -113
  79. package/build/level/tiled/TMXTileset.d.ts.map +1 -1
  80. package/build/level/tiled/TMXTilesetGroup.d.ts +0 -1
  81. package/build/level/tiled/TMXTilesetGroup.d.ts.map +1 -1
  82. package/build/level/tiled/TMXUtils.d.ts +1 -43
  83. package/build/level/tiled/TMXUtils.d.ts.map +1 -1
  84. package/build/level/tiled/factories/shape.d.ts +1 -7
  85. package/build/level/tiled/factories/shape.d.ts.map +1 -1
  86. package/build/level/tiled/factories/text.d.ts +1 -7
  87. package/build/level/tiled/factories/text.d.ts.map +1 -1
  88. package/build/level/tiled/factories/tile.d.ts +1 -7
  89. package/build/level/tiled/factories/tile.d.ts.map +1 -1
  90. package/build/level/tiled/renderer/TMXHexagonalRenderer.d.ts +0 -60
  91. package/build/level/tiled/renderer/TMXHexagonalRenderer.d.ts.map +1 -1
  92. package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts +0 -42
  93. package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts.map +1 -1
  94. package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts +0 -5
  95. package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts.map +1 -1
  96. package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts +0 -31
  97. package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts.map +1 -1
  98. package/build/level/tiled/renderer/TMXRenderer.d.ts +2 -2
  99. package/build/level/tiled/renderer/TMXRenderer.d.ts.map +1 -1
  100. package/build/level/tiled/renderer/TMXStaggeredRenderer.d.ts.map +1 -1
  101. package/build/level/tiled/renderer/autodetect.d.ts +1 -6
  102. package/build/level/tiled/renderer/autodetect.d.ts.map +1 -1
  103. package/build/lighting/light2d.d.ts +0 -25
  104. package/build/lighting/light2d.d.ts.map +1 -1
  105. package/build/lighting/light3d.d.ts +20 -63
  106. package/build/lighting/light3d.d.ts.map +1 -1
  107. package/build/loader/loader.d.ts +146 -37
  108. package/build/loader/loader.d.ts.map +1 -1
  109. package/build/loader/loadingscreen.d.ts +0 -33
  110. package/build/loader/loadingscreen.d.ts.map +1 -1
  111. package/build/loader/parsers/aseprite.d.ts +0 -13
  112. package/build/loader/parsers/aseprite.d.ts.map +1 -1
  113. package/build/loader/parsers/audio.d.ts +1 -30
  114. package/build/loader/parsers/audio.d.ts.map +1 -1
  115. package/build/loader/parsers/binary.d.ts +1 -10
  116. package/build/loader/parsers/binary.d.ts.map +1 -1
  117. package/build/loader/parsers/compressed_textures/compressed_image.d.ts.map +1 -1
  118. package/build/loader/parsers/compressed_textures/parseDDS.d.ts +1 -7
  119. package/build/loader/parsers/compressed_textures/parseDDS.d.ts.map +1 -1
  120. package/build/loader/parsers/compressed_textures/parseKTX.d.ts +1 -7
  121. package/build/loader/parsers/compressed_textures/parseKTX.d.ts.map +1 -1
  122. package/build/loader/parsers/compressed_textures/parseKTX2.d.ts +1 -7
  123. package/build/loader/parsers/compressed_textures/parseKTX2.d.ts.map +1 -1
  124. package/build/loader/parsers/compressed_textures/parsePKM.d.ts +1 -7
  125. package/build/loader/parsers/compressed_textures/parsePKM.d.ts.map +1 -1
  126. package/build/loader/parsers/compressed_textures/parsePVR.d.ts +1 -7
  127. package/build/loader/parsers/compressed_textures/parsePVR.d.ts.map +1 -1
  128. package/build/loader/parsers/fontface.d.ts +1 -13
  129. package/build/loader/parsers/fontface.d.ts.map +1 -1
  130. package/build/loader/parsers/gltf.d.ts +1 -70
  131. package/build/loader/parsers/gltf.d.ts.map +1 -1
  132. package/build/loader/parsers/image.d.ts +1 -22
  133. package/build/loader/parsers/image.d.ts.map +1 -1
  134. package/build/loader/parsers/json.d.ts +1 -10
  135. package/build/loader/parsers/json.d.ts.map +1 -1
  136. package/build/loader/parsers/mtl.d.ts +1 -28
  137. package/build/loader/parsers/mtl.d.ts.map +1 -1
  138. package/build/loader/parsers/obj.d.ts +1 -59
  139. package/build/loader/parsers/obj.d.ts.map +1 -1
  140. package/build/loader/parsers/pbr.d.ts +1 -62
  141. package/build/loader/parsers/pbr.d.ts.map +1 -1
  142. package/build/loader/parsers/script.d.ts +1 -10
  143. package/build/loader/parsers/script.d.ts.map +1 -1
  144. package/build/loader/parsers/shader.d.ts +1 -52
  145. package/build/loader/parsers/shader.d.ts.map +1 -1
  146. package/build/loader/parsers/tmx.d.ts +1 -10
  147. package/build/loader/parsers/tmx.d.ts.map +1 -1
  148. package/build/loader/parsers/video.d.ts +1 -10
  149. package/build/loader/parsers/video.d.ts.map +1 -1
  150. package/build/math/color.d.ts.map +1 -1
  151. package/build/math/noise.d.ts +0 -40
  152. package/build/math/noise.d.ts.map +1 -1
  153. package/build/math/observableVector2d.d.ts +0 -3
  154. package/build/math/observableVector2d.d.ts.map +1 -1
  155. package/build/math/observableVector3d.d.ts +0 -3
  156. package/build/math/observableVector3d.d.ts.map +1 -1
  157. package/build/math/vector2d.d.ts +0 -6
  158. package/build/math/vector2d.d.ts.map +1 -1
  159. package/build/math/vertex.d.ts +25 -0
  160. package/build/math/vertex.d.ts.map +1 -1
  161. package/build/particles/emitter.d.ts +0 -65
  162. package/build/particles/emitter.d.ts.map +1 -1
  163. package/build/particles/particle.d.ts +0 -81
  164. package/build/particles/particle.d.ts.map +1 -1
  165. package/build/physics/bounds.d.ts +0 -1
  166. package/build/physics/bounds.d.ts.map +1 -1
  167. package/build/physics/broadphase/broadphase.d.ts +0 -7
  168. package/build/physics/broadphase/broadphase.d.ts.map +1 -1
  169. package/build/physics/broadphase/octree.d.ts +0 -91
  170. package/build/physics/broadphase/octree.d.ts.map +1 -1
  171. package/build/physics/broadphase/quadtree.d.ts +0 -47
  172. package/build/physics/broadphase/quadtree.d.ts.map +1 -1
  173. package/build/physics/builtin/body.d.ts +2 -65
  174. package/build/physics/builtin/body.d.ts.map +1 -1
  175. package/build/physics/builtin/detector.d.ts +0 -312
  176. package/build/physics/builtin/detector.d.ts.map +1 -1
  177. package/build/physics/builtin/sat.d.ts +1 -48
  178. package/build/physics/builtin/sat.d.ts.map +1 -1
  179. package/build/physics/builtin/sat3d.d.ts +1 -56
  180. package/build/physics/builtin/sat3d.d.ts.map +1 -1
  181. package/build/physics/collision.d.ts +0 -2
  182. package/build/physics/collision.d.ts.map +1 -1
  183. package/build/physics/response.d.ts +0 -1
  184. package/build/physics/response.d.ts.map +1 -1
  185. package/build/physics/world.d.ts.map +1 -1
  186. package/build/renderable/anchorPoint.d.ts +1 -73
  187. package/build/renderable/anchorPoint.d.ts.map +1 -1
  188. package/build/renderable/animation.d.ts +21 -13
  189. package/build/renderable/animation.d.ts.map +1 -1
  190. package/build/renderable/colorlayer.d.ts +0 -5
  191. package/build/renderable/colorlayer.d.ts.map +1 -1
  192. package/build/renderable/container.d.ts +27 -60
  193. package/build/renderable/container.d.ts.map +1 -1
  194. package/build/renderable/draggable.d.ts +0 -5
  195. package/build/renderable/draggable.d.ts.map +1 -1
  196. package/build/renderable/dragndrop.d.ts +1 -12
  197. package/build/renderable/dragndrop.d.ts.map +1 -1
  198. package/build/renderable/entity/entity.d.ts +0 -8
  199. package/build/renderable/entity/entity.d.ts.map +1 -1
  200. package/build/renderable/frameAnimation.d.ts +0 -41
  201. package/build/renderable/frameAnimation.d.ts.map +1 -1
  202. package/build/renderable/groundshadow.d.ts +1 -91
  203. package/build/renderable/groundshadow.d.ts.map +1 -1
  204. package/build/renderable/imagelayer.d.ts +0 -29
  205. package/build/renderable/imagelayer.d.ts.map +1 -1
  206. package/build/renderable/instanced_mesh.d.ts +55 -108
  207. package/build/renderable/instanced_mesh.d.ts.map +1 -1
  208. package/build/renderable/mesh.d.ts +257 -231
  209. package/build/renderable/mesh.d.ts.map +1 -1
  210. package/build/renderable/nineslicesprite.d.ts +0 -4
  211. package/build/renderable/nineslicesprite.d.ts.map +1 -1
  212. package/build/renderable/renderable.d.ts +18 -44
  213. package/build/renderable/renderable.d.ts.map +1 -1
  214. package/build/renderable/sprite.d.ts +0 -45
  215. package/build/renderable/sprite.d.ts.map +1 -1
  216. package/build/renderable/sprite3d.d.ts +12 -97
  217. package/build/renderable/sprite3d.d.ts.map +1 -1
  218. package/build/renderable/text/bitmaptext.d.ts +32 -21
  219. package/build/renderable/text/bitmaptext.d.ts.map +1 -1
  220. package/build/renderable/text/bitmaptextdata.d.ts +0 -22
  221. package/build/renderable/text/bitmaptextdata.d.ts.map +1 -1
  222. package/build/renderable/text/glyph.d.ts +1 -39
  223. package/build/renderable/text/glyph.d.ts.map +1 -1
  224. package/build/renderable/text/text.d.ts +75 -20
  225. package/build/renderable/text/text.d.ts.map +1 -1
  226. package/build/renderable/text/textmetrics.d.ts +2 -0
  227. package/build/renderable/text/textmetrics.d.ts.map +1 -1
  228. package/build/renderable/text/textstyle.d.ts +1 -5
  229. package/build/renderable/text/textstyle.d.ts.map +1 -1
  230. package/build/renderable/trail.d.ts +0 -29
  231. package/build/renderable/trail.d.ts.map +1 -1
  232. package/build/renderable/trigger.d.ts +0 -6
  233. package/build/renderable/trigger.d.ts.map +1 -1
  234. package/build/renderable/ui/uibaseelement.d.ts +0 -40
  235. package/build/renderable/ui/uibaseelement.d.ts.map +1 -1
  236. package/build/renderable/ui/uispriteelement.d.ts +0 -35
  237. package/build/renderable/ui/uispriteelement.d.ts.map +1 -1
  238. package/build/state/stage.d.ts +5 -50
  239. package/build/state/stage.d.ts.map +1 -1
  240. package/build/state/state.d.ts.map +1 -1
  241. package/build/system/device.d.ts +1 -13
  242. package/build/system/device.d.ts.map +1 -1
  243. package/build/system/dom.d.ts +1 -8
  244. package/build/system/dom.d.ts.map +1 -1
  245. package/build/system/legacy_pool.d.ts +1 -6
  246. package/build/system/legacy_pool.d.ts.map +1 -1
  247. package/build/system/platform.d.ts +0 -1
  248. package/build/system/platform.d.ts.map +1 -1
  249. package/build/system/pool.d.ts +0 -9
  250. package/build/system/pool.d.ts.map +1 -1
  251. package/build/system/save.d.ts +44 -1
  252. package/build/system/save.d.ts.map +1 -1
  253. package/build/system/timer.d.ts +0 -20
  254. package/build/system/timer.d.ts.map +1 -1
  255. package/build/tweens/tween.d.ts +0 -62
  256. package/build/tweens/tween.d.ts.map +1 -1
  257. package/build/utils/array-multimap.d.ts +1 -13
  258. package/build/utils/array-multimap.d.ts.map +1 -1
  259. package/build/utils/decode.d.ts.map +1 -1
  260. package/build/utils/fetchdata.d.ts +1 -31
  261. package/build/utils/fetchdata.d.ts.map +1 -1
  262. package/build/utils/utils.d.ts +0 -13
  263. package/build/utils/utils.d.ts.map +1 -1
  264. package/build/video/blendmodes.d.ts +1 -106
  265. package/build/video/blendmodes.d.ts.map +1 -1
  266. package/build/video/buffer/index.d.ts +1 -39
  267. package/build/video/buffer/index.d.ts.map +1 -1
  268. package/build/video/buffer/vertex.d.ts +1 -82
  269. package/build/video/buffer/vertex.d.ts.map +1 -1
  270. package/build/video/canvas/canvas_renderer.d.ts +2 -23
  271. package/build/video/canvas/canvas_renderer.d.ts.map +1 -1
  272. package/build/video/canvas_factory.d.ts +1 -24
  273. package/build/video/canvas_factory.d.ts.map +1 -1
  274. package/build/video/effects/blendEffect.d.ts +0 -54
  275. package/build/video/effects/blendEffect.d.ts.map +1 -1
  276. package/build/video/effects/colorMatrix.d.ts +0 -10
  277. package/build/video/effects/colorMatrix.d.ts.map +1 -1
  278. package/build/video/effects/glsl_realization.d.ts +1 -17
  279. package/build/video/effects/glsl_realization.d.ts.map +1 -1
  280. package/build/video/effects/mesh_splice.d.ts +2 -0
  281. package/build/video/effects/mesh_splice.d.ts.map +1 -0
  282. package/build/video/effects/radialGradient.d.ts +0 -1
  283. package/build/video/effects/radialGradient.d.ts.map +1 -1
  284. package/build/video/effects/shadereffect.d.ts +12 -241
  285. package/build/video/effects/shadereffect.d.ts.map +1 -1
  286. package/build/video/effects/wgsl/layout.d.ts +1 -27
  287. package/build/video/effects/wgsl/layout.d.ts.map +1 -1
  288. package/build/video/effects/wgsl/parse.d.ts +1 -8
  289. package/build/video/effects/wgsl/parse.d.ts.map +1 -1
  290. package/build/video/effects/wgsl/scaffold.d.ts +1 -42
  291. package/build/video/effects/wgsl/scaffold.d.ts.map +1 -1
  292. package/build/video/effects/wgsl_realization.d.ts +1 -82
  293. package/build/video/effects/wgsl_realization.d.ts.map +1 -1
  294. package/build/video/gpu/batcher.d.ts +1 -13
  295. package/build/video/gpu/batcher.d.ts.map +1 -1
  296. package/build/video/gpu/instancerecord.d.ts +1 -163
  297. package/build/video/gpu/instancerecord.d.ts.map +1 -1
  298. package/build/video/gpu/meshchunk.d.ts +1 -48
  299. package/build/video/gpu/meshchunk.d.ts.map +1 -1
  300. package/build/video/gpu/meshvertex.d.ts +1 -53
  301. package/build/video/gpu/meshvertex.d.ts.map +1 -1
  302. package/build/video/gpu/primitives.d.ts +1 -59
  303. package/build/video/gpu/primitives.d.ts.map +1 -1
  304. package/build/video/gpu/quadcorners.d.ts +1 -10
  305. package/build/video/gpu/quadcorners.d.ts.map +1 -1
  306. package/build/video/gpu/textureslots.d.ts +1 -121
  307. package/build/video/gpu/textureslots.d.ts.map +1 -1
  308. package/build/video/gpu/texturestore.d.ts +1 -138
  309. package/build/video/gpu/texturestore.d.ts.map +1 -1
  310. package/build/video/gpu/topology.d.ts.map +1 -1
  311. package/build/video/gpu/vertexformat.d.ts +0 -28
  312. package/build/video/gpu/vertexformat.d.ts.map +1 -1
  313. package/build/video/gradient.d.ts +15 -77
  314. package/build/video/gradient.d.ts.map +1 -1
  315. package/build/video/renderer.d.ts +21 -102
  316. package/build/video/renderer.d.ts.map +1 -1
  317. package/build/video/renderstate.d.ts +0 -51
  318. package/build/video/renderstate.d.ts.map +1 -1
  319. package/build/video/rendertarget/canvasrendertarget.d.ts +0 -10
  320. package/build/video/rendertarget/canvasrendertarget.d.ts.map +1 -1
  321. package/build/video/rendertarget/render_target_pool.d.ts +1 -82
  322. package/build/video/rendertarget/render_target_pool.d.ts.map +1 -1
  323. package/build/video/rendertarget/webglrendertarget.d.ts +1 -64
  324. package/build/video/rendertarget/webglrendertarget.d.ts.map +1 -1
  325. package/build/video/rendertarget/webgpurendertarget.d.ts +0 -8
  326. package/build/video/rendertarget/webgpurendertarget.d.ts.map +1 -1
  327. package/build/video/texture/atlas.d.ts +1 -75
  328. package/build/video/texture/atlas.d.ts.map +1 -1
  329. package/build/video/texture/cache.d.ts +0 -136
  330. package/build/video/texture/cache.d.ts.map +1 -1
  331. package/build/video/texture/frametexture.d.ts +1 -71
  332. package/build/video/texture/frametexture.d.ts.map +1 -1
  333. package/build/video/texture/noise_texture2d.d.ts +101 -77
  334. package/build/video/texture/noise_texture2d.d.ts.map +1 -1
  335. package/build/video/texture/parser/aseprite.d.ts +1 -8
  336. package/build/video/texture/parser/aseprite.d.ts.map +1 -1
  337. package/build/video/texture/parser/spritesheet.d.ts +1 -8
  338. package/build/video/texture/parser/spritesheet.d.ts.map +1 -1
  339. package/build/video/texture/parser/texturepacker.d.ts +1 -8
  340. package/build/video/texture/parser/texturepacker.d.ts.map +1 -1
  341. package/build/video/texture/resource.d.ts +0 -9
  342. package/build/video/texture/resource.d.ts.map +1 -1
  343. package/build/video/texture/texture2d.d.ts +0 -11
  344. package/build/video/texture/texture2d.d.ts.map +1 -1
  345. package/build/video/utils/autodetect.d.ts +1 -5
  346. package/build/video/utils/autodetect.d.ts.map +1 -1
  347. package/build/video/webgl/batchers/batcher.d.ts +0 -55
  348. package/build/video/webgl/batchers/batcher.d.ts.map +1 -1
  349. package/build/video/webgl/batchers/lit_mesh_batcher.d.ts +0 -14
  350. package/build/video/webgl/batchers/lit_mesh_batcher.d.ts.map +1 -1
  351. package/build/video/webgl/batchers/lit_quad_batcher.d.ts +0 -72
  352. package/build/video/webgl/batchers/lit_quad_batcher.d.ts.map +1 -1
  353. package/build/video/webgl/batchers/material_batcher.d.ts +0 -89
  354. package/build/video/webgl/batchers/material_batcher.d.ts.map +1 -1
  355. package/build/video/webgl/batchers/mesh_batcher.d.ts +14 -343
  356. package/build/video/webgl/batchers/mesh_batcher.d.ts.map +1 -1
  357. package/build/video/webgl/batchers/primitive_batcher.d.ts +0 -10
  358. package/build/video/webgl/batchers/primitive_batcher.d.ts.map +1 -1
  359. package/build/video/webgl/batchers/quad_batcher.d.ts +0 -30
  360. package/build/video/webgl/batchers/quad_batcher.d.ts.map +1 -1
  361. package/build/video/webgl/buffer/index.d.ts +1 -36
  362. package/build/video/webgl/buffer/index.d.ts.map +1 -1
  363. package/build/video/webgl/buffer/instance_buffer.d.ts +1 -53
  364. package/build/video/webgl/buffer/instance_buffer.d.ts.map +1 -1
  365. package/build/video/webgl/buffer/retained_geometry.d.ts +1 -81
  366. package/build/video/webgl/buffer/retained_geometry.d.ts.map +1 -1
  367. package/build/video/webgl/buffer/uniformblock.d.ts +1 -80
  368. package/build/video/webgl/buffer/uniformblock.d.ts.map +1 -1
  369. package/build/video/webgl/buffer/vertexstate.d.ts +1 -100
  370. package/build/video/webgl/buffer/vertexstate.d.ts.map +1 -1
  371. package/build/video/webgl/glshader.d.ts +7 -51
  372. package/build/video/webgl/glshader.d.ts.map +1 -1
  373. package/build/video/webgl/lighting/pack3d.d.ts +1 -47
  374. package/build/video/webgl/lighting/pack3d.d.ts.map +1 -1
  375. package/build/video/webgl/lighting/std140.d.ts +1 -109
  376. package/build/video/webgl/lighting/std140.d.ts.map +1 -1
  377. package/build/video/webgl/renderers/tmxlayer/orthogonal.d.ts +1 -103
  378. package/build/video/webgl/renderers/tmxlayer/orthogonal.d.ts.map +1 -1
  379. package/build/video/webgl/shaders/multitexture-lit.d.ts +1 -26
  380. package/build/video/webgl/shaders/multitexture-lit.d.ts.map +1 -1
  381. package/build/video/webgl/shaders/multitexture.d.ts +1 -9
  382. package/build/video/webgl/shaders/multitexture.d.ts.map +1 -1
  383. package/build/video/webgl/texture/store.d.ts +1 -50
  384. package/build/video/webgl/texture/store.d.ts.map +1 -1
  385. package/build/video/webgl/utils/attributes.d.ts +1 -11
  386. package/build/video/webgl/utils/attributes.d.ts.map +1 -1
  387. package/build/video/webgl/utils/maxtextures.d.ts +1 -36
  388. package/build/video/webgl/utils/maxtextures.d.ts.map +1 -1
  389. package/build/video/webgl/utils/precision.d.ts +1 -14
  390. package/build/video/webgl/utils/precision.d.ts.map +1 -1
  391. package/build/video/webgl/utils/program.d.ts +1 -5
  392. package/build/video/webgl/utils/program.d.ts.map +1 -1
  393. package/build/video/webgl/utils/samplercache.d.ts +1 -68
  394. package/build/video/webgl/utils/samplercache.d.ts.map +1 -1
  395. package/build/video/webgl/utils/string.d.ts +1 -21
  396. package/build/video/webgl/utils/string.d.ts.map +1 -1
  397. package/build/video/webgl/utils/topology.d.ts +1 -23
  398. package/build/video/webgl/utils/topology.d.ts.map +1 -1
  399. package/build/video/webgl/utils/uniforms.d.ts +1 -25
  400. package/build/video/webgl/utils/uniforms.d.ts.map +1 -1
  401. package/build/video/webgl/utils/vertexformat.d.ts +1 -26
  402. package/build/video/webgl/utils/vertexformat.d.ts.map +1 -1
  403. package/build/video/webgl/webgl_renderer.d.ts +22 -285
  404. package/build/video/webgl/webgl_renderer.d.ts.map +1 -1
  405. package/build/video/webgpu/batchers/lit_mesh_batcher.d.ts +0 -6
  406. package/build/video/webgpu/batchers/lit_mesh_batcher.d.ts.map +1 -1
  407. package/build/video/webgpu/batchers/lit_quad_batcher.d.ts +0 -8
  408. package/build/video/webgpu/batchers/lit_quad_batcher.d.ts.map +1 -1
  409. package/build/video/webgpu/batchers/mesh_batcher.d.ts +7 -231
  410. package/build/video/webgpu/batchers/mesh_batcher.d.ts.map +1 -1
  411. package/build/video/webgpu/batchers/primitive_batcher.d.ts.map +1 -1
  412. package/build/video/webgpu/batchers/quad_batcher.d.ts +0 -82
  413. package/build/video/webgpu/batchers/quad_batcher.d.ts.map +1 -1
  414. package/build/video/webgpu/buffer/arena.d.ts +1 -63
  415. package/build/video/webgpu/buffer/arena.d.ts.map +1 -1
  416. package/build/video/webgpu/buffer/instance_buffer.d.ts +1 -64
  417. package/build/video/webgpu/buffer/instance_buffer.d.ts.map +1 -1
  418. package/build/video/webgpu/buffer/retained_geometry.d.ts +1 -54
  419. package/build/video/webgpu/buffer/retained_geometry.d.ts.map +1 -1
  420. package/build/video/webgpu/buffer/uniformring.d.ts +1 -67
  421. package/build/video/webgpu/buffer/uniformring.d.ts.map +1 -1
  422. package/build/video/webgpu/effect_binding.d.ts +1 -16
  423. package/build/video/webgpu/effect_binding.d.ts.map +1 -1
  424. package/build/video/webgpu/pipeline/bindgroups.d.ts +1 -32
  425. package/build/video/webgpu/pipeline/bindgroups.d.ts.map +1 -1
  426. package/build/video/webgpu/pipeline/cache.d.ts +1 -163
  427. package/build/video/webgpu/pipeline/cache.d.ts.map +1 -1
  428. package/build/video/webgpu/renderers/tmxlayer/orthogonal.d.ts +1 -87
  429. package/build/video/webgpu/renderers/tmxlayer/orthogonal.d.ts.map +1 -1
  430. package/build/video/webgpu/shaders/mesh-instanced.d.ts +1 -43
  431. package/build/video/webgpu/shaders/mesh-instanced.d.ts.map +1 -1
  432. package/build/video/webgpu/texture/compressed.d.ts +1 -32
  433. package/build/video/webgpu/texture/compressed.d.ts.map +1 -1
  434. package/build/video/webgpu/texture/frametexture.d.ts +1 -62
  435. package/build/video/webgpu/texture/frametexture.d.ts.map +1 -1
  436. package/build/video/webgpu/texture/store.d.ts +1 -147
  437. package/build/video/webgpu/texture/store.d.ts.map +1 -1
  438. package/build/video/webgpu/webgpu_renderer.d.ts +1 -88
  439. package/build/video/webgpu/webgpu_renderer.d.ts.map +1 -1
  440. package/package.json +5 -4
  441. package/skills/melonjs/SKILL.md +1 -1
  442. package/skills/melonjs-3d/SKILL.md +453 -5
  443. package/skills/melonjs-3d-assets/SKILL.md +164 -6
  444. package/skills/melonjs-audio/SKILL.md +38 -0
  445. package/skills/melonjs-camera-and-drawing/SKILL.md +49 -0
  446. package/skills/melonjs-effects-and-shaders/SKILL.md +95 -2
  447. package/skills/melonjs-loading-assets/SKILL.md +127 -2
  448. package/skills/melonjs-performance/SKILL.md +60 -1
  449. package/skills/melonjs-physics/SKILL.md +78 -0
  450. package/skills/melonjs-renderables/SKILL.md +63 -1
  451. package/skills/melonjs-renderer-backends/SKILL.md +19 -0
  452. package/skills/melonjs-scenes-and-state/SKILL.md +56 -0
  453. package/skills/melonjs-tilemaps/SKILL.md +31 -11
  454. package/skills/melonjs-ui-and-text/SKILL.md +131 -117
@@ -1 +1 @@
1
- {"version":3,"file":"material_batcher.d.ts","sourceRoot":"","sources":["../../../../src/video/webgl/batchers/material_batcher.js"],"names":[],"mappings":"AAgCA;IACC;;;OAGG;IACH,yCAoDC;IAiCD,6BAPU,MAAM,EASf;IAlBD;;;;;;;;;;;OAWG;IACH,0BAHU,MAAM,CAKf;IA5EA;;;OAGG;IACH,iCAAuB;IAEvB;;;;;;;;;OASG;IACH,oCAA2B;IAwB1B,+CAEC;IAKH;;;;;;;OAOG;IACH,6BAKC;IAsDD;;;;;;;;;;;OAWG;IACH,sBAVW,MAAM,WACN,8DAAM,iBAAiB,GAAC,SAAS,GAAC,UAAU,EAAE,GAAC,YAAY,EAAE,UAC7D,MAAM,WACN,MAAM,MACN,MAAM,MACN,MAAM,uBACN,OAAO,WACP,OAAO,kCACL,YAAY,CAoKxB;IAED;;;OAGG;IACH,yBAFW,YAAY,GAAC,YAAY,QAuCnC;IAED;;;;OAIG;IACH,mBAHW,MAAM,GACJ,YAAY,CAIxB;IAED;;;;OAIG;IACH,uBAHW,YAAY,QACZ,MAAM,yBAsBhB;IAED;;;;;OAKG;IACH;;;;;;;;OAQG;IACH,uBAHW,MAAM,QAKhB;IAED,8CAWC;IAED;;;;;;;;;;;OAWG;IACH,qBAHW,MAAM,QAQhB;IAED;;;;;;;;;;;;;;OAcG;IACH,uBAbW,YAAY,GAAC,eAAe,MAC5B,MAAM,MAGN,MAAM,UACN,OAAO,UACP,OAAO,WACP,MAAM,OA2GhB;CACD;6BApkB4B,cAAc;kCAIZ,0BAA0B"}
1
+ {"version":3,"file":"material_batcher.d.ts","sourceRoot":"","sources":["../../../../src/video/webgl/batchers/material_batcher.js"],"names":[],"mappings":"AAkCA;IACC;;;;OAIG;IACH,yCA2DC;IAmCD,6BARU,MAAM,EAUf;IAnBD;;;;;;;;;;;;OAYG;IACH,0BAJU,MAAM,CAMf;IArFA;;;;OAIG;IACH,iCAAuB;IAEvB;;;;;;;;;;OAUG;IACH,oCAA2B;IAyB1B;;;OAGG;IACH,+CAEC;IAKH;;;;;;;;OAQG;IACH,6BAKC;IAyDD;;;;;;;;;;;OAWG;IACH,sBAVW,MAAM,WACN,8DAAM,iBAAiB,GAAC,SAAS,GAAC,UAAU,EAAE,GAAC,YAAY,EAAE,UAC7D,MAAM,WACN,MAAM,MACN,MAAM,MACN,MAAM,uBACN,OAAO,WACP,OAAO,kCACL,YAAY,CAoKxB;IAED;;;OAGG;IACH,yBAFW,YAAY,GAAC,YAAY,QAuCnC;IAED;;;;OAIG;IACH,mBAHW,MAAM,GACJ,YAAY,CAIxB;IAED;;;;OAIG;IACH,uBAHW,YAAY,QACZ,MAAM,yBAsBhB;IAED;;;;;OAKG;IACH;;;;;;;;;OASG;IACH,uBAJW,MAAM,QAMhB;IAED,8CAWC;IAED;;;;;;;;;;;;OAYG;IACH,qBAJW,MAAM,QAShB;IAED;;;;;;;;;;;;;;;OAeG;IACH,uBAbW,YAAY,GAAC,eAAe,MAC5B,MAAM,MAGN,MAAM,UACN,OAAO,UACP,OAAO,WACP,MAAM,OA2GhB;CACD;6BArlB4B,cAAc;kCAIZ,0BAA0B"}
@@ -29,11 +29,6 @@
29
29
  * @category Rendering
30
30
  */
31
31
  export default class MeshBatcher extends MaterialBatcher {
32
- /**
33
- * Initialize the mesh batcher
34
- * @ignore
35
- */
36
- init(renderer: any): void;
37
32
  currentAlphaCutoff: any;
38
33
  currentEmissiveR: any;
39
34
  currentEmissiveG: any;
@@ -47,353 +42,29 @@ export default class MeshBatcher extends MaterialBatcher {
47
42
  currentEyeX: any;
48
43
  currentEyeY: any;
49
44
  currentEyeZ: any;
45
+ currentFogMode: any;
46
+ currentFogNear: any;
47
+ currentFogInvRange: any;
48
+ currentFogDensity: any;
49
+ currentFogR: any;
50
+ currentFogG: any;
51
+ currentFogB: any;
52
+ currentFogAxisX: any;
53
+ currentFogAxisY: any;
54
+ currentFogAxisZ: any;
55
+ currentFogBase: any;
50
56
  retained: Map<any, any> | undefined;
51
57
  instanced: Map<any, any> | undefined;
52
- instancedShaders: Map<any, any> | undefined;
53
- shadowShader: GLShader | undefined;
58
+ shaderVariants: Map<any, any> | undefined;
54
59
  currentTintValue: any;
55
60
  trilinearTextures: WeakSet<object> | undefined;
56
61
  anisotropicExt: any;
57
62
  maxAnisotropy: number | undefined;
58
- _onTargetChanged: ((emitter: any) => void) | null | undefined;
59
- /**
60
- * The vertex attribute layout. The base (unlit) mesh batcher is
61
- * `aVertex` (3) + `aRegion` (2) + `aColor` (4) = 9 floats. Subclasses
62
- * (e.g. {@link LitMeshBatcher}) append their own attributes.
63
- * @ignore
64
- */
65
- _attributeLayout(_renderer: any): {
66
- name: string;
67
- format: string;
68
- offset: number;
69
- }[];
70
- /**
71
- * The shader sources for this batcher (unlit by default). Subclasses
72
- * override to supply a lit shader.
73
- * @ignore
74
- */
75
- _shaderSources(): {
76
- vertex: any;
77
- fragment: any;
78
- };
79
- /**
80
- * Invalidate the per-mesh `uAlphaCutoff` / `uEmissive` caches when the bound
81
- * shader (GL program) changes — the new program's uniforms are at their own
82
- * defaults, so the next mesh must re-issue them rather than trust the cache.
83
- * Mirrors the base batcher's `currentSamplerUnit` reset (same condition), and
84
- * matters when a custom mesh shader declaring those uniforms is interleaved
85
- * with the built-in one on this batcher (e.g. `drawMesh` swapping a custom
86
- * shader in and back out).
87
- * @ignore
88
- */
89
- useShader(shader: any): void;
90
- /**
91
- * Refresh pass-scoped state, immediately before a draw.
92
- *
93
- * This exists because `bind()` is *not* a per-frame hook. `setBatcher`
94
- * returns early when the requested batcher is already current, so a scene
95
- * that draws nothing but meshes — no sprites, no UI, no unlit geometry to
96
- * force a switch — binds once and never again. Anything set up in `bind()`
97
- * then freezes at its first-frame value.
98
- *
99
- * The depth clear is one such thing. `renderer._meshDepthDirty` is re-armed
100
- * every time the render target changes (frame-start `clear()`, FBO
101
- * bind/unbind), but a flag nobody reads is a flag that does nothing: left in
102
- * `bind()` it would stay armed forever and the depth attachment would carry
103
- * the first frame's values for the life of the scene, occluding geometry as
104
- * the camera moved. Consuming it here runs the clear once per target, which
105
- * is what the flag always meant. {@link LitMeshBatcher} extends this with
106
- * its light data, which had the same problem.
107
- *
108
- * Cheap by construction: one boolean test per draw in the common case.
109
- * `depthMask` is guaranteed true here — `bind()` sets it and only `unbind()`
110
- * clears it, so this batcher being current implies a writable depth buffer,
111
- * without which `gl.clear(DEPTH_BUFFER_BIT)` would silently do nothing.
112
- * @ignore
113
- */
114
- updatePassState(): void;
115
- /**
116
- * Write one vertex into the buffer. The base (unlit) layout is
117
- * `x, y, z, u, v, color`. Subclasses override to append per-vertex data
118
- * matching their {@link MeshBatcher#_attributeLayout} (e.g.
119
- * {@link LitMeshBatcher} pushes the world-space normal too).
120
- * @param {object} vertexData - the batcher's vertex buffer
121
- * @param {number} x
122
- * @param {number} y
123
- * @param {number} z
124
- * @param {number} u
125
- * @param {number} v
126
- * @param {number} color - packed ARGB Uint32
127
- * @param {object} _mesh - the source mesh (unused here; for subclasses)
128
- * @param {number} _i3 - the source vertex's `index * 3` (for subclasses)
129
- * @ignore
130
- */
131
- _pushVertex(vertexData: object, x: number, y: number, z: number, u: number, v: number, color: number, _mesh: object, _i3: number): void;
132
- /**
133
- * Add a textured mesh to the batch. When the mesh has a
134
- * `vertexColors` array (multi-material OBJ + bound MTL), each
135
- * vertex's `aColor` attribute comes from that buffer instead of
136
- * the shared `tint` argument — so multi-material rendering needs
137
- * no extra draw calls per material vs single-material (large
138
- * meshes still get chunked across multiple flushes to fit the
139
- * vertex/index buffer limits — same behavior as single-material).
140
- * The runtime `tint` is applied by the shader through the `uTint`
141
- * uniform rather than being multiplied into each vertex color, so
142
- * flash / fade / team-color effects never touch vertex data.
143
- * @param {object} mesh - a Mesh object with vertices, uvs, indices, and texture properties
144
- * @param {number} tint - tint color in UINT32 (argb) format
145
- */
146
- /**
147
- * Issue the per-draw placement uniforms: where the geometry sits
148
- * (`uModelMatrix`), where the camera is (`uViewMatrix`), and the colour
149
- * it is tinted with (`uTint`).
150
- *
151
- * Keeping these as uniforms rather than baking them into vertex data is
152
- * what lets geometry be uploaded once and reused: moving, rotating,
153
- * scaling or re-tinting a mesh changes only these values.
154
- *
155
- * Each set is guarded on the uniform actually being declared, because
156
- * `GLShader.setUniform` throws on an unknown name and a custom mesh
157
- * shader need not declare all of them.
158
- * @param {Matrix3d} modelMatrix - the mesh's own placement, or identity when its vertices are already positioned
159
- * @param {number} tint - tint colour in UINT32 (argb) format
160
- * @ignore
161
- */
162
- /**
163
- * Write one mesh's model-space geometry into `out` in this batcher's
164
- * vertex layout, returning how many floats were written.
165
- *
166
- * The data deliberately carries no placement, camera or tint information
167
- * — those are uniforms — so it stays valid for the lifetime of the
168
- * geometry. Subclasses override to append their own per-vertex data.
169
- * @param {object} mesh - the mesh to read geometry from
170
- * @param {Float32Array} out - destination scratch, at least `vertexCount × vertexSize` long
171
- * @returns {number} number of floats written
172
- * @ignore
173
- */
174
- buildRetainedVertexData(mesh: object, out: Float32Array): number;
175
- /**
176
- * Get this mesh's retained geometry, building or refreshing it when the
177
- * mesh's geometry version has moved on.
178
- * @param {object} mesh - the mesh whose geometry is wanted
179
- * @returns {RetainedGeometry} up-to-date geometry for the mesh
180
- * @ignore
181
- */
182
- retainedGeometryFor(mesh: object): RetainedGeometry;
183
- /**
184
- * Draw a mesh from its retained geometry: bind the persistent buffers and
185
- * issue one indexed draw, with placement supplied entirely by uniforms.
186
- *
187
- * Unlike {@link addMesh} this accumulates nothing and never chunks — the
188
- * whole mesh is one draw call regardless of size, except for a
189
- * multi-material model whose materials carry different diffuse textures:
190
- * that draws one indexed range per entry in {@link Mesh#textureGroups}
191
- * (#1573), over the same buffers, with only the sampler moving between
192
- * them.
193
- * @param {object} mesh - the mesh to draw
194
- * @param {Matrix3d} modelMatrix - where the mesh sits in the world
195
- * @param {number} tint - tint colour in UINT32 (argb) format
196
- * @ignore
197
- */
198
- drawRetainedMesh(mesh: object, modelMatrix: Matrix3d, tint: number): void;
199
- /**
200
- * Enter the blended mesh draw state: alpha blending on, depth test still
201
- * on, depth WRITES off (#1515).
202
- *
203
- * The blend function is set explicitly rather than through
204
- * `renderer.setBlendMode`. That method short-circuits when the mode is
205
- * unchanged, and `MeshBatcher.bind()` has already disabled `GL_BLEND`
206
- * behind that cache's back — so asking for the mode the cache already
207
- * claims would leave blending off and the draw opaque. Merely calling
208
- * `setBlendEnabled(true)` is no better: it inherits whatever function the
209
- * last 2D draw left, and under `"additive"` a dark shadow would *brighten*
210
- * the ground.
211
- * @ignore
212
- */
213
- beginBlendedDraw(): void;
214
- /**
215
- * Leave the blended draw state, restoring mesh mode exactly as
216
- * {@link MeshBatcher#bind} left it.
217
- *
218
- * The blend FUNCTION is put back too, not just the enable bit. This draw
219
- * overwrote it without touching `renderer.currentBlendMode`, so a later 2D
220
- * draw asking for the mode the cache already claims would short-circuit
221
- * and silently inherit this one's function. Re-issuing through
222
- * `setBlendMode` with the cache invalidated restores both, and leaves the
223
- * cache reading exactly what it read before.
224
- * @ignore
225
- */
226
- endBlendedDraw(): void;
227
- /**
228
- * Get (building or refreshing as needed) the GPU state one instanced mesh
229
- * draws from: its retained prototype geometry, its instance buffer, and
230
- * the vertex state binding the two together.
231
- *
232
- * The vertex state is rebuilt only when a buffer object it references is
233
- * replaced — a growing instance set reallocates, a merely-edited one does
234
- * not — because a vertex array holding a deleted buffer keeps it alive per
235
- * the GL spec and silently draws stale data.
236
- * @param {InstancedMesh} mesh - the mesh to draw
237
- * @returns {object} `{geometry, instances, vertexState}`
238
- * @ignore
239
- */
240
- instancedStateFor(mesh: InstancedMesh): object;
241
- /**
242
- * The instanced shader for a given record layout, compiled on first use.
243
- *
244
- * Variants are source permutations rather than runtime branches: the
245
- * optional slots are `#ifdef`-guarded, so a mesh that declares neither
246
- * costs no unused attributes and no dead code. `minify` deliberately
247
- * preserves newlines so the directives survive it.
248
- * @param {object} layout - the instance record layout
249
- * @returns {GLShader} the shader for that combination
250
- * @ignore
251
- */
252
- instancedShaderFor(layout: object): GLShader;
253
- /**
254
- * The instanced shader sources for this batcher (unlit by default).
255
- * Subclasses override to supply the lit pair.
256
- * @ignore
257
- */
258
- _instancedShaderSources(): {
259
- vertex: any;
260
- fragment: any;
261
- };
262
- /**
263
- * Resolve an instance record layout into GL attribute records, in the
264
- * `{name, size, type, normalized, offset}` shape the vertex state wants.
265
- * Every slot is a `float32x4`.
266
- * @param {object} layout - the instance record layout
267
- * @returns {object[]} attribute records
268
- * @ignore
269
- */
270
- _instanceAttributeRecords(layout: object): object[];
271
- /**
272
- * Draw every visible instance of a mesh in one call.
273
- *
274
- * The geometry is bound once and the GPU walks the instance buffer,
275
- * advancing the per-instance attributes one record per copy. Placement of
276
- * the *group* still rides the ordinary uniforms, so moving the whole set
277
- * costs one matrix and re-uploads nothing.
278
- * @param {InstancedMesh} mesh - the mesh to draw
279
- * @param {Matrix3d} modelMatrix - where the group sits in the world
280
- * @param {number} tint - tint colour in UINT32 (argb) format
281
- * @ignore
282
- */
283
- drawInstancedMesh(mesh: InstancedMesh, modelMatrix: Matrix3d, tint: number): void;
284
- _instancedShaderWarned: boolean | undefined;
285
- /**
286
- * The instanced ground-shadow program (#1515), compiled on first use.
287
- *
288
- * ONE shader, not a variant per record layout: it reads only the three
289
- * transform rows, so `hasColor` / `hasData` make no difference to it —
290
- * which is also what stops a forest with per-instance colour and emissive
291
- * from getting coloured, glowing shadows.
292
- * @returns {GLShader} the shadow program
293
- * @ignore
294
- */
295
- instancedShadowShader(): GLShader;
296
- /**
297
- * The vertex state pairing the SHARED shadow quad's geometry with this
298
- * mesh's own instance records.
299
- *
300
- * Kept in its own slot with its own staleness fields rather than reusing
301
- * the main pass's: that one keys on `builtGeometry` and `builtShader`, and
302
- * the shadow pass differs in both, so sharing a slot would make the two
303
- * passes rebuild each other's vertex array on every single draw.
304
- *
305
- * The instance buffer itself IS shared — the main pass already uploaded
306
- * it this frame, so this adds no upload.
307
- * @param {InstancedMesh} mesh - the mesh casting the shadows
308
- * @param {object} quadGeometry - the shared shadow quad's retained geometry
309
- * @returns {object} the per-mesh instanced state, with `shadowVertexState` built
310
- * @ignore
311
- */
312
- instancedShadowStateFor(mesh: InstancedMesh, quadGeometry: object): object;
313
- /**
314
- * Draw one flat blob per instance, in a single call, from the same
315
- * instance buffer the mesh itself drew from (#1515).
316
- * @param {InstancedMesh} mesh - the mesh casting the shadows
317
- * @param {Matrix3d} shadowMatrix - the group matrix, flattened onto the ground
318
- * @param {number} tint - tint colour in UINT32 (argb) format
319
- * @param {object} quad - the shared shadow quad mesh
320
- * @ignore
321
- */
322
- drawInstancedShadow(mesh: InstancedMesh, shadowMatrix: Matrix3d, tint: number, quad: object): void;
323
- /**
324
- * Release the instance buffer and vertex state held for one mesh, if any.
325
- * @param {object} mesh - the mesh whose instance state should be freed
326
- * @ignore
327
- */
328
- releaseInstanced(mesh: object): void;
329
- /**
330
- * Release every instance buffer this batcher holds.
331
- * @ignore
332
- */
333
- releaseAllInstanced(): void;
334
- /**
335
- * Release the retained geometry held for one mesh, if any.
336
- * @param {object} mesh - the mesh whose geometry should be freed
337
- * @ignore
338
- */
339
- releaseRetained(mesh: object): void;
340
- /**
341
- * Release every retained geometry this batcher holds.
342
- * @ignore
343
- */
344
- releaseAllRetained(): void;
345
- /**
346
- * In addition to the attribute-layout check, warn once when a shader
347
- * hosted on this batcher declares none of the placement uniforms.
348
- *
349
- * Mesh geometry is now uploaded in model space, so a shader that only
350
- * declares `uProjectionMatrix` — which is what every mesh shader needed
351
- * before, and what {@link ShaderEffect} still generates — will draw the
352
- * mesh at its untransformed origin with no camera applied. That renders
353
- * as "the model vanished" rather than as an error, so say so explicitly.
354
- * @param {GLShader} shader - the shader about to be hosted
355
- * @ignore
356
- */
357
- validateShaderLocations(shader: GLShader): void;
358
- setPlacementUniforms(modelMatrix: any, tint: any): void;
359
- /**
360
- * Bind a mesh's material state: its texture (honouring the mesh's own
361
- * `textureRepeat` wrap override) and the guarded `uAlphaCutoff` /
362
- * `uEmissive` uniforms.
363
- *
364
- * Shared by the accumulated and retained draw paths so material changes
365
- * take effect immediately either way, without touching geometry.
366
- * @param {object} mesh - the mesh whose material should be applied
367
- * @param {TextureAtlas} [texture] - bind this texture instead of the mesh's
368
- * own — how a multi-material model's per-material `map_Kd` reaches the
369
- * sampler, one draw range at a time (#1573). Everything else here is a
370
- * property of the mesh, not of the material group.
371
- * @returns {number} the texture unit the material landed on
372
- * @ignore
373
- */
374
- applyMeshMaterial(mesh: object, texture?: TextureAtlas): number;
375
- /**
376
- * Point `uSampler` at a texture unit, if it moved and if the current
377
- * shader has a sampler at all — a custom mesh shader that never samples
378
- * (vertex colours only) declares none, and `setUniform` throws on an
379
- * unknown name.
380
- * @param {number} unit - the texture unit to sample from
381
- * @ignore
382
- */
383
- bindSamplerUnit(unit: number): void;
63
+ setPlacementUniforms(modelMatrix: any, tint: any, mesh: any): void;
384
64
  addMesh(mesh: any, tint: any): void;
385
- /**
386
- * Accumulate one index range of a mesh into the batch, chunking triangles
387
- * across flushes as the vertex / index buffers fill.
388
- * @param {object} mesh - a Mesh with vertices, uvs, indices, texture
389
- * @param {number} from - first index to accumulate
390
- * @param {number} length - how many indices to accumulate
391
- * @ignore
392
- */
393
- accumulateRange(mesh: object, from: number, length: number): void;
394
65
  }
395
66
  import { MaterialBatcher } from "./material_batcher.js";
396
- import GLShader from "../glshader.js";
397
67
  import RetainedGeometry from "../buffer/retained_geometry.js";
398
68
  import { Matrix3d } from "../../../math/matrix3d.ts";
69
+ import GLShader from "../glshader.js";
399
70
  //# sourceMappingURL=mesh_batcher.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mesh_batcher.d.ts","sourceRoot":"","sources":["../../../../src/video/webgl/batchers/mesh_batcher.js"],"names":[],"mappings":"AAqDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH;IACC;;;OAGG;IACH,0BAiHC;IAvGA,wBAA4B;IAI5B,sBAA0B;IAC1B,sBAA0B;IAC1B,sBAA0B;IAI1B,sBAA0B;IAC1B,sBAA0B;IAC1B,sBAA0B;IAC1B,sBAA0B;IAI1B,yBAA6B;IAC7B,wBAA4B;IAI5B,iBAA6B;IAC7B,iBAA6B;IAC7B,iBAA6B;IAQ7B,oCAAyB;IAQzB,qCAA0B;IAS1B,4CAAiC;IAQjC,mCAA6B;IAO7B,sBAAiC;IAKjC,+CAAsC;IAMtC,oBAAuE;IACvE,kCAKI;IAYH,8DAOC;IAKH;;;;;OAKG;IACH;;;;QA0BC;IAED;;;;OAIG;IACH;;;MAEC;IAED;;;;;;;;;OASG;IACH,6BAcC;IAgED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,wBAOC;IAcD;;;;;;;;;;;;;;;OAeG;IACH,wBAXW,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,SACN,MAAM,SACN,MAAM,OACN,MAAM,QAKhB;IAED;;;;;;;;;;;;;OAaG;IACH;;;;;;;;;;;;;;;OAeG;IACH;;;;;;;;;;;OAWG;IACH,8BALW,MAAM,OACN,YAAY,GACV,MAAM,CAMlB;IAED;;;;;;OAMG;IACH,0BAJW,MAAM,GACJ,gBAAgB,CAuB5B;IAED;;;;;;;;;;;;;;OAcG;IACH,uBALW,MAAM,eACN,QAAQ,QACR,MAAM,QAgFhB;IAED;;;;;;;;;;;;;OAaG;IACH,yBAYC;IAED;;;;;;;;;;;OAWG;IACH,uBAWC;IAED;;;;;;;;;;;;OAYG;IACH,wBAJW,aAAa,GACX,MAAM,CAqFlB;IAED;;;;;;;;;;OAUG;IACH,2BAJW,MAAM,GACJ,QAAQ,CAuBpB;IAED;;;;OAIG;IACH;;;MAEC;IAED;;;;;;;OAOG;IACH,kCAJW,MAAM,GACJ,MAAM,EAAE,CAcpB;IAED;;;;;;;;;;;OAWG;IACH,wBALW,aAAa,eACb,QAAQ,QACR,MAAM,QA2EhB;IAlDC,4CAAkC;IAoDpC;;;;;;;;;OASG;IACH,yBAHa,QAAQ,CAqBpB;IAED;;;;;;;;;;;;;;;OAeG;IACH,8BALW,aAAa,gBACb,MAAM,GACJ,MAAM,CAmElB;IAED;;;;;;;;OAQG;IACH,0BANW,aAAa,gBACb,QAAQ,QACR,MAAM,QACN,MAAM,QA+BhB;IAED;;;;OAIG;IACH,uBAHW,MAAM,QAWhB;IAED;;;OAGG;IACH,4BAOC;IAED;;;;OAIG;IACH,sBAHW,MAAM,QAUhB;IAED;;;OAGG;IACH,2BAMC;IAED;;;;;;;;;;;OAWG;IACH,gCAHW,QAAQ,QAqBlB;IAED,wDA6CC;IAED;;;;;;;;;;;;;;OAcG;IACH,wBARW,MAAM,YACN,YAAY,GAIV,MAAM,CAyKlB;IAED;;;;;;;OAOG;IACH,sBAHW,MAAM,QAWhB;IAED,oCAyBC;IAED;;;;;;;OAOG;IACH,sBALW,MAAM,QACN,MAAM,UACN,MAAM,QAqFhB;CACD;gCA56C+B,uBAAuB;qBANlC,gBAAgB;6BAFR,gCAAgC;yBAXpC,2BAA2B"}
1
+ {"version":3,"file":"mesh_batcher.d.ts","sourceRoot":"","sources":["../../../../src/video/webgl/batchers/mesh_batcher.js"],"names":[],"mappings":"AA0EA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH;IACC;;;;OAIG;IACH,0BAuHC;IA7GA,wBAA4B;IAI5B,sBAA0B;IAC1B,sBAA0B;IAC1B,sBAA0B;IAI1B,sBAA0B;IAC1B,sBAA0B;IAC1B,sBAA0B;IAC1B,sBAA0B;IAI1B,yBAA6B;IAC7B,wBAA4B;IAI5B,iBAA6B;IAC7B,iBAA6B;IAC7B,iBAA6B;IAI7B,oBAAgC;IAChC,oBAAgC;IAChC,wBAAoC;IACpC,uBAAmC;IACnC,iBAA6B;IAC7B,iBAA6B;IAC7B,iBAA6B;IAC7B,qBAAiC;IACjC,qBAAiC;IACjC,qBAAiC;IACjC,oBAAgC;IAQhC,oCAAyB;IAQzB,qCAA0B;IAS1B,0CAA+B;IAO/B,sBAAiC;IAKjC,+CAAsC;IAMtC,oBAAuE;IACvE,kCAKI;IAYH,8DAOC;IAKH;;;;;;OAMG;IACH;;;;QA0BC;IAED;;;;;OAKG;IACH;;;MAEC;IAED;;;;;;;;;;OAUG;IACH,6BA2CC;IAgED;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,wBAOC;IAcD;;;;;;;;;;;;;;;;OAgBG;IACH,wBAZW,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,SACN,MAAM,SACN,MAAM,OACN,MAAM,QAMhB;IAED;;;;;;;;;;;;;OAaG;IACH;;;;;;;;;;;;;;;;OAgBG;IACH;;;;;;;;;;;;OAYG;IACH,8BANW,MAAM,OACN,YAAY,GACV,MAAM,CAOlB;IAED;;;;;;;OAOG;IACH,0BALW,MAAM,GACJ,gBAAgB,CAwB5B;IAED;;;;;;;;;;;;;;;OAeG;IACH,uBANW,MAAM,eACN,QAAQ,QACR,MAAM,QA8EhB;IAED;;;;;;;;;;;;;;OAcG;IACH,sCASC;IAED;;;;;;;;;;;;OAYG;IACH,uBAWC;IAED;;;;;;;;;;;;;OAaG;IACH,wBALW,aAAa,GACX,MAAM,CAsFlB;IAED;;;;;;;;;;;OAWG;IACH,2BALW,MAAM,GACJ,QAAQ,CA2BpB;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,wBALW,MAAM,GACJ,QAAQ,CAwCpB;IAPE,8CAAoC;IASvC;;;;;;;;;;;;OAYG;IACH,6BALW,MAAM,UACN,QAAQ,QAUlB;IAED;;;;;;OAMG;IACH,sBALW,MAAM,GACJ,OAAO,CA8BnB;IANC,8CAAoC;IAQtC;;;;;;;;;;;OAWG;IACH,mCAIC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,mBATW,MAAM,WACN,MAAM,iBACN,MAAM,mBACN,MAAM,GAEJ,QAAQ,CAepB;IAED;;;;;;;;;;;OAWG;IACH,sBAJa,OAAO,CASnB;IAED;;;;;OAKG;IACH,mCAWC;IAED;;;;;OAKG;IACH;;;MAEC;IAED;;;;;;;;OAQG;IACH,kCALW,MAAM,GACJ,MAAM,EAAE,CAepB;IAED;;;;;;;;;;;;OAYG;IACH,wBANW,aAAa,eACb,QAAQ,QACR,MAAM,QA2FhB;IAjEC,4CAAkC;IAmEpC;;;;;;;;;;OAUG;IACH,yBAJa,QAAQ,CAoBpB;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,8BANW,aAAa,gBACb,MAAM,GACJ,MAAM,CAoElB;IAED;;;;;;;;;OASG;IACH,0BAPW,aAAa,gBACb,QAAQ,QACR,MAAM,QACN,MAAM,QAgChB;IAED;;;;;OAKG;IACH,uBAJW,MAAM,QAYhB;IAED;;;;OAIG;IACH,4BAOC;IAED;;;;;OAKG;IACH,sBAJW,MAAM,QAWhB;IAED;;;;OAIG;IACH,2BAMC;IAED;;;;;;;;;;;;OAYG;IACH,gCAJW,QAAQ,QAsBlB;IAED,mEAmIC;IAED;;;;;;;;;;;;;;;OAeG;IACH,wBATW,MAAM,YACN,YAAY,GAIV,MAAM,CA0KlB;IAED;;;;;;;;OAQG;IACH,sBAJW,MAAM,QAYhB;IAED,oCA0BC;IAED;;;;;;;;OAQG;IACH,sBANW,MAAM,QACN,MAAM,UACN,MAAM,QAsFhB;CACD;gCAryD+B,uBAAuB;6BAR1B,gCAAgC;yBAhBpC,2BAA2B;qBAkB/B,gBAAgB"}
@@ -8,16 +8,6 @@
8
8
  * @category Rendering
9
9
  */
10
10
  export default class PrimitiveBatcher extends WebGLBatcher {
11
- /**
12
- * Initialize the compositor
13
- * @ignore
14
- */
15
- init(renderer: any): void;
16
- /**
17
- * the current line width applied to the shader uniform
18
- * @ignore
19
- */
20
- currentLineWidth: any;
21
11
  /**
22
12
  * Draw an array of vertices
23
13
  * @param {GLenum} mode - primitive type to render (gl.POINTS, gl.LINE_STRIP, gl.LINE_LOOP, gl.LINES, gl.TRIANGLE_STRIP, gl.TRIANGLE_FAN, gl.TRIANGLES)
@@ -1 +1 @@
1
- {"version":3,"file":"primitive_batcher.d.ts","sourceRoot":"","sources":["../../../../src/video/webgl/batchers/primitive_batcher.js"],"names":[],"mappings":"AASA;;;GAGG;AAEH;;;;GAIG;AACH;IACC;;;OAGG;IACH,0BAgCC;IALA;;;OAGG;IACH,sBAAyB;IA0B1B;;;;;OAKG;IACH,mBAJW,MAAM,SACN,KAAK,EAAE,gBACP,MAAM,QA2DhB;;CA8HD;6BAvQ4B,cAAc;2BAInB,gCAAgC"}
1
+ {"version":3,"file":"primitive_batcher.d.ts","sourceRoot":"","sources":["../../../../src/video/webgl/batchers/primitive_batcher.js"],"names":[],"mappings":"AASA;;;GAGG;AAEH;;;;GAIG;AACH;IACC;;;;OAIG;IACH,0BAiCC;IANA;;;;OAIG;IACH,sBAAyB;IA2B1B;;;;;OAKG;IACH,mBAJW,MAAM,SACN,KAAK,EAAE,gBACP,MAAM,QA2DhB;;CAiID;6BA7Q4B,cAAc;2BAInB,gCAAgC"}
@@ -8,36 +8,6 @@
8
8
  * @category Rendering
9
9
  */
10
10
  export default class QuadBatcher extends MaterialBatcher {
11
- /**
12
- * Initialize the compositor
13
- * @ignore
14
- */
15
- init(renderer: any): void;
16
- /**
17
- * the maximum number of texture units used for multi-texture batching
18
- * @type {number}
19
- * @ignore
20
- */
21
- maxBatchTextures: number | undefined;
22
- /**
23
- * whether multi-texture batching is currently active
24
- * (disabled when a custom ShaderEffect is applied)
25
- * @type {boolean}
26
- * @ignore
27
- */
28
- useMultiTexture: boolean | undefined;
29
- /**
30
- * (Re-)create the index buffer for quad batching (4 verts + 6 indices per quad).
31
- * Called from `init` and `reset` (after context loss).
32
- * @ignore
33
- */
34
- createIndexBuffer(): void;
35
- /**
36
- * Bind the color sampler uniforms (`uSampler0..uSamplerN-1`) to their
37
- * respective texture units. Called from `init` and `reset`.
38
- * @ignore
39
- */
40
- bindColorSamplers(): void;
41
11
  /**
42
12
  * Select the shader to use for compositing.
43
13
  * Multi-texture batching is automatically enabled when the default
@@ -1 +1 @@
1
- {"version":3,"file":"quad_batcher.d.ts","sourceRoot":"","sources":["../../../../src/video/webgl/batchers/quad_batcher.js"],"names":[],"mappings":"AAOA;;;GAGG;AAEH;;;;GAIG;AACH;IACC;;;OAGG;IACH,0BAuDC;IAtDA;;;;OAIG;IAMH,qCAA4C;IAmC5C;;;;;OAKG;IACH,qCAA2B;IAK5B;;;;OAIG;IACH,0BAmBC;IAED;;;;OAIG;IACH,0BAIC;IAED;;;;;;;OAOG;IACH,kBAFW,QAAQ,GAAC,YAAY,QAK/B;IAwDD;;;;;;;;;;OAUG;IACH,oBAPW,YAAY,KACZ,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,UACN,QAAQ,GAAC,YAAY,QAoE/B;IAED;;;;;;;;;;;;;OAaG;IACH,iBAZW,YAAY,KACZ,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,QACN,MAAM,aACN,OAAO,QAuEjB;CACD;gCArV+B,uBAAuB;kCAIxB,0BAA0B"}
1
+ {"version":3,"file":"quad_batcher.d.ts","sourceRoot":"","sources":["../../../../src/video/webgl/batchers/quad_batcher.js"],"names":[],"mappings":"AAOA;;;GAGG;AAEH;;;;GAIG;AACH;IACC;;;;OAIG;IACH,0BAyDC;IAxDA;;;;;OAKG;IAMH,qCAA4C;IAmC5C;;;;;;OAMG;IACH,qCAA2B;IAK5B;;;;;OAKG;IACH,0BAmBC;IAED;;;;;OAKG;IACH,0BAIC;IAED;;;;;;;OAOG;IACH,kBAFW,QAAQ,GAAC,YAAY,QAK/B;IAyDD;;;;;;;;;;OAUG;IACH,oBAPW,YAAY,KACZ,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,UACN,QAAQ,GAAC,YAAY,QAoE/B;IAED;;;;;;;;;;;;;OAaG;IACH,iBAZW,YAAY,KACZ,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,QACN,MAAM,aACN,OAAO,QAuEjB;CACD;gCA3V+B,uBAAuB;kCAIxB,0BAA0B"}
@@ -1,38 +1,3 @@
1
- /**
2
- * A WebGL Index Buffer — extends {@link IndexBuffer} with GL buffer binding and upload.
3
- * @ignore
4
- */
5
- export default class WebGLIndexBuffer extends IndexBuffer {
6
- /**
7
- * @param {WebGLRenderingContext|WebGL2RenderingContext} gl - the WebGL context
8
- * @param {number} maxIndices - maximum number of indices this buffer can hold
9
- * @param {boolean} [useUint32=false] - use Uint32 indices instead of Uint16 (a capacity knob — Uint16 keeps index uploads half the size)
10
- */
11
- constructor(gl: WebGLRenderingContext | WebGL2RenderingContext, maxIndices: number, useUint32?: boolean);
12
- gl: WebGLRenderingContext | WebGL2RenderingContext;
13
- type: 5123 | 5125;
14
- buffer: WebGLBuffer;
15
- /**
16
- * Upload the current index data to the GPU (for dynamic buffers)
17
- */
18
- upload(): void;
19
- /**
20
- * Bind this index buffer
21
- */
22
- bind(): void;
23
- /**
24
- * Replace the underlying GL buffer with a fresh one, deleting the old.
25
- * Needed on context restore — the old buffer object belongs to the lost
26
- * context and every upload through it would silently fail. Also keeps
27
- * plain resets leak-free (`deleteBuffer` on a lost-context object is a
28
- * harmless no-op).
29
- */
30
- recreate(): void;
31
- /**
32
- * Delete the underlying GL buffer. The index buffer must not be used
33
- * after calling destroy.
34
- */
35
- destroy(): void;
36
- }
1
+
37
2
  import IndexBuffer from "../../buffer/index.js";
38
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/video/webgl/buffer/index.js"],"names":[],"mappings":"AAEA;;;GAGG;AAEH;IACC;;;;OAIG;IACH,gBAJW,qBAAqB,GAAC,sBAAsB,cAC5C,MAAM,cACN,OAAO,EAOjB;IAHA,mDAAY;IACZ,kBAA2D;IAC3D,oBAA+B;IAiBhC;;OAEG;IACH,eAOC;IAED;;OAEG;IACH,aAEC;IAED;;;;;;OAMG;IACH,iBAIC;IAED;;;OAGG;IACH,gBAGC;CACD;wBA1EuB,uBAAuB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/video/webgl/buffer/index.js"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH;IACC;;;;OAIG;IACH,gBAJW,qBAAqB,GAAC,sBAAsB,cAC5C,MAAM,cACN,OAAO,EAOjB;IAHA,mDAAY;IACZ,kBAA2D;IAC3D,oBAA+B;IAiBhC;;OAEG;IACH,eAOC;IAED;;OAEG;IACH,aAEC;IAED;;;;;;OAMG;IACH,iBAIC;IAED;;;OAGG;IACH,gBAGC;CACD;wBA3EuB,uBAAuB"}
@@ -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