melonjs 19.9.1 → 20.0.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 (274) hide show
  1. package/README.md +25 -14
  2. package/build/application/application.d.ts +70 -16
  3. package/build/application/application.d.ts.map +1 -1
  4. package/build/application/defaultApplicationSettings.d.ts +2 -2
  5. package/build/application/settings.d.ts +150 -53
  6. package/build/application/settings.d.ts.map +1 -1
  7. package/build/camera/camera2d.d.ts +1 -1
  8. package/build/camera/camera2d.d.ts.map +1 -1
  9. package/build/camera/camera3d.d.ts +13 -11
  10. package/build/camera/camera3d.d.ts.map +1 -1
  11. package/build/const.d.ts +55 -26
  12. package/build/const.d.ts.map +1 -1
  13. package/build/geometries/box3d.d.ts +156 -0
  14. package/build/geometries/box3d.d.ts.map +1 -0
  15. package/build/index.d.ts +33 -23
  16. package/build/index.d.ts.map +1 -1
  17. package/build/index.js +21839 -8025
  18. package/build/index.js.map +4 -4
  19. package/build/lang/deprecated.d.ts +4 -4
  20. package/build/lang/deprecated.d.ts.map +1 -1
  21. package/build/level/gltf/GLTFModel.d.ts +4 -0
  22. package/build/level/gltf/GLTFModel.d.ts.map +1 -1
  23. package/build/level/gltf/GLTFScene.d.ts +42 -6
  24. package/build/level/gltf/GLTFScene.d.ts.map +1 -1
  25. package/build/level/gltf/srgb.d.ts +20 -0
  26. package/build/level/gltf/srgb.d.ts.map +1 -0
  27. package/build/level/level.d.ts +21 -2
  28. package/build/level/level.d.ts.map +1 -1
  29. package/build/lighting/light3d.d.ts +61 -13
  30. package/build/lighting/light3d.d.ts.map +1 -1
  31. package/build/loader/loader.d.ts +49 -21
  32. package/build/loader/loader.d.ts.map +1 -1
  33. package/build/loader/parsers/gltf.d.ts.map +1 -1
  34. package/build/loader/parsers/mtl.d.ts +18 -0
  35. package/build/loader/parsers/mtl.d.ts.map +1 -1
  36. package/build/loader/parsers/obj.d.ts +49 -0
  37. package/build/loader/parsers/obj.d.ts.map +1 -1
  38. package/build/loader/parsers/pbr.d.ts +63 -0
  39. package/build/loader/parsers/pbr.d.ts.map +1 -0
  40. package/build/loader/parsers/shader.d.ts +32 -24
  41. package/build/loader/parsers/shader.d.ts.map +1 -1
  42. package/build/physics/adapter.d.ts +12 -1
  43. package/build/physics/adapter.d.ts.map +1 -1
  44. package/build/physics/broadphase/octree.d.ts +35 -0
  45. package/build/physics/broadphase/octree.d.ts.map +1 -1
  46. package/build/physics/builtin/body.d.ts +123 -6
  47. package/build/physics/builtin/body.d.ts.map +1 -1
  48. package/build/physics/builtin/builtin-adapter.d.ts.map +1 -1
  49. package/build/physics/builtin/detector.d.ts +12 -0
  50. package/build/physics/builtin/detector.d.ts.map +1 -1
  51. package/build/physics/builtin/raycast.d.ts.map +1 -1
  52. package/build/physics/builtin/sat3d.d.ts +59 -0
  53. package/build/physics/builtin/sat3d.d.ts.map +1 -0
  54. package/build/physics/response.d.ts +32 -0
  55. package/build/physics/response.d.ts.map +1 -1
  56. package/build/physics/world.d.ts +1 -0
  57. package/build/physics/world.d.ts.map +1 -1
  58. package/build/renderable/container.d.ts +1 -0
  59. package/build/renderable/container.d.ts.map +1 -1
  60. package/build/renderable/groundshadow.d.ts +92 -0
  61. package/build/renderable/groundshadow.d.ts.map +1 -0
  62. package/build/renderable/instanced_mesh.d.ts +286 -0
  63. package/build/renderable/instanced_mesh.d.ts.map +1 -0
  64. package/build/renderable/mesh.d.ts +242 -23
  65. package/build/renderable/mesh.d.ts.map +1 -1
  66. package/build/renderable/renderable.d.ts +6 -4
  67. package/build/renderable/renderable.d.ts.map +1 -1
  68. package/build/renderable/sprite3d.d.ts +17 -6
  69. package/build/renderable/sprite3d.d.ts.map +1 -1
  70. package/build/renderable/text/text.d.ts.map +1 -1
  71. package/build/system/device.d.ts +11 -40
  72. package/build/system/device.d.ts.map +1 -1
  73. package/build/system/platform.d.ts +0 -16
  74. package/build/system/platform.d.ts.map +1 -1
  75. package/build/utils/utils.d.ts +2 -0
  76. package/build/utils/utils.d.ts.map +1 -1
  77. package/build/video/canvas/canvas_renderer.d.ts +22 -16
  78. package/build/video/canvas/canvas_renderer.d.ts.map +1 -1
  79. package/build/video/{webgl/effects → effects}/blur.d.ts +2 -2
  80. package/build/video/effects/blur.d.ts.map +1 -0
  81. package/build/video/{webgl/effects → effects}/chromaticAberration.d.ts +2 -2
  82. package/build/video/effects/chromaticAberration.d.ts.map +1 -0
  83. package/build/video/{webgl/effects → effects}/colorMatrix.d.ts +3 -3
  84. package/build/video/effects/colorMatrix.d.ts.map +1 -0
  85. package/build/video/{webgl/effects → effects}/desaturate.d.ts +1 -1
  86. package/build/video/effects/desaturate.d.ts.map +1 -0
  87. package/build/video/{webgl/effects → effects}/dissolve.d.ts +2 -2
  88. package/build/video/effects/dissolve.d.ts.map +1 -0
  89. package/build/video/{webgl/effects → effects}/dropShadow.d.ts +2 -2
  90. package/build/video/effects/dropShadow.d.ts.map +1 -0
  91. package/build/video/{webgl/effects → effects}/flash.d.ts +2 -2
  92. package/build/video/effects/flash.d.ts.map +1 -0
  93. package/build/video/{webgl/effects → effects}/glow.d.ts +2 -2
  94. package/build/video/effects/glow.d.ts.map +1 -0
  95. package/build/video/effects/glsl_realization.d.ts +18 -0
  96. package/build/video/effects/glsl_realization.d.ts.map +1 -0
  97. package/build/video/{webgl/effects → effects}/hologram.d.ts +2 -2
  98. package/build/video/effects/hologram.d.ts.map +1 -0
  99. package/build/video/{webgl/effects → effects}/invert.d.ts +1 -1
  100. package/build/video/effects/invert.d.ts.map +1 -0
  101. package/build/video/{webgl/effects → effects}/outline.d.ts +2 -2
  102. package/build/video/effects/outline.d.ts.map +1 -0
  103. package/build/video/{webgl/effects → effects}/pixelate.d.ts +2 -2
  104. package/build/video/effects/pixelate.d.ts.map +1 -0
  105. package/build/video/{webgl/effects → effects}/radialGradient.d.ts +3 -4
  106. package/build/video/effects/radialGradient.d.ts.map +1 -0
  107. package/build/video/{webgl/effects → effects}/scanline.d.ts +2 -2
  108. package/build/video/effects/scanline.d.ts.map +1 -0
  109. package/build/video/{webgl/effects → effects}/sepia.d.ts +1 -1
  110. package/build/video/effects/sepia.d.ts.map +1 -0
  111. package/build/video/{webgl → effects}/shadereffect.d.ts +133 -25
  112. package/build/video/effects/shadereffect.d.ts.map +1 -0
  113. package/build/video/{webgl/effects → effects}/shine.d.ts +2 -2
  114. package/build/video/effects/shine.d.ts.map +1 -0
  115. package/build/video/{webgl/effects → effects}/tintPulse.d.ts +2 -2
  116. package/build/video/effects/tintPulse.d.ts.map +1 -0
  117. package/build/video/{webgl/effects → effects}/vignette.d.ts +2 -2
  118. package/build/video/effects/vignette.d.ts.map +1 -0
  119. package/build/video/{webgl/effects → effects}/wave.d.ts +2 -2
  120. package/build/video/effects/wave.d.ts.map +1 -0
  121. package/build/video/effects/wgsl/layout.d.ts +28 -0
  122. package/build/video/effects/wgsl/layout.d.ts.map +1 -0
  123. package/build/video/effects/wgsl/parse.d.ts +9 -0
  124. package/build/video/effects/wgsl/parse.d.ts.map +1 -0
  125. package/build/video/effects/wgsl/scaffold.d.ts +43 -0
  126. package/build/video/effects/wgsl/scaffold.d.ts.map +1 -0
  127. package/build/video/effects/wgsl_realization.d.ts +83 -0
  128. package/build/video/effects/wgsl_realization.d.ts.map +1 -0
  129. package/build/video/gpu/batcher.d.ts +71 -0
  130. package/build/video/gpu/batcher.d.ts.map +1 -0
  131. package/build/video/gpu/instancerecord.d.ts +164 -0
  132. package/build/video/gpu/instancerecord.d.ts.map +1 -0
  133. package/build/video/gpu/meshchunk.d.ts +49 -0
  134. package/build/video/gpu/meshchunk.d.ts.map +1 -0
  135. package/build/video/gpu/meshvertex.d.ts +54 -0
  136. package/build/video/gpu/meshvertex.d.ts.map +1 -0
  137. package/build/video/gpu/primitives.d.ts +60 -0
  138. package/build/video/gpu/primitives.d.ts.map +1 -0
  139. package/build/video/gpu/quadcorners.d.ts +11 -0
  140. package/build/video/gpu/quadcorners.d.ts.map +1 -0
  141. package/build/video/gpu/textureslots.d.ts +122 -0
  142. package/build/video/gpu/textureslots.d.ts.map +1 -0
  143. package/build/video/gpu/texturestore.d.ts +139 -0
  144. package/build/video/gpu/texturestore.d.ts.map +1 -0
  145. package/build/video/gpu/topology.d.ts +43 -0
  146. package/build/video/gpu/topology.d.ts.map +1 -0
  147. package/build/video/gpu/vertexformat.d.ts +72 -0
  148. package/build/video/gpu/vertexformat.d.ts.map +1 -0
  149. package/build/video/gradient.d.ts +14 -5
  150. package/build/video/gradient.d.ts.map +1 -1
  151. package/build/video/renderer.d.ts +153 -8
  152. package/build/video/renderer.d.ts.map +1 -1
  153. package/build/video/rendertarget/canvasrendertarget.d.ts +7 -6
  154. package/build/video/rendertarget/canvasrendertarget.d.ts.map +1 -1
  155. package/build/video/rendertarget/render_target_pool.d.ts +2 -2
  156. package/build/video/rendertarget/render_target_pool.d.ts.map +1 -1
  157. package/build/video/rendertarget/webglrendertarget.d.ts +38 -2
  158. package/build/video/rendertarget/webglrendertarget.d.ts.map +1 -1
  159. package/build/video/rendertarget/webgpurendertarget.d.ts +83 -0
  160. package/build/video/rendertarget/webgpurendertarget.d.ts.map +1 -0
  161. package/build/video/texture/atlas.d.ts.map +1 -1
  162. package/build/video/texture/cache.d.ts +20 -2
  163. package/build/video/texture/cache.d.ts.map +1 -1
  164. package/build/video/texture/noise_texture2d.d.ts +2 -2
  165. package/build/video/utils/autodetect.d.ts.map +1 -1
  166. package/build/video/video.d.ts +1 -55
  167. package/build/video/video.d.ts.map +1 -1
  168. package/build/video/webgl/batchers/batcher.d.ts +132 -35
  169. package/build/video/webgl/batchers/batcher.d.ts.map +1 -1
  170. package/build/video/webgl/batchers/lit_mesh_batcher.d.ts +14 -0
  171. package/build/video/webgl/batchers/lit_mesh_batcher.d.ts.map +1 -1
  172. package/build/video/webgl/batchers/lit_quad_batcher.d.ts +63 -36
  173. package/build/video/webgl/batchers/lit_quad_batcher.d.ts.map +1 -1
  174. package/build/video/webgl/batchers/material_batcher.d.ts +29 -20
  175. package/build/video/webgl/batchers/material_batcher.d.ts.map +1 -1
  176. package/build/video/webgl/batchers/mesh_batcher.d.ts +308 -14
  177. package/build/video/webgl/batchers/mesh_batcher.d.ts.map +1 -1
  178. package/build/video/webgl/batchers/primitive_batcher.d.ts +2 -2
  179. package/build/video/webgl/batchers/primitive_batcher.d.ts.map +1 -1
  180. package/build/video/webgl/batchers/quad_batcher.d.ts +0 -2
  181. package/build/video/webgl/batchers/quad_batcher.d.ts.map +1 -1
  182. package/build/video/webgl/buffer/index.d.ts +1 -1
  183. package/build/video/webgl/buffer/instance_buffer.d.ts +54 -0
  184. package/build/video/webgl/buffer/instance_buffer.d.ts.map +1 -0
  185. package/build/video/webgl/buffer/retained_geometry.d.ts +83 -0
  186. package/build/video/webgl/buffer/retained_geometry.d.ts.map +1 -0
  187. package/build/video/webgl/buffer/uniformblock.d.ts +81 -0
  188. package/build/video/webgl/buffer/uniformblock.d.ts.map +1 -0
  189. package/build/video/webgl/buffer/vertexstate.d.ts +101 -0
  190. package/build/video/webgl/buffer/vertexstate.d.ts.map +1 -0
  191. package/build/video/webgl/glshader.d.ts +101 -8
  192. package/build/video/webgl/glshader.d.ts.map +1 -1
  193. package/build/video/webgl/lighting/constants.d.ts +20 -8
  194. package/build/video/webgl/lighting/constants.d.ts.map +1 -1
  195. package/build/video/webgl/lighting/pack.d.ts +1 -1
  196. package/build/video/webgl/lighting/pack3d.d.ts +27 -11
  197. package/build/video/webgl/lighting/pack3d.d.ts.map +1 -1
  198. package/build/video/webgl/lighting/std140.d.ts +110 -0
  199. package/build/video/webgl/lighting/std140.d.ts.map +1 -0
  200. package/build/video/webgl/shaders/multitexture-lit.d.ts +7 -3
  201. package/build/video/webgl/shaders/multitexture-lit.d.ts.map +1 -1
  202. package/build/video/webgl/texture/store.d.ts +52 -0
  203. package/build/video/webgl/texture/store.d.ts.map +1 -0
  204. package/build/video/webgl/utils/maxtextures.d.ts +37 -0
  205. package/build/video/webgl/utils/maxtextures.d.ts.map +1 -0
  206. package/build/video/webgl/utils/samplercache.d.ts +69 -0
  207. package/build/video/webgl/utils/samplercache.d.ts.map +1 -0
  208. package/build/video/webgl/utils/string.d.ts +16 -0
  209. package/build/video/webgl/utils/string.d.ts.map +1 -1
  210. package/build/video/webgl/utils/topology.d.ts +24 -0
  211. package/build/video/webgl/utils/topology.d.ts.map +1 -0
  212. package/build/video/webgl/utils/vertexformat.d.ts +27 -0
  213. package/build/video/webgl/utils/vertexformat.d.ts.map +1 -0
  214. package/build/video/webgl/webgl_renderer.d.ts +148 -30
  215. package/build/video/webgl/webgl_renderer.d.ts.map +1 -1
  216. package/build/video/webgpu/batchers/lit_mesh_batcher.d.ts +40 -0
  217. package/build/video/webgpu/batchers/lit_mesh_batcher.d.ts.map +1 -0
  218. package/build/video/webgpu/batchers/lit_quad_batcher.d.ts +82 -0
  219. package/build/video/webgpu/batchers/lit_quad_batcher.d.ts.map +1 -0
  220. package/build/video/webgpu/batchers/mesh_batcher.d.ts +301 -0
  221. package/build/video/webgpu/batchers/mesh_batcher.d.ts.map +1 -0
  222. package/build/video/webgpu/batchers/primitive_batcher.d.ts +39 -0
  223. package/build/video/webgpu/batchers/primitive_batcher.d.ts.map +1 -0
  224. package/build/video/webgpu/batchers/quad_batcher.d.ts +143 -0
  225. package/build/video/webgpu/batchers/quad_batcher.d.ts.map +1 -0
  226. package/build/video/webgpu/batchers/webgpu_batcher.d.ts +70 -0
  227. package/build/video/webgpu/batchers/webgpu_batcher.d.ts.map +1 -0
  228. package/build/video/webgpu/buffer/arena.d.ts +64 -0
  229. package/build/video/webgpu/buffer/arena.d.ts.map +1 -0
  230. package/build/video/webgpu/buffer/instance_buffer.d.ts +65 -0
  231. package/build/video/webgpu/buffer/instance_buffer.d.ts.map +1 -0
  232. package/build/video/webgpu/buffer/retained_geometry.d.ts +55 -0
  233. package/build/video/webgpu/buffer/retained_geometry.d.ts.map +1 -0
  234. package/build/video/webgpu/buffer/uniformring.d.ts +68 -0
  235. package/build/video/webgpu/buffer/uniformring.d.ts.map +1 -0
  236. package/build/video/webgpu/effect_binding.d.ts +17 -0
  237. package/build/video/webgpu/effect_binding.d.ts.map +1 -0
  238. package/build/video/webgpu/pipeline/bindgroups.d.ts +36 -0
  239. package/build/video/webgpu/pipeline/bindgroups.d.ts.map +1 -0
  240. package/build/video/webgpu/pipeline/cache.d.ts +173 -0
  241. package/build/video/webgpu/pipeline/cache.d.ts.map +1 -0
  242. package/build/video/webgpu/renderers/tmxlayer/orthogonal.d.ts +90 -0
  243. package/build/video/webgpu/renderers/tmxlayer/orthogonal.d.ts.map +1 -0
  244. package/build/video/webgpu/shaders/mesh-instanced.d.ts +60 -0
  245. package/build/video/webgpu/shaders/mesh-instanced.d.ts.map +1 -0
  246. package/build/video/webgpu/texture/compressed.d.ts +33 -0
  247. package/build/video/webgpu/texture/compressed.d.ts.map +1 -0
  248. package/build/video/webgpu/texture/frametexture.d.ts +65 -0
  249. package/build/video/webgpu/texture/frametexture.d.ts.map +1 -0
  250. package/build/video/webgpu/texture/store.d.ts +149 -0
  251. package/build/video/webgpu/texture/store.d.ts.map +1 -0
  252. package/build/video/webgpu/webgpu_renderer.d.ts +536 -0
  253. package/build/video/webgpu/webgpu_renderer.d.ts.map +1 -0
  254. package/package.json +2 -2
  255. package/build/video/webgl/effects/blur.d.ts.map +0 -1
  256. package/build/video/webgl/effects/chromaticAberration.d.ts.map +0 -1
  257. package/build/video/webgl/effects/colorMatrix.d.ts.map +0 -1
  258. package/build/video/webgl/effects/desaturate.d.ts.map +0 -1
  259. package/build/video/webgl/effects/dissolve.d.ts.map +0 -1
  260. package/build/video/webgl/effects/dropShadow.d.ts.map +0 -1
  261. package/build/video/webgl/effects/flash.d.ts.map +0 -1
  262. package/build/video/webgl/effects/glow.d.ts.map +0 -1
  263. package/build/video/webgl/effects/hologram.d.ts.map +0 -1
  264. package/build/video/webgl/effects/invert.d.ts.map +0 -1
  265. package/build/video/webgl/effects/outline.d.ts.map +0 -1
  266. package/build/video/webgl/effects/pixelate.d.ts.map +0 -1
  267. package/build/video/webgl/effects/radialGradient.d.ts.map +0 -1
  268. package/build/video/webgl/effects/scanline.d.ts.map +0 -1
  269. package/build/video/webgl/effects/sepia.d.ts.map +0 -1
  270. package/build/video/webgl/effects/shine.d.ts.map +0 -1
  271. package/build/video/webgl/effects/tintPulse.d.ts.map +0 -1
  272. package/build/video/webgl/effects/vignette.d.ts.map +0 -1
  273. package/build/video/webgl/effects/wave.d.ts.map +0 -1
  274. package/build/video/webgl/shadereffect.d.ts.map +0 -1
@@ -104,11 +104,75 @@ declare class Renderer {
104
104
  */
105
105
  path2D: Path2D;
106
106
  /**
107
- * The renderer type : Canvas, WebGL, etc...
108
- * (override this property with a specific value when implementing a custom renderer)
107
+ * The renderer backend identity — the built-in renderers report
108
+ * `"CANVAS"`, `"WebGL2"` and `"WebGPU"`. Use it for identity
109
+ * checks (code coupled to one backend's machinery); prefer the
110
+ * capability flags (`shaderLanguage`, `supportsDepthBuffer`,
111
+ * `supportsRetainedMesh`, `supportsShaderTileLayers`) when the
112
+ * requirement is a capability rather than a specific backend.
113
+ * (override this property with a specific value when implementing
114
+ * a custom renderer)
109
115
  * @type {string}
110
116
  */
111
117
  type: string;
118
+ /**
119
+ * The {@link Application} this renderer belongs to, set by
120
+ * `Application.init()` — engine code holding a renderer reference
121
+ * must use this rather than the global game instance.
122
+ * @type {Application|undefined}
123
+ */
124
+ parentApplication: Application | undefined;
125
+ /**
126
+ * Whether this renderer backend can draw TMX tile layers through a
127
+ * GPU shader path (see the `gpuTilemap` application setting).
128
+ * `false` here on the base/Canvas renderer; GPU backends flip it.
129
+ * A capability flag rather than a version/class check so future
130
+ * backends advertise support without consumers growing type checks.
131
+ * @type {boolean}
132
+ * @default false
133
+ */
134
+ supportsShaderTileLayers: boolean;
135
+ /**
136
+ * Whether this renderer backend can keep mesh geometry resident on the
137
+ * GPU, letting a mesh supply a model matrix instead of vertices it has
138
+ * already positioned itself. `false` here on the base/Canvas renderer.
139
+ * @type {boolean}
140
+ * @default false
141
+ */
142
+ supportsRetainedMesh: boolean;
143
+ /**
144
+ * Whether this renderer backend can draw one geometry many times in a
145
+ * single call from per-instance data — what {@link InstancedMesh}
146
+ * needs. `false` here on the base/Canvas renderer, which falls back to
147
+ * drawing each instance individually.
148
+ * @type {boolean}
149
+ * @default false
150
+ */
151
+ supportsInstancing: boolean;
152
+ /**
153
+ * The source language this backend accepts for user-supplied shaders,
154
+ * or `null` when it has no programmable pipeline at all (the Canvas
155
+ * backend). `"glsl"` on the WebGL backend, `"wgsl"` on the WebGPU
156
+ * backend.
157
+ *
158
+ * Consumers that need a *specific* language — `ShaderEffect` and the
159
+ * loader's `{vertex, fragment}` shader assets both hand GLSL source
160
+ * straight to the driver — must compare against the language rather
161
+ * than test for a GPU backend, or they would accept a backend that
162
+ * cannot read what they are about to give it.
163
+ * @type {"glsl"|"wgsl"|null}
164
+ * @default null
165
+ */
166
+ shaderLanguage: "glsl" | "wgsl" | null;
167
+ /**
168
+ * Whether this backend has a depth buffer, and with it the 3D
169
+ * projection and mesh paths a depth-sorted scene needs (`Camera3d`
170
+ * and any camera declaring `defaultSortOn = "depth"`). `false` here
171
+ * on the base/Canvas renderer.
172
+ * @type {boolean}
173
+ * @default false
174
+ */
175
+ supportsDepthBuffer: boolean;
112
176
  /**
113
177
  * The background color used to clear the main framebuffer.
114
178
  * Note: alpha value will be set based on the transparent property of the renderer settings.
@@ -168,8 +232,8 @@ declare class Renderer {
168
232
  get currentBlendMode(): string;
169
233
  set currentDepth(value: number);
170
234
  /**
171
- * Current per-renderable depth value. GPU batchers (WebGL today,
172
- * WebGPU once it lands) push it into the vertex stream as the `z`
235
+ * Current per-renderable depth value. The GPU batchers (WebGL and
236
+ * WebGPU) push it into the vertex stream as the `z`
173
237
  * component of each vertex — a no-op under the default orthographic
174
238
  * projection, used by perspective (Camera3d) to
175
239
  * scale and parallax sprites by distance. Mirrors `renderable.depth`,
@@ -190,6 +254,16 @@ declare class Renderer {
190
254
  * @returns {number} width of the system Canvas
191
255
  */
192
256
  get width(): number;
257
+ /**
258
+ * Acquire whatever the backend cannot acquire synchronously — awaited by
259
+ * {@link Application#init} right after the renderer is constructed, and
260
+ * the reason `Application#init` is asynchronous at all. The Canvas and
261
+ * WebGL backends have their context by the end of the constructor and
262
+ * resolve immediately (this default); the WebGPU backend performs its
263
+ * adapter/device negotiation here.
264
+ * @returns {Promise<void>} resolves once the renderer is ready to draw
265
+ */
266
+ init(): Promise<void>;
193
267
  /**
194
268
  * prepare the framebuffer for drawing a new frame
195
269
  */
@@ -198,16 +272,61 @@ declare class Renderer {
198
272
  * render the main framebuffer on screen
199
273
  */
200
274
  flush(): void;
275
+ /**
276
+ * Hold one ground shadow ({@link Mesh#castGroundShadow}) back until the end
277
+ * of the mesh pass (#1515).
278
+ *
279
+ * A blob shadow deliberately writes no depth, so that two overlapping at
280
+ * one ground height blend instead of fighting. The price of that choice is
281
+ * that it leaves nothing in the depth buffer to defend itself with: any
282
+ * opaque mesh drawn afterwards simply paints over it. The ground plane is
283
+ * exactly that mesh whenever it sorts after the props standing on it — the
284
+ * common case, because a large plane's single sort key says nothing useful
285
+ * about where it sits relative to what stands on it.
286
+ *
287
+ * So shadows are collected here and drawn once the opaque meshes are down.
288
+ * Depth *testing* stays on throughout, so a shadow is still correctly
289
+ * hidden behind geometry genuinely in front of it: deferring changes only
290
+ * who paints over whom among draws that write no depth.
291
+ * @param {object} quad - the shared shadow quad
292
+ * @param {Matrix3d} modelMatrix - where the blob sits (copied, not retained)
293
+ * @param {number} tint - packed ARGB tint for the draw
294
+ * @param {object} [instanced] - the `InstancedMesh` whose instance buffer
295
+ * supplies one blob per instance, for the instanced tier
296
+ * @ignore
297
+ */
298
+ queueGroundShadow(quad: object, modelMatrix: Matrix3d, tint: number, instanced?: object): void;
299
+ _shadowCount: any;
300
+ /**
301
+ * Draw every ground shadow queued since the last drain, then empty the
302
+ * queue (#1515). Called when the renderer leaves mesh mode, and once more
303
+ * at end of frame for a scene made only of meshes, which never switches
304
+ * away from mesh mode on its own.
305
+ *
306
+ * Inert on a backend that never queues — the Canvas renderer has no depth
307
+ * buffer and so no ground shadows at all.
308
+ */
309
+ flushGroundShadows(): void;
310
+ _shadowFlushing: boolean | undefined;
201
311
  /**
202
312
  * Draw a textured triangle mesh.
203
313
  * The mesh object must provide: `vertices` (Float32Array, x/y/z triplets),
204
314
  * `uvs` (Float32Array, u/v pairs), `indices` (Uint16Array, triangle indices),
205
315
  * `texture` (TextureAtlas), `vertexCount` (number), and optionally
206
316
  * `cullBackFaces` (boolean, default true).
207
- * WebGL uses hardware depth testing; Canvas uses painter's algorithm (back-to-front sort).
317
+ *
318
+ * On the GPU backends (WebGL and WebGPU — hardware depth testing),
319
+ * passing a `modelMatrix` selects the **retained** path: the mesh's
320
+ * model-space geometry stays resident on the GPU and the matrix
321
+ * places it, so redrawing never re-uploads vertices (see
322
+ * {@link Renderer#supportsRetainedMesh}). Without a matrix the
323
+ * vertices are taken as already CPU-projected (the 2D-camera path —
324
+ * the only path the Canvas renderer supports, using painter's
325
+ * algorithm). `Mesh.draw` selects the right form automatically.
208
326
  * @param {Mesh} mesh - a Mesh renderable or compatible object
327
+ * @param {Matrix3d} [modelMatrix] - the mesh's placement, for the retained path (GPU backends)
209
328
  */
210
- drawMesh(mesh: Mesh): void;
329
+ drawMesh(mesh: Mesh, modelMatrix?: Matrix3d): void;
211
330
  /**
212
331
  * Reset context state
213
332
  */
@@ -223,11 +342,23 @@ declare class Renderer {
223
342
  * @returns {HTMLCanvasElement}
224
343
  */
225
344
  getCanvas(): HTMLCanvasElement;
345
+ /**
346
+ * Create and return a new Canvas element, sized as requested.
347
+ *
348
+ * The instance form of {@link Renderer.createCanvas}. `app.renderer` is
349
+ * the renderer entry point, and a static is not reachable through an
350
+ * instance — so this is what user code actually calls.
351
+ * @param {number} width - width in pixels
352
+ * @param {number} height - height in pixels
353
+ * @param {boolean} [returnOffscreenCanvas=false] - return an OffscreenCanvas where supported
354
+ * @returns {HTMLCanvasElement|OffscreenCanvas} the new canvas
355
+ */
356
+ createCanvas(width: number, height: number, returnOffscreenCanvas?: boolean): HTMLCanvasElement | OffscreenCanvas;
226
357
  /**
227
358
  * return a reference to the current render target corresponding Context
228
- * @returns {CanvasRenderingContext2D|WebGLRenderingContext}
359
+ * @returns {CanvasRenderingContext2D|WebGLRenderingContext|GPUCanvasContext}
229
360
  */
230
- getContext(): CanvasRenderingContext2D | WebGLRenderingContext;
361
+ getContext(): CanvasRenderingContext2D | WebGLRenderingContext | GPUCanvasContext;
231
362
  /**
232
363
  * return the list of supported compressed texture formats.
233
364
  * The base implementation returns null for all formats (no GPU
@@ -496,6 +627,20 @@ declare class Renderer {
496
627
  * @returns {HTMLCanvasElement|OffscreenCanvas} a new canvas or offscreencanvas (if supported) element representing the tinted image
497
628
  */
498
629
  tint(src: HTMLImageElement | HTMLCanvasElement | OffscreenCanvas, color: Color | string, mode?: string): HTMLCanvasElement | OffscreenCanvas;
630
+ /**
631
+ * Clip the region anything drawn afterwards is confined to.
632
+ * Implemented by subclasses.
633
+ * @param {number} x - x position of the clipping rectangle
634
+ * @param {number} y - y position of the clipping rectangle
635
+ * @param {number} width - width of the clipping rectangle
636
+ * @param {number} height - height of the clipping rectangle
637
+ */
638
+ clipRect(x: number, y: number, width: number, height: number): void;
639
+ /**
640
+ * Reset the current transform back to the identity matrix.
641
+ * Implemented by subclasses.
642
+ */
643
+ resetTransform(): void;
499
644
  /**
500
645
  * Push the current transform / alpha / clip state onto an internal
501
646
  * stack. Pair with {@link Renderer#restore}. Implemented by subclasses.
@@ -1 +1 @@
1
- {"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../src/video/renderer.js"],"names":[],"mappings":"AAUA;;GAEG;AAEH;;;;;;;;GAQG;AAEH;;;GAGG;AACH;IAiQC;;;;;;;;;;;;OAYG;IACH,2BANW,MAAM,UACN,MAAM,0BACN,OAAO,GAEL,iBAAiB,GAAC,eAAe,CAI7C;IAED;;;;;;;;;;;;OAYG;IACH,wBAFa,iBAAiB,G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4BAA4B;0CAEf,wBAAwB"}
@@ -11,8 +11,7 @@ declare class CanvasRenderTarget extends RenderTarget {
11
11
  * @param {number} width - the desired width of the canvas
12
12
  * @param {number} height - the desired height of the canvas
13
13
  * @param {object} attributes - The attributes to create both the canvas and context
14
- * @param {string} [attributes.context="2d"] - the context type to be created ("2d", "webgl")
15
- * @param {boolean} [attributes.preferWebGL1=false] - set to true for force using WebGL1 instead of WebGL2 (if supported)
14
+ * @param {string} [attributes.context="2d"] - the context type to be created ("2d", "webgl" — a "webgl" request creates a WebGL 2 context — or "webgpu")
16
15
  * @param {boolean} [attributes.transparent=false] - specify if the canvas contains an alpha channel
17
16
  * @param {boolean} [attributes.offscreenCanvas=false] - will create an offscreenCanvas if true instead of a standard canvas
18
17
  * @param {boolean} [attributes.willReadFrequently=false] - Indicates whether or not a lot of read-back operations are planned
@@ -20,7 +19,6 @@ declare class CanvasRenderTarget extends RenderTarget {
20
19
  */
21
20
  constructor(width: number, height: number, attributes?: {
22
21
  context?: string | undefined;
23
- preferWebGL1?: boolean | undefined;
24
22
  transparent?: boolean | undefined;
25
23
  offscreenCanvas?: boolean | undefined;
26
24
  willReadFrequently?: boolean | undefined;
@@ -36,11 +34,9 @@ declare class CanvasRenderTarget extends RenderTarget {
36
34
  stencil: boolean;
37
35
  blendMode: string;
38
36
  failIfMajorPerformanceCaveat: boolean;
39
- preferWebGL1: boolean;
40
37
  powerPreference: string;
41
38
  } & {
42
39
  context?: string | undefined;
43
- preferWebGL1?: boolean | undefined;
44
40
  transparent?: boolean | undefined;
45
41
  offscreenCanvas?: boolean | undefined;
46
42
  willReadFrequently?: boolean | undefined;
@@ -48,7 +44,12 @@ declare class CanvasRenderTarget extends RenderTarget {
48
44
  };
49
45
  canvas: any;
50
46
  context: any;
51
- WebGLVersion: any;
47
+ /**
48
+ * The WebGL version of the created context.
49
+ * @type {number}
50
+ * @deprecated since 20.0.0 — the WebGL renderer is WebGL 2 only, this is always `2`
51
+ */
52
+ WebGLVersion: number;
52
53
  /**
53
54
  * @ignore
54
55
  */
@@ -1 +1 @@
1
- {"version":3,"file":"canvasrendertarget.d.ts","sourceRoot":"","sources":["../../../src/video/rendertarget/canvasrendertarget.js"],"names":[],"mappings":";AA+EA;;;;;;GAMG;AACH;IACC;;;;;;;;;;OAUG;IACH,mBAVW,MAAM,UACN,MAAM,eAEd;QAA4B,OAAO;QACN,YAAY;QACZ,WAAW;QACX,eAAe;QACf,kBAAkB;QAClB,SAAS;KACxC,EA6BA;IAzBA;;;;;;;;;;;;;;;;;;;MAAkE;IASjE,YAA+B;IAUhC,aAA0D;IAE1D,kBAAgC;IAMjC;;OAEG;IACH,4CAGC;IAUD;;;OAGG;IACH,sBAFW,OAAO,QAwBjB;IAYD;;;;;;;;OAQG;IACH,gBANW,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,GACJ,SAAS,CAUrB;IAoDD;;;;OAIG;IACH,qBAFW,cAAc,GAAC,aAAa,QAatC;IALC,mBAEC;IAKH;;;;OAIG;IACH,mBAHW,cAAc,GAAC,aAAa,QAiCtC;CA2BD;yBAxUwB,mBAAmB;gCAIb,gCAAgC;+BACjC,8BAA8B"}
1
+ {"version":3,"file":"canvasrendertarget.d.ts","sourceRoot":"","sources":["../../../src/video/rendertarget/canvasrendertarget.js"],"names":[],"mappings":";AA6EA;;;;;;GAMG;AACH;IACC;;;;;;;;;OASG;IACH,mBATW,MAAM,UACN,MAAM,eAEd;QAA4B,OAAO;QACN,WAAW;QACX,eAAe;QACf,kBAAkB;QAClB,SAAS;KACxC,EAoCA;IAhCA;;;;;;;;;;;;;;;;;MAAkE;IASjE,YAA+B;IAUhC,aAA0D;IAGzD;;;;OAIG;IACH,cAHU,MAAM,CAGK;IAOvB;;OAEG;IACH,4CAGC;IAUD;;;OAGG;IACH,sBAFW,OAAO,QAwBjB;IAYD;;;;;;;;OAQG;IACH,gBANW,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,GACJ,SAAS,CAUrB;IAoDD;;;;OAIG;IACH,qBAFW,cAAc,GAAC,aAAa,QAyBtC;IAfC,mBAEC;IAeH;;;;OAIG;IACH,mBAHW,cAAc,GAAC,aAAa,QAyCtC;CA2BD;yBAhWwB,mBAAmB;gCAIb,gCAAgC;+BACjC,8BAA8B"}
@@ -16,9 +16,9 @@
16
16
  */
17
17
  export default class RenderTargetPool {
18
18
  /**
19
- * @param {function(number, number): RenderTarget} factory - creates a RenderTarget with the given width and height
19
+ * @param {function(number, number, boolean=): RenderTarget} factory - creates a RenderTarget with the given width and height; the third argument is `true` for CAPTURE slots (scene rasterization — may be multisampled) and `false` for ping-pong intermediates
20
20
  */
21
- constructor(factory: (arg0: number, arg1: number) => RenderTarget);
21
+ constructor(factory: (arg0: number, arg1: number, arg2: boolean | undefined) => RenderTarget);
22
22
  /** @type {function(number, number): RenderTarget} */
23
23
  _factory: (arg0: number, arg1: number) => RenderTarget;
24
24
  /** @type {RenderTarget[]} */
@@ -1 +1 @@
1
- {"version":3,"file":"render_target_pool.d.ts","sourceRoot":"","sources":["../../../src/video/rendertarget/render_target_pool.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;;;;GAYG;AACH;IACC;;OAEG;IACH,qBAFW,CAAS,IAAM,EAAN,MAAM,EAAE,IAAM,EAAN,MAAM,KAAG,YAAY,EAchD;IAXA,qDAAqD;IACrD,UADW,CAAS,IAAM,EAAN,MAAM,EAAE,IAAM,EAAN,MAAM,KAAG,YAAY,CAC1B;IACvB,6BAA6B;IAC7B,OADW,YAAY,EAAE,CACV;IACf;;;;;OAKG;IACH,YAFU,MAAM,EAAE,CAEE;IAGrB;;;OAGG;IACH,kBAFa,MAAM,CAMlB;IAED;;;;;;OAMG;IACH,WALW,MAAM,SACN,MAAM,UACN,MAAM,GACJ,YAAY,CASxB;IAED;;;;;;;;OAQG;IACH,gBANW,OAAO,eACP,MAAM,SACN,MAAM,UACN,MAAM,GACJ,YAAY,CAuBxB;IAED;;;OAGG;IACH,oBAFa,YAAY,GAAC,SAAS,CAQlC;IAED;;;OAGG;IACH,qBAFa,YAAY,GAAC,SAAS,CAQlC;IAED;;;;OAIG;IACH,OAFa,YAAY,GAAC,IAAI,CAS7B;IAED;;;;OAIG;IACH,iBAHW,MAAM,UACN,MAAM,QAQhB;IAED;;OAEG;IACH,gBAQC;CACD;8BA3J4B,mBAAmB"}
1
+ {"version":3,"file":"render_target_pool.d.ts","sourceRoot":"","sources":["../../../src/video/rendertarget/render_target_pool.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;;;;GAYG;AACH;IACC;;OAEG;IACH,qBAFW,CAAS,IAAM,EAAN,MAAM,EAAE,IAAM,EAAN,MAAM,EAAE,IAAQ,EAAR,OAAO,YAAC,KAAG,YAAY,EAc1D;IAXA,qDAAqD;IACrD,UADW,CAAS,IAAM,EAAN,MAAM,EAAE,IAAM,EAAN,MAAM,KAAG,YAAY,CAC1B;IACvB,6BAA6B;IAC7B,OADW,YAAY,EAAE,CACV;IACf;;;;;OAKG;IACH,YAFU,MAAM,EAAE,CAEE;IAGrB;;;OAGG;IACH,kBAFa,MAAM,CAMlB;IAED;;;;;;OAMG;IACH,WALW,MAAM,SACN,MAAM,UACN,MAAM,GACJ,YAAY,CAaxB;IAED;;;;;;;;OAQG;IACH,gBANW,OAAO,eACP,MAAM,SACN,MAAM,UACN,MAAM,GACJ,YAAY,CAuBxB;IAED;;;OAGG;IACH,oBAFa,YAAY,GAAC,SAAS,CAQlC;IAED;;;OAGG;IACH,qBAFa,YAAY,GAAC,SAAS,CAQlC;IAED;;;;OAIG;IACH,OAFa,YAAY,GAAC,IAAI,CAS7B;IAED;;;;OAIG;IACH,iBAHW,MAAM,UACN,MAAM,QAQhB;IAED;;OAEG;IACH,gBAQC;CACD;8BA/J4B,mBAAmB"}
@@ -11,11 +11,41 @@ export default class WebGLRenderTarget extends RenderTarget {
11
11
  * @param {number} width - initial width in pixels
12
12
  * @param {number} height - initial height in pixels
13
13
  */
14
- constructor(gl: WebGLRenderingContext | WebGL2RenderingContext, width: number, height: number);
14
+ /**
15
+ * @param {WebGLRenderingContext|WebGL2RenderingContext} gl - the WebGL context
16
+ * @param {number} width - initial width in pixels
17
+ * @param {number} height - initial height in pixels
18
+ * @param {object} [options] - target options
19
+ * @param {number} [options.samples=0] - MSAA sample count for the scene
20
+ * rasterization. When > 0 the target keeps a multisampled render FBO
21
+ * (color + depth-stencil renderbuffers) that draws rasterize into, and
22
+ * resolves it into the sampleable texture via `blitFramebuffer` on
23
+ * {@link WebGLRenderTarget#resolve} (called automatically by `unbind`).
24
+ */
25
+ constructor(gl: WebGLRenderingContext | WebGL2RenderingContext, width: number, height: number, options?: {
26
+ samples?: number | undefined;
27
+ });
15
28
  gl: WebGLRenderingContext | WebGL2RenderingContext;
29
+ /**
30
+ * MSAA sample count of the render half (0 = single-sampled)
31
+ * @type {number}
32
+ */
33
+ samples: number;
34
+ _needsResolve: boolean;
16
35
  framebuffer: WebGLFramebuffer;
17
- texture: WebGLTexture;
18
36
  depthStencilBuffer: WebGLRenderbuffer;
37
+ renderFramebuffer: WebGLFramebuffer | null;
38
+ colorRenderbuffer: WebGLRenderbuffer | null;
39
+ /**
40
+ * (Re)create the sampleable color texture with immutable storage
41
+ * (`texStorage2D` — the driver skips completeness validation and the
42
+ * layout is explicit) and attach it to the resolve framebuffer.
43
+ * Immutable storage can never be respecified, so a resize replaces the
44
+ * texture object. Caller manages ACTIVE_TEXTURE save/restore.
45
+ * @ignore
46
+ */
47
+ _allocateColorTexture(width: any, height: any): void;
48
+ texture: WebGLTexture | null | undefined;
19
49
  /**
20
50
  * (Re)attach the depth/stencil renderbuffer at the given size and
21
51
  * update `_hasStencil` based on the resulting framebuffer status.
@@ -25,6 +55,12 @@ export default class WebGLRenderTarget extends RenderTarget {
25
55
  */
26
56
  _applyDepthStencil(width: any, height: any): void;
27
57
  _hasStencil: boolean | undefined;
58
+ /**
59
+ * Resolve the multisampled render half into the sampleable texture
60
+ * (no-op when single-sampled or already resolved). Leaves no
61
+ * framebuffer bound — callers rebind what they need.
62
+ */
63
+ resolve(): void;
28
64
  }
29
65
  import RenderTarget from "./rendertarget.ts";
30
66
  //# sourceMappingURL=webglrendertarget.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"webglrendertarget.d.ts","sourceRoot":"","sources":["../../../src/video/rendertarget/webglrendertarget.js"],"names":[],"mappings":"AA8DA;;;;;;GAMG;AACH;IACC;;;;OAIG;IACH,gBAJW,qBAAqB,GAAC,sBAAsB,SAC5C,MAAM,UACN,MAAM,EAqDhB;IAjDA,mDAAY;IAKZ,8BAAyC;IAMzC,sBAAiC;IAoBjC,sCAAiD;IAoBlD;;;;;;OAMG;IACH,kDAkBC;IAVA,iCAAoC;CAmIrC;yBAlRwB,mBAAmB"}
1
+ {"version":3,"file":"webglrendertarget.d.ts","sourceRoot":"","sources":["../../../src/video/rendertarget/webglrendertarget.js"],"names":[],"mappings":"AA2EA;;;;;;GAMG;AACH;IACC;;;;OAIG;IACH;;;;;;;;;;OAUG;IACH,gBAVW,qBAAqB,GAAC,sBAAsB,SAC5C,MAAM,UACN,MAAM,YAEd;QAAyB,OAAO;KAKlC,EAgEA;IA7DA,mDAAY;IAIZ;;;OAGG;IACH,SAFU,MAAM,CAEmB;IAGnC,uBAA0B;IAI1B,8BAAyC;IAWzC,sCAAiD;IAKhD,2CAA+C;IAC/C,4CAAgD;IA+BlD;;;;;;;OAOG;IACH,qDAqBC;IAhBA,yCAAiC;IAkBlC;;;;;;OAMG;IACH,kDAmBC;IAVA,iCAAoC;IA0BrC;;;;OAIG;IACH,gBAqBC;CAuID;yBA9YwB,mBAAmB"}
@@ -0,0 +1,83 @@
1
+ /**
2
+ * WebGPU offscreen render target — the WebGPU counterpart of the WebGL
3
+ * FBO-backed {@link WebGLRenderTarget}, used by the post-effect chain
4
+ * through the shared {@link RenderTargetPool}.
5
+ *
6
+ * Owns one color `GPUTexture` (renderable AND sampleable — the whole point
7
+ * of a post-effect target) in the renderer's preferred canvas format, so
8
+ * pipelines keyed on that format serve canvas and offscreen passes alike.
9
+ * The depth-stencil attachment is NOT per-target: every pass shares the
10
+ * renderer's canvas-sized depth-stencil texture (targets in this flow are
11
+ * canvas-sized, only one pass is open at a time — and sharing the stencil
12
+ * means a mask active around a post-effect renderable keeps clipping its
13
+ * offscreen content, which is what masks promise).
14
+ *
15
+ * Under the recording model "binding" a target is a pass break: draws
16
+ * recorded after {@link WebGPURenderer#setRenderTarget} land in a new pass
17
+ * whose color attachment is this texture. Mid-frame resize/destroy retire
18
+ * the texture (a texture referenced by recorded draws must not be
19
+ * destroyed before submit).
20
+ * @augments RenderTarget
21
+ * @category Rendering
22
+ */
23
+ export default class WebGPURenderTarget extends RenderTarget {
24
+ /**
25
+ * @param {import("../webgpu/webgpu_renderer.js").default} renderer - the owning renderer
26
+ * @param {number} width - width in pixels
27
+ * @param {number} height - height in pixels
28
+ */
29
+ constructor(renderer: import("../webgpu/webgpu_renderer.js").default, width: number, height: number, options?: {});
30
+ renderer: import("../webgpu/webgpu_renderer.js").default;
31
+ /**
32
+ * MSAA sample count for scene rasterization into this target
33
+ * (1 = single-sampled). When > 1 the target owns a multisampled
34
+ * color texture that passes rasterize into and resolve into
35
+ * `texture` at every pass end — so anything sampling the target
36
+ * always sees resolved pixels.
37
+ * @type {number}
38
+ */
39
+ sampleCount: number;
40
+ /** @type {GPUTexture|null} */
41
+ texture: GPUTexture | null;
42
+ /** @type {GPUTextureView|null} */
43
+ colorView: GPUTextureView | null;
44
+ /** the multisampled render half, when sampleCount > 1 @type {GPUTexture|null} */
45
+ msaaTexture: GPUTexture | null;
46
+ /** @type {GPUTextureView|null} */
47
+ msaaView: GPUTextureView | null;
48
+ /**
49
+ * bumped whenever the backing texture is reallocated — cached bind
50
+ * groups referencing the old view key on this
51
+ * @type {number}
52
+ */
53
+ generation: number;
54
+ materialBindGroup: GPUBindGroup | null;
55
+ materialBindGroupGeneration: number;
56
+ pendingClear: boolean;
57
+ /**
58
+ * The group-1 (material) bind group sampling this target with a linear
59
+ * clamp sampler — what the effect blit binds as its source. Rebuilt
60
+ * lazily when the backing texture was reallocated.
61
+ * @returns {GPUBindGroup} the bind group
62
+ * @ignore
63
+ */
64
+ getMaterialBindGroup(): GPUBindGroup;
65
+ /**
66
+ * Synchronous readback is impossible under WebGPU — use
67
+ * {@link WebGPURenderTarget#readPixels}.
68
+ * @throws {Error} always
69
+ * @override
70
+ */
71
+ override getImageData(): void;
72
+ /**
73
+ * Asynchronously read back this target's pixels.
74
+ * @param {number} [x=0] - x of the top-left corner
75
+ * @param {number} [y=0] - y of the top-left corner
76
+ * @param {number} [width=this.width] - width of the area to read
77
+ * @param {number} [height=this.height] - height of the area to read
78
+ * @returns {Promise<ImageData>} the pixel data (RGBA order)
79
+ */
80
+ readPixels(x?: number, y?: number, width?: number, height?: number): Promise<ImageData>;
81
+ }
82
+ import RenderTarget from "./rendertarget.ts";
83
+ //# sourceMappingURL=webgpurendertarget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webgpurendertarget.d.ts","sourceRoot":"","sources":["../../../src/video/rendertarget/webgpurendertarget.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH;IACC;;;;OAIG;IACH,sBAJW,OAAO,8BAA8B,EAAE,OAAO,SAC9C,MAAM,UACN,MAAM,gBAsChB;IAlCA,yDAAwB;IAGxB;;;;;;;OAOG;IACH,aAFU,MAAM,CAE2B;IAC3C,8BAA8B;IAC9B,SADW,UAAU,GAAC,IAAI,CACP;IACnB,kCAAkC;IAClC,WADW,cAAc,GAAC,IAAI,CACT;IACrB,iFAAiF;IACjF,aAD8D,UAAU,GAAC,IAAI,CACtD;IACvB,kCAAkC;IAClC,UADW,cAAc,GAAC,IAAI,CACV;IACpB;;;;OAIG;IACH,YAFU,MAAM,CAEG;IAGnB,uCAA6B;IAC7B,oCAAqC;IAErC,sBAAyB;IA+E1B;;;;;;OAMG;IACH,wBAHa,YAAY,CAuBxB;IAED;;;;;OAKG;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M,CAiBlB;IAED;;;;;;;OAOG;IACH,aANW,MAAM,GAAC,MAAM,OACb,MAAM,OACN,MAAM,OACN,MAAM,GACJ,YAAY,CAsCxB;IAED;;;;;;;OAOG;IACH,cANW,MAAM,QACN,MAAM,KACN,MAAM,KACN,MAAM,GACJ,YAAY,CA2BxB;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,2BA1BW,MAAM,aACN,MAAM,cACN,OAAO,GACL,MAAM,GAAC,eAAe,CAqClC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,6BAnBW,MAAM,EAAE,GAAC,MAAM,EAAE,GAGf,MAAM,CAkFlB;IAED,2DAiDC;CACD;sBA5rBqB,gBAAgB;mBALnB,8BAA8B;iCASjB,uCAAuC"}
1
+ {"version":3,"file":"atlas.d.ts","sourceRoot":"","sources":["../../../src/video/texture/atlas.js"],"names":[],"mappings":"AAmBA;;;GAGG;AAEH;;;GAGG;AACH;;;;;;;;;;;;;;;;;;;EAoBC;AAED;;;GAGG;AACH,+FAYC;AAED;;;;;;;;;;GAUG;AACH;IACC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACH,qBAjCW,MAAM,GAAC,MAAM,EAAE,QACf,gBAAgB,GAAC,iBAAiB,GAAC,eAAe,GAAC,eAAe,GAAC,MAAM,GAAC,eAAe,EAAE,GAAC,gBAAgB,EAAE,GAAC,iBAAiB,EAAE,GAAC,MAAM,EAAE,YAC3I,OAAO,GAAC,MAAM,EAuOxB;IAjMA;;;OAGG;IACH,sBAAkB;IAElB;;;;OAIG;IACH,uBAAwB;IAExB;;;;;;OAMG;IACH,6BAA8B;IAE9B;;;;OAIG;IACH,uBAAwB;IAExB;;;;OAIG;IACH,2BAA4B;IAE5B;;;OAGG;IACH;;;;;;MAA6D;IAW1D,YAA8C;IAgJlD;;;;OAIG;IACH,gBAHW,MAAM,GACJ,MAAM,CAQlB;IAED;;;OAGG;IACH,aAFa,MAAM,CAIlB;IAED;;;;OAIG;IACH,oBAHW,MAAM,GACJ,gBAAgB,GAAC,iBAAiB,CAQ9C;IAED;;;;;;OAMG;IACH,0BAHW,MAAM,GACJ,gBAAgB,GAAC,iBAAiB,GAAC,eAAe,GAAC,WAAW,GAAC,IAAI,CAU/E;IAED;;;;;;;;OAQG;IACH,gBAPW,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,GACJ,MAAM,CAsBlB;IAED;;;;;OAKG;IACH,gBAJW,MAAM,UACN,MAAM,GACJ,MAAM,CAiBlB;IAED;;;;;;;OAOG;IACH,aANW,MAAM,GAAC,MAAM,OACb,MAAM,OACN,MAAM,OACN,MAAM,GACJ,YAAY,CAsCxB;IAED;;;;;;;OAOG;IACH,cANW,MAAM,QACN,MAAM,KACN,MAAM,KACN,MAAM,GACJ,YAAY,CA2BxB;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,2BA1BW,MAAM,aACN,MAAM,cACN,OAAO,GACL,MAAM,GAAC,eAAe,CAqClC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,6BAnBW,MAAM,EAAE,GAAC,MAAM,EAAE,GAGf,MAAM,CAkFlB;IAED,2DAiDC;CACD;sBArsBqB,gBAAgB;mBANnB,8BAA8B;iCAmBjB,uCAAuC"}
@@ -12,9 +12,26 @@ declare class TextureCache {
12
12
  cache: ArrayMultimap;
13
13
  tinted: Map<any, any>;
14
14
  units: Map<any, any>;
15
- usedUnits: Set<any>;
15
+ slotTable: TextureSlotTable;
16
16
  reservedUnits: Map<any, any>;
17
- max_size: number;
17
+ /**
18
+ * Which texture units are currently taken. This is the slot table's own
19
+ * occupancy set, exposed under the name it has always had — seeding or
20
+ * clearing it drives the allocator directly.
21
+ * @returns {Set<number>} the occupied units
22
+ * @ignore
23
+ */
24
+ get usedUnits(): Set<number>;
25
+ set max_size(size: number);
26
+ /**
27
+ * How many texture units this cache may hand out. Backed by the slot
28
+ * table's capacity, so assigning it (tests narrow it to force exhaustion,
29
+ * and a context restore can resolve a different device limit) re-sizes the
30
+ * allocator rather than leaving the two disagreeing.
31
+ * @returns {number} the unit count
32
+ * @ignore
33
+ */
34
+ get max_size(): number;
18
35
  /**
19
36
  * @ignore
20
37
  */
@@ -119,4 +136,5 @@ declare class TextureCache {
119
136
  tint(src: any, color: any): any;
120
137
  }
121
138
  import { ArrayMultimap } from "../../utils/array-multimap.js";
139
+ import { TextureSlotTable } from "../gpu/textureslots.js";
122
140
  //# sourceMappingURL=cache.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../src/video/texture/cache.js"],"names":[],"mappings":";AAeA;;;GAGG;AACH;IACC;;OAEG;IACH,8CA4BC;IA1BA,cAAwB;IAExB,qBAAgC;IAChC,sBAAuB;IAavB,qBAAsB;IACtB,oBAA0B;IAM1B,6BAA8B;IAC9B,iBAAwB;IAIzB;;OAEG;IACH,cAKC;IAED;;OAEG;IACH,8BA4BC;IAED;;;;;;;OAOG;IACH,kBAHW,MAAM,QAKhB;IAED;;;;;OAKG;IACH,kBAHW,MAAM,QAUhB;IAED;;;;OAIG;IACH,6BAIC;IAED;;;;;;;;;;OAUG;IACH,oCAaC;IAED;;;;;;;;OAQG;IACH,iCASC;IAED;;;;;;;;;;OAUG;IACH,+BATW,MAAM,OAuBhB;IAED;;;;;;;;OAQG;IACH,kCAIC;IAED;;;;OAIG;IACH,gCAFW,MAAM,OAShB;IAED;;;OAGG;IACH,yCAEC;IAED;;OAEG;IACH,yBAEC;IAED;;;OAGG;IACH,iCAmCC;IAED;;OAEG;IACH,yBAkBC;IAED;;OAEG;IACH,gCAcC;CACD;8BA5U6B,+BAA+B"}
1
+ {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../src/video/texture/cache.js"],"names":[],"mappings":";AAgBA;;;GAGG;AACH;IACC;;OAEG;IACH,8CAgDC;IA9CA,cAAwB;IAExB,qBAAgC;IAChC,sBAAuB;IAavB,qBAAsB;IAOtB,4BAeE;IAMF,6BAA8B;IAI/B;;;;;;OAMG;IACH,iBAHa,GAAG,CAAC,MAAM,CAAC,CAKvB;IAcD,mBAPa,MAAM,EASlB;IAdD;;;;;;;OAOG;IACH,gBAHa,MAAM,CAKlB;IAMD;;OAEG;IACH,cAKC;IAED;;OAEG;IACH,8BAIC;IAED;;;;;;;OAOG;IACH,kBAHW,MAAM,QAKhB;IAED;;;;;OAKG;IACH,kBAHW,MAAM,QAUhB;IAED;;;;OAIG;IACH,6BAIC;IAED;;;;;;;;;;OAUG;IACH,oCAaC;IAED;;;;;;;;OAQG;IACH,iCASC;IAED;;;;;;;;;;OAUG;IACH,+BATW,MAAM,OAuBhB;IAED;;;;;;;;OAQG;IACH,kCAIC;IAED;;;;OAIG;IACH,gCAFW,MAAM,OAShB;IAED;;;OAGG;IACH,yCAEC;IAED;;OAEG;IACH,yBAEC;IAED;;;OAGG;IACH,iCAmCC;IAED;;OAEG;IACH,yBAkBC;IAED;;OAEG;IACH,gCAcC;CACD;8BApW6B,+BAA+B;iCAE5B,wBAAwB"}
@@ -19,8 +19,8 @@ export default NoiseTexture2d;
19
19
  * sampled in 3D (`getNoise3d`) using an internal `time` as the third axis —
20
20
  * call {@link NoiseTexture2d#update} from your update loop to evolve it. Each
21
21
  * re-bake bumps a `version` the renderer reads, so the GPU texture re-uploads
22
- * automatically (and only when it actually changed — the three.js
23
- * `Texture.needsUpdate` model).
22
+ * automatically (and only when it actually changed — explicit, version-based
23
+ * invalidation).
24
24
  *
25
25
  * Note: live re-upload is currently wired through the lit **normal-map**
26
26
  * pipeline ({@link Sprite#normalMap} + {@link Light2d}). An `animated` texture
@@ -1 +1 @@
1
- {"version":3,"file":"autodetect.d.ts","sourceRoot":"","sources":["../../../src/video/utils/autodetect.js"],"names":[],"mappings":"AAIA;;;GAGG;AACH,iFASC;2BAhB0B,2BAA2B;0BAC5B,yBAAyB"}
1
+ {"version":3,"file":"autodetect.d.ts","sourceRoot":"","sources":["../../../src/video/utils/autodetect.js"],"names":[],"mappings":"AAkCA;;;GAGG;AACH,iFAeC;2BApD0B,2BAA2B;0BAC5B,yBAAyB"}
@@ -1,56 +1,2 @@
1
- /**
2
- * Initialize the "video" system (create a canvas based on the given arguments, and the related renderer). <br>
3
- * @memberof video
4
- * @param {number} width - The width of the canvas viewport
5
- * @param {number} height - The height of the canvas viewport
6
- * @param {ApplicationSettings} [options] - optional parameters for the renderer
7
- * @returns {boolean} false if initialization failed (canvas not supported)
8
- * @deprecated since 18.3.0 — use {@link Application} constructor instead:
9
- * `const app = new Application(width, height, options)`
10
- * @see Application
11
- * @example
12
- * // using the new Application entry point (recommended)
13
- * const app = new Application(640, 480, {
14
- * parent : "screen",
15
- * scale : "auto",
16
- * scaleMethod : "fit"
17
- * });
18
- *
19
- * // legacy usage (still supported)
20
- * me.video.init(640, 480, {
21
- * parent : "screen",
22
- * renderer : me.video.AUTO,
23
- * scale : "auto",
24
- * scaleMethod : "fit"
25
- * });
26
- */
27
- export function init(width: number, height: number, options?: ApplicationSettings): boolean;
28
- /**
29
- * Create and return a new Canvas element.
30
- * @memberof video
31
- * @param {number} width - width
32
- * @param {number} height - height
33
- * @param {boolean} [returnOffscreenCanvas=false] - will return an OffscreenCanvas if supported
34
- * @returns {HTMLCanvasElement|OffscreenCanvas} a new Canvas element of the given size
35
- * @deprecated since 19.7.0 — use {@link Renderer.createCanvas} instead.
36
- * @see Renderer.createCanvas
37
- */
38
- export function createCanvas(width: number, height: number, returnOffscreenCanvas?: boolean): HTMLCanvasElement | OffscreenCanvas;
39
- /**
40
- * return a reference to the parent DOM element holding the main canvas
41
- * @memberof video
42
- * @returns {HTMLElement} the HTML parent element
43
- * @deprecated since 18.3.0 — use {@link Application#getParentElement app.getParentElement()} instead.
44
- * @see Application#getParentElement
45
- */
46
- export function getParent(): HTMLElement;
47
- /**
48
- * A reference to the active Canvas or WebGL renderer.
49
- * @memberof video
50
- * @type {CanvasRenderer|WebGLRenderer}
51
- * @deprecated since 18.3.0 — use {@link Application#renderer app.renderer} instead.
52
- * @see Application#renderer
53
- */
54
- export let renderer: CanvasRenderer | WebGLRenderer;
55
- export { AUTO, CANVAS, WEBGL } from "../const";
1
+ export { AUTO, CANVAS, WEBGL, WEBGPU } from "../const";
56
2
  //# sourceMappingURL=video.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"video.d.ts","sourceRoot":"","sources":["../../src/video/video.js"],"names":[],"mappings":"AAqCA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,4BAvBW,MAAM,UACN,MAAM,YACN,mBAAmB,GACjB,OAAO,CAyCnB;AAED;;;;;;;;;GASG;AACH,oCAPW,MAAM,UACN,MAAM,0BACN,OAAO,GACL,iBAAiB,GAAC,eAAe,CAO7C;AAED;;;;;;GAMG;AACH,6BAJa,WAAW,CAMvB;AAxFD;;;;;;GAMG;AACH,qBAJU,cAAc,GAAC,aAAa,CAIX"}
1
+ {"version":3,"file":"video.d.ts","sourceRoot":"","sources":["../../src/video/video.js"],"names":[],"mappings":""}