melonjs 20.7.0 → 20.9.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 (332) hide show
  1. package/README.md +7 -3
  2. package/build/application/application.d.ts +66 -8
  3. package/build/application/application.d.ts.map +1 -1
  4. package/build/application/defaultApplicationSettings.d.ts +6 -0
  5. package/build/application/defaultApplicationSettings.d.ts.map +1 -1
  6. package/build/application/header.d.ts.map +1 -1
  7. package/build/application/resize.d.ts +25 -0
  8. package/build/application/resize.d.ts.map +1 -1
  9. package/build/application/scaleMethods.d.ts +13 -3
  10. package/build/application/scaleMethods.d.ts.map +1 -1
  11. package/build/application/settings.d.ts +144 -5
  12. package/build/application/settings.d.ts.map +1 -1
  13. package/build/audio/audio.d.ts +29 -5
  14. package/build/audio/audio.d.ts.map +1 -1
  15. package/build/audio/autopause.d.ts +36 -0
  16. package/build/audio/autopause.d.ts.map +1 -0
  17. package/build/audio/backend/engine.d.ts +10 -1
  18. package/build/audio/backend/engine.d.ts.map +1 -1
  19. package/build/audio/backend/sound.d.ts +0 -1
  20. package/build/audio/backend/sound.d.ts.map +1 -1
  21. package/build/audio/backend/spatial.d.ts.map +1 -1
  22. package/build/audio/context.d.ts +35 -0
  23. package/build/audio/context.d.ts.map +1 -0
  24. package/build/audio/playback.d.ts.map +1 -1
  25. package/build/audio/procedural.d.ts.map +1 -1
  26. package/build/audio/spatial.d.ts +87 -0
  27. package/build/audio/spatial.d.ts.map +1 -0
  28. package/build/audio/state.d.ts +1 -0
  29. package/build/audio/state.d.ts.map +1 -1
  30. package/build/audio/types.d.ts +46 -6
  31. package/build/audio/types.d.ts.map +1 -1
  32. package/build/camera/camera2d.d.ts.map +1 -1
  33. package/build/camera/camera3d.d.ts +95 -8
  34. package/build/camera/camera3d.d.ts.map +1 -1
  35. package/build/camera/effects/fade_effect.d.ts.map +1 -1
  36. package/build/camera/effects/mask_effect.d.ts.map +1 -1
  37. package/build/camera/effects/shake_effect.d.ts.map +1 -1
  38. package/build/geometries/box3d.d.ts +25 -7
  39. package/build/geometries/box3d.d.ts.map +1 -1
  40. package/build/geometries/ellipse.d.ts +15 -1
  41. package/build/geometries/ellipse.d.ts.map +1 -1
  42. package/build/geometries/line.d.ts +1 -1
  43. package/build/geometries/line.d.ts.map +1 -1
  44. package/build/geometries/point.d.ts +1 -1
  45. package/build/geometries/point.d.ts.map +1 -1
  46. package/build/geometries/polygon.d.ts +15 -1
  47. package/build/geometries/polygon.d.ts.map +1 -1
  48. package/build/geometries/rectangle.d.ts +1 -1
  49. package/build/geometries/rectangle.d.ts.map +1 -1
  50. package/build/geometries/roundrect.d.ts +1 -1
  51. package/build/geometries/roundrect.d.ts.map +1 -1
  52. package/build/geometries/sphere.d.ts +36 -7
  53. package/build/geometries/sphere.d.ts.map +1 -1
  54. package/build/index.d.ts +16 -3
  55. package/build/index.d.ts.map +1 -1
  56. package/build/index.js +38172 -33633
  57. package/build/index.js.map +4 -4
  58. package/build/input/gamepad.d.ts +129 -3
  59. package/build/input/gamepad.d.ts.map +1 -1
  60. package/build/input/pointerevent.d.ts +8 -0
  61. package/build/input/pointerevent.d.ts.map +1 -1
  62. package/build/level/gltf/GLTFModel.d.ts +20 -33
  63. package/build/level/gltf/GLTFModel.d.ts.map +1 -1
  64. package/build/level/gltf/GLTFScene.d.ts +40 -1
  65. package/build/level/gltf/GLTFScene.d.ts.map +1 -1
  66. package/build/level/level.d.ts +35 -0
  67. package/build/level/level.d.ts.map +1 -1
  68. package/build/level/tiled/TMXLayer.d.ts +5 -2
  69. package/build/level/tiled/TMXLayer.d.ts.map +1 -1
  70. package/build/level/tiled/TMXObject.d.ts +0 -1
  71. package/build/level/tiled/TMXObjectFactory.d.ts +3 -2
  72. package/build/level/tiled/TMXObjectFactory.d.ts.map +1 -1
  73. package/build/level/tiled/TMXTile.d.ts +2 -1
  74. package/build/level/tiled/TMXTile.d.ts.map +1 -1
  75. package/build/level/tiled/TMXTileMap.d.ts +7 -4
  76. package/build/level/tiled/TMXTileMap.d.ts.map +1 -1
  77. package/build/level/tiled/TMXTileset.d.ts +1 -1
  78. package/build/level/tiled/TMXTileset.d.ts.map +1 -1
  79. package/build/level/tiled/TMXTilesetGroup.d.ts +5 -0
  80. package/build/level/tiled/TMXTilesetGroup.d.ts.map +1 -1
  81. package/build/level/tiled/factories/shape.d.ts +0 -1
  82. package/build/level/tiled/renderer/TMXHexagonalRenderer.d.ts +6 -5
  83. package/build/level/tiled/renderer/TMXHexagonalRenderer.d.ts.map +1 -1
  84. package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts +5 -0
  85. package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts.map +1 -1
  86. package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts +5 -7
  87. package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts.map +1 -1
  88. package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts +5 -0
  89. package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts.map +1 -1
  90. package/build/level/tiled/renderer/TMXRenderer.d.ts +19 -4
  91. package/build/level/tiled/renderer/TMXRenderer.d.ts.map +1 -1
  92. package/build/level/tiled/renderer/autodetect.d.ts +0 -4
  93. package/build/level/tiled/renderer/autodetect.d.ts.map +1 -1
  94. package/build/loader/cache.d.ts +220 -0
  95. package/build/loader/cache.d.ts.map +1 -1
  96. package/build/loader/loader.d.ts +20 -340
  97. package/build/loader/loader.d.ts.map +1 -1
  98. package/build/loader/loadingscreen.d.ts +1 -2
  99. package/build/loader/loadingscreen.d.ts.map +1 -1
  100. package/build/loader/parsers/gltf.d.ts +115 -0
  101. package/build/loader/parsers/gltf.d.ts.map +1 -1
  102. package/build/loader/parsers/shader.d.ts +0 -2
  103. package/build/math/color.d.ts +28 -5
  104. package/build/math/color.d.ts.map +1 -1
  105. package/build/math/matrix2d.d.ts +1 -1
  106. package/build/math/matrix2d.d.ts.map +1 -1
  107. package/build/math/matrix3d.d.ts +1 -1
  108. package/build/math/matrix3d.d.ts.map +1 -1
  109. package/build/math/observableVector2d.d.ts +14 -2
  110. package/build/math/observableVector2d.d.ts.map +1 -1
  111. package/build/math/observableVector3d.d.ts +15 -1
  112. package/build/math/observableVector3d.d.ts.map +1 -1
  113. package/build/math/vector2d.d.ts +31 -1
  114. package/build/math/vector2d.d.ts.map +1 -1
  115. package/build/math/vector3d.d.ts +38 -1
  116. package/build/math/vector3d.d.ts.map +1 -1
  117. package/build/math/vertex.d.ts.map +1 -1
  118. package/build/particles/emitter.d.ts.map +1 -1
  119. package/build/particles/particle.d.ts +29 -2
  120. package/build/particles/particle.d.ts.map +1 -1
  121. package/build/particles/settings.d.ts +104 -0
  122. package/build/particles/settings.d.ts.map +1 -1
  123. package/build/physics/adapter.d.ts +9 -1
  124. package/build/physics/adapter.d.ts.map +1 -1
  125. package/build/physics/bounds.d.ts +1 -1
  126. package/build/physics/bounds.d.ts.map +1 -1
  127. package/build/physics/broadphase/octree.d.ts +24 -0
  128. package/build/physics/broadphase/octree.d.ts.map +1 -1
  129. package/build/physics/broadphase/quadtree.d.ts +31 -0
  130. package/build/physics/broadphase/quadtree.d.ts.map +1 -1
  131. package/build/physics/builtin/body.d.ts +17 -2
  132. package/build/physics/builtin/body.d.ts.map +1 -1
  133. package/build/physics/builtin/builtin-adapter.d.ts.map +1 -1
  134. package/build/physics/builtin/detector.d.ts +0 -1
  135. package/build/physics/builtin/detector.d.ts.map +1 -1
  136. package/build/physics/builtin/sat.d.ts +0 -7
  137. package/build/physics/builtin/sat3d.d.ts +46 -0
  138. package/build/physics/builtin/sat3d.d.ts.map +1 -1
  139. package/build/physics/response.d.ts +45 -62
  140. package/build/physics/response.d.ts.map +1 -1
  141. package/build/pool.d.ts +4 -0
  142. package/build/pool.d.ts.map +1 -1
  143. package/build/renderable/collectable.d.ts +6 -1
  144. package/build/renderable/collectable.d.ts.map +1 -1
  145. package/build/renderable/colorlayer.d.ts +17 -4
  146. package/build/renderable/colorlayer.d.ts.map +1 -1
  147. package/build/renderable/container.d.ts +23 -17
  148. package/build/renderable/container.d.ts.map +1 -1
  149. package/build/renderable/entity/entity.d.ts +12 -16
  150. package/build/renderable/entity/entity.d.ts.map +1 -1
  151. package/build/renderable/frameAnimation.d.ts +1 -1
  152. package/build/renderable/groundshadow.d.ts +1 -0
  153. package/build/renderable/groundshadow.d.ts.map +1 -1
  154. package/build/renderable/imagelayer.d.ts +12 -5
  155. package/build/renderable/imagelayer.d.ts.map +1 -1
  156. package/build/renderable/instanced_mesh.d.ts +56 -7
  157. package/build/renderable/instanced_mesh.d.ts.map +1 -1
  158. package/build/renderable/mesh.d.ts +369 -4
  159. package/build/renderable/mesh.d.ts.map +1 -1
  160. package/build/renderable/nineslicesprite.d.ts +3 -13
  161. package/build/renderable/nineslicesprite.d.ts.map +1 -1
  162. package/build/renderable/renderable.d.ts +129 -28
  163. package/build/renderable/renderable.d.ts.map +1 -1
  164. package/build/renderable/sprite.d.ts +7 -20
  165. package/build/renderable/sprite.d.ts.map +1 -1
  166. package/build/renderable/sprite3d.d.ts +31 -16
  167. package/build/renderable/sprite3d.d.ts.map +1 -1
  168. package/build/renderable/text/bitmaptext.d.ts +76 -5
  169. package/build/renderable/text/bitmaptext.d.ts.map +1 -1
  170. package/build/renderable/text/bitmaptextdata.d.ts +1 -5
  171. package/build/renderable/text/bitmaptextdata.d.ts.map +1 -1
  172. package/build/renderable/text/glypheffect.d.ts +44 -0
  173. package/build/renderable/text/glypheffect.d.ts.map +1 -0
  174. package/build/renderable/text/text.d.ts +22 -3
  175. package/build/renderable/text/text.d.ts.map +1 -1
  176. package/build/renderable/text/textmetrics.d.ts +2 -0
  177. package/build/renderable/text/textmetrics.d.ts.map +1 -1
  178. package/build/renderable/trail.d.ts +0 -1
  179. package/build/renderable/trail.d.ts.map +1 -1
  180. package/build/renderable/trail3d.d.ts +174 -0
  181. package/build/renderable/trail3d.d.ts.map +1 -0
  182. package/build/renderable/trigger.d.ts +28 -5
  183. package/build/renderable/trigger.d.ts.map +1 -1
  184. package/build/renderable/ui/panelpaint.d.ts +5 -0
  185. package/build/renderable/ui/panelpaint.d.ts.map +1 -0
  186. package/build/renderable/ui/progressbar.d.ts +192 -0
  187. package/build/renderable/ui/progressbar.d.ts.map +1 -0
  188. package/build/renderable/ui/uibaseelement.d.ts +48 -3
  189. package/build/renderable/ui/uibaseelement.d.ts.map +1 -1
  190. package/build/renderable/ui/uipanel.d.ts +245 -0
  191. package/build/renderable/ui/uipanel.d.ts.map +1 -0
  192. package/build/renderable/ui/uispriteelement.d.ts +19 -3
  193. package/build/renderable/ui/uispriteelement.d.ts.map +1 -1
  194. package/build/renderable/ui/uitextbutton.d.ts +30 -1
  195. package/build/renderable/ui/uitextbutton.d.ts.map +1 -1
  196. package/build/state/state.d.ts.map +1 -1
  197. package/build/system/bootstrap.d.ts.map +1 -1
  198. package/build/system/legacy_pool.d.ts +24 -4
  199. package/build/system/legacy_pool.d.ts.map +1 -1
  200. package/build/system/pool.d.ts +15 -8
  201. package/build/system/pool.d.ts.map +1 -1
  202. package/build/tweens/tween.d.ts +50 -3
  203. package/build/tweens/tween.d.ts.map +1 -1
  204. package/build/video/canvas/canvas_renderer.d.ts +34 -23
  205. package/build/video/canvas/canvas_renderer.d.ts.map +1 -1
  206. package/build/video/effects/blendEffect.d.ts +0 -1
  207. package/build/video/effects/bloom.d.ts +72 -0
  208. package/build/video/effects/bloom.d.ts.map +1 -0
  209. package/build/video/effects/blur.d.ts +3 -2
  210. package/build/video/effects/blur.d.ts.map +1 -1
  211. package/build/video/effects/chromaticAberration.d.ts +3 -2
  212. package/build/video/effects/chromaticAberration.d.ts.map +1 -1
  213. package/build/video/effects/colorMatrix.d.ts +3 -2
  214. package/build/video/effects/colorMatrix.d.ts.map +1 -1
  215. package/build/video/effects/desaturate.d.ts +10 -2
  216. package/build/video/effects/desaturate.d.ts.map +1 -1
  217. package/build/video/effects/dissolve.d.ts +3 -2
  218. package/build/video/effects/dissolve.d.ts.map +1 -1
  219. package/build/video/effects/dropShadow.d.ts +3 -2
  220. package/build/video/effects/dropShadow.d.ts.map +1 -1
  221. package/build/video/effects/flash.d.ts +3 -2
  222. package/build/video/effects/flash.d.ts.map +1 -1
  223. package/build/video/effects/glow.d.ts +3 -2
  224. package/build/video/effects/glow.d.ts.map +1 -1
  225. package/build/video/effects/hologram.d.ts +3 -2
  226. package/build/video/effects/hologram.d.ts.map +1 -1
  227. package/build/video/effects/invert.d.ts +10 -2
  228. package/build/video/effects/invert.d.ts.map +1 -1
  229. package/build/video/effects/outline.d.ts +3 -2
  230. package/build/video/effects/outline.d.ts.map +1 -1
  231. package/build/video/effects/pixelate.d.ts +3 -2
  232. package/build/video/effects/pixelate.d.ts.map +1 -1
  233. package/build/video/effects/radialGradient.d.ts +8 -3
  234. package/build/video/effects/radialGradient.d.ts.map +1 -1
  235. package/build/video/effects/scanline.d.ts +3 -2
  236. package/build/video/effects/scanline.d.ts.map +1 -1
  237. package/build/video/effects/sepia.d.ts +10 -2
  238. package/build/video/effects/sepia.d.ts.map +1 -1
  239. package/build/video/effects/shadereffect.d.ts +10 -4
  240. package/build/video/effects/shadereffect.d.ts.map +1 -1
  241. package/build/video/effects/shine.d.ts +3 -2
  242. package/build/video/effects/shine.d.ts.map +1 -1
  243. package/build/video/effects/tintPulse.d.ts +3 -7
  244. package/build/video/effects/tintPulse.d.ts.map +1 -1
  245. package/build/video/effects/tonemap.d.ts +121 -0
  246. package/build/video/effects/tonemap.d.ts.map +1 -0
  247. package/build/video/effects/vignette.d.ts +3 -2
  248. package/build/video/effects/vignette.d.ts.map +1 -1
  249. package/build/video/effects/wave.d.ts +3 -7
  250. package/build/video/effects/wave.d.ts.map +1 -1
  251. package/build/video/gpu/batcher.d.ts +8 -2
  252. package/build/video/gpu/batcher.d.ts.map +1 -1
  253. package/build/video/gpu/vertexformat.d.ts +26 -0
  254. package/build/video/gpu/vertexformat.d.ts.map +1 -1
  255. package/build/video/gradient.d.ts +1 -1
  256. package/build/video/gradient.d.ts.map +1 -1
  257. package/build/video/renderer.d.ts +111 -7
  258. package/build/video/renderer.d.ts.map +1 -1
  259. package/build/video/renderstate.d.ts +2 -0
  260. package/build/video/renderstate.d.ts.map +1 -1
  261. package/build/video/rendertarget/canvasrendertarget.d.ts +3 -4
  262. package/build/video/rendertarget/canvasrendertarget.d.ts.map +1 -1
  263. package/build/video/rendertarget/render_target_pool.d.ts +0 -1
  264. package/build/video/rendertarget/rendertarget.d.ts +12 -5
  265. package/build/video/rendertarget/rendertarget.d.ts.map +1 -1
  266. package/build/video/rendertarget/webglrendertarget.d.ts +0 -1
  267. package/build/video/rendertarget/webglrendertarget.d.ts.map +1 -1
  268. package/build/video/rendertarget/webgpurendertarget.d.ts +24 -14
  269. package/build/video/rendertarget/webgpurendertarget.d.ts.map +1 -1
  270. package/build/video/texture/atlas.d.ts +2 -1
  271. package/build/video/texture/atlas.d.ts.map +1 -1
  272. package/build/video/texture/cache.d.ts +1 -3
  273. package/build/video/texture/frametexture.d.ts +0 -1
  274. package/build/video/texture/frametexture.d.ts.map +1 -1
  275. package/build/video/texture/noise_texture2d.d.ts +1 -0
  276. package/build/video/texture/noise_texture2d.d.ts.map +1 -1
  277. package/build/video/texture/texture2d.d.ts +6 -0
  278. package/build/video/texture/texture2d.d.ts.map +1 -1
  279. package/build/video/utils/autodetect.d.ts +0 -2
  280. package/build/video/webgl/batchers/batcher.d.ts +0 -9
  281. package/build/video/webgl/batchers/batcher.d.ts.map +1 -1
  282. package/build/video/webgl/batchers/lit_quad_batcher.d.ts +2 -0
  283. package/build/video/webgl/batchers/lit_quad_batcher.d.ts.map +1 -1
  284. package/build/video/webgl/batchers/material_batcher.d.ts +4 -2
  285. package/build/video/webgl/batchers/material_batcher.d.ts.map +1 -1
  286. package/build/video/webgl/batchers/mesh_batcher.d.ts +0 -3
  287. package/build/video/webgl/batchers/mesh_batcher.d.ts.map +1 -1
  288. package/build/video/webgl/batchers/quad_batcher.d.ts +4 -0
  289. package/build/video/webgl/batchers/quad_batcher.d.ts.map +1 -1
  290. package/build/video/webgl/buffer/index.d.ts +0 -1
  291. package/build/video/webgl/buffer/retained_geometry.d.ts +0 -1
  292. package/build/video/webgl/glshader.d.ts +5 -3
  293. package/build/video/webgl/glshader.d.ts.map +1 -1
  294. package/build/video/webgl/renderers/tmxlayer/orthogonal.d.ts +0 -4
  295. package/build/video/webgl/texture/store.d.ts +0 -1
  296. package/build/video/webgl/webgl_renderer.d.ts +63 -24
  297. package/build/video/webgl/webgl_renderer.d.ts.map +1 -1
  298. package/build/video/webgpu/batchers/mesh_batcher.d.ts +0 -3
  299. package/build/video/webgpu/batchers/mesh_batcher.d.ts.map +1 -1
  300. package/build/video/webgpu/batchers/quad_batcher.d.ts +0 -2
  301. package/build/video/webgpu/batchers/quad_batcher.d.ts.map +1 -1
  302. package/build/video/webgpu/batchers/webgpu_batcher.d.ts +0 -2
  303. package/build/video/webgpu/batchers/webgpu_batcher.d.ts.map +1 -1
  304. package/build/video/webgpu/pipeline/cache.d.ts.map +1 -1
  305. package/build/video/webgpu/renderers/tmxlayer/orthogonal.d.ts +0 -2
  306. package/build/video/webgpu/texture/frametexture.d.ts +0 -2
  307. package/build/video/webgpu/texture/frametexture.d.ts.map +1 -1
  308. package/build/video/webgpu/texture/store.d.ts +0 -1
  309. package/build/video/webgpu/webgpu_renderer.d.ts +7 -75
  310. package/build/video/webgpu/webgpu_renderer.d.ts.map +1 -1
  311. package/package.json +2 -2
  312. package/skills/AGENTS.md +1 -1
  313. package/skills/melonjs/SKILL.md +2 -0
  314. package/skills/melonjs-3d/SKILL.md +454 -22
  315. package/skills/melonjs-3d-assets/SKILL.md +111 -10
  316. package/skills/melonjs-audio/SKILL.md +229 -8
  317. package/skills/melonjs-camera-and-drawing/SKILL.md +127 -1
  318. package/skills/melonjs-display-and-scaling/SKILL.md +273 -0
  319. package/skills/melonjs-effects-and-shaders/SKILL.md +341 -29
  320. package/skills/melonjs-events/SKILL.md +8 -6
  321. package/skills/melonjs-input/SKILL.md +147 -7
  322. package/skills/melonjs-math/SKILL.md +313 -0
  323. package/skills/melonjs-particles-and-trails/SKILL.md +189 -13
  324. package/skills/melonjs-performance/SKILL.md +131 -23
  325. package/skills/melonjs-physics/SKILL.md +103 -28
  326. package/skills/melonjs-renderables/SKILL.md +8 -2
  327. package/skills/melonjs-scenes-and-state/SKILL.md +134 -3
  328. package/skills/melonjs-sprites-and-animation/SKILL.md +9 -4
  329. package/skills/melonjs-tilemaps/SKILL.md +40 -12
  330. package/skills/melonjs-ui-and-text/SKILL.md +546 -7
  331. package/build/level/gltf/srgb.d.ts +0 -20
  332. package/build/level/gltf/srgb.d.ts.map +0 -1
@@ -1,3 +1,10 @@
1
+ /**
2
+ * additional import for TypeScript
3
+ * @import CanvasRenderer from "../canvas/canvas_renderer.js";
4
+ * @import WebGLRenderer from "../webgl/webgl_renderer.js";
5
+ * @import WebGPURenderer from "../webgpu/webgpu_renderer.js";
6
+ * @import Renderer from "../renderer.js";
7
+ */
1
8
  /**
2
9
  * A shader effect that applies a warm sepia (vintage photo) tone to the sprite.
3
10
  * @category Effects
@@ -10,11 +17,11 @@
10
17
  */
11
18
  export default class SepiaEffect extends ColorMatrixEffect {
12
19
  /**
13
- * @param {WebGLRenderer|WebGPURenderer|CanvasRenderer} renderer - the current renderer instance
20
+ * @param {Renderer} renderer - the current renderer instance
14
21
  * @param {object} [options] - effect options
15
22
  * @param {number} [options.intensity=1.0] - sepia intensity (0.0 = original, 1.0 = full sepia)
16
23
  */
17
- constructor(renderer: WebGLRenderer | WebGPURenderer | CanvasRenderer, options?: {
24
+ constructor(renderer: Renderer, options?: {
18
25
  intensity?: number | undefined;
19
26
  });
20
27
  intensity: number;
@@ -25,4 +32,5 @@ export default class SepiaEffect extends ColorMatrixEffect {
25
32
  setIntensity(value: number): void;
26
33
  }
27
34
  import ColorMatrixEffect from "./colorMatrix.js";
35
+ import type Renderer from "../renderer.js";
28
36
  //# sourceMappingURL=sepia.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sepia.d.ts","sourceRoot":"","sources":["../../../src/video/effects/sepia.js"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH;IACC;;;;OAIG;IACH,sBAJW,aAAa,GAAC,cAAc,GAAC,cAAc,YAEnD;QAAyB,SAAS;KACpC,EAMA;IAHA,kBACgE;IAIjE;;;OAGG;IACH,oBAFW,MAAM,QAKhB;CACD;8BAjC6B,kBAAkB"}
1
+ {"version":3,"file":"sepia.d.ts","sourceRoot":"","sources":["../../../src/video/effects/sepia.js"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH;;;;;;;;;GASG;AACH;IACC;;;;OAIG;IACH,sBAJW,QAAQ,YAEhB;QAAyB,SAAS;KACpC,EAMA;IAHA,kBACgE;IAIjE;;;OAGG;IACH,oBAFW,MAAM,QAKhB;CACD;8BAxC6B,kBAAkB;0BAOvB,gBAAgB"}
@@ -1,6 +1,6 @@
1
1
  export default class ShaderEffect {
2
2
  /**
3
- * @param {WebGLRenderer|WebGPURenderer|CanvasRenderer} renderer - the current renderer instance
3
+ * @param {Renderer} renderer - the current renderer instance
4
4
  * @param {string|{glsl?: string, wgsl?: string}} body - the effect body:
5
5
  * a GLSL string (containing a `vec4 apply(vec4 color, vec2 uv)` function —
6
6
  * unchanged from previous versions), or an object carrying one body per
@@ -9,9 +9,16 @@ export default class ShaderEffect {
9
9
  * body matching its {@link Renderer#shaderLanguage}; when no matching body
10
10
  * exists the effect warns once and stays disabled (`enabled === false`),
11
11
  * exactly like the Canvas renderer.
12
+ *
13
+ * Written inline, a body is a JavaScript template literal, so it must
14
+ * contain **no backtick anywhere — including in its comments**. One
15
+ * ends the literal, and everything after it is parsed as code, which
16
+ * fails further down the file with an error that names no shader.
17
+ * Quoting an identifier in a comment is the usual way in. A body kept
18
+ * in a `.glsl` / `.wgsl` file and preloaded has no such restriction.
12
19
  * @param {string} [precision=auto detected] - float precision ('lowp', 'mediump' or 'highp'), GLSL only
13
20
  */
14
- constructor(renderer: WebGLRenderer | WebGPURenderer | CanvasRenderer, body: string | {
21
+ constructor(renderer: Renderer, body: string | {
15
22
  glsl?: string;
16
23
  wgsl?: string;
17
24
  }, precision?: string);
@@ -149,7 +156,6 @@ export default class ShaderEffect {
149
156
  */
150
157
  destroy(): void;
151
158
  }
152
- import GLShader from "../webgl/glshader.js";
153
- import WGSLEffectRealization from "./wgsl_realization.js";
159
+ import type Renderer from "../renderer.js";
154
160
  import Texture2d from "../texture/texture2d.ts";
155
161
  //# sourceMappingURL=shadereffect.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shadereffect.d.ts","sourceRoot":"","sources":["../../../src/video/effects/shadereffect.js"],"names":[],"mappings":"AAiJA;IAiCC;;;;;;;;;;;OAWG;IACH,sBAXW,aAAa,GAAC,cAAc,GAAC,cAAc,QAC3C,MAAM,GAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAC,cAQrC,MAAM,EAiKhB;IA3MD;;;;;;OAMG;IACH,SAFU,OAAO,CAED;IAEhB;;;;;;;OAOG;IACH,oBAHU,OAAO,CAGC;IAElB;;;;;;;;;;OAUG;IACH,QAHU,OAAO,CAGF;IAed;;;;;;;OAOG;IACH,eAAyB;IAEzB;;;;;;OAMG;IACH;eA5ByB,MAAM;eAAS,MAAM;MA4BrB;IACzB;;;OAGG;IACH,+BAA2B;IAoB3B;;;;;;;OAOG;IACH,0CAA+B;IAE/B;;;;;OAKG;IACH,0CAA+B;IAE/B;;;;OAIG;IACH,8BAAgC;IAQ/B;;;;;;OAMG;IACH,wBAJU,KAAK,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,CAAC,CAIK;IACpD;;;OAGG;IACH,iBAAkC;IAClC;;;;;;OAMG;IACH,eAA6B;IAC7B;;;OAGG;IACH,mBAAqC;IAErC;;;OAGG;IACH,8BAKC;IAyBD;;;OAGG;IACH,mDAAkC;IAsBpC;;;;OAIG;IACH,uBAsBC;IAjBA;;;OAGG;IACH,2CAAyC;IAe1C;;;;OAIG;IACH,2BAQC;IAED;;;;;;;;;;;;;;OAcG;IACH,iBAbW,MAAM,SACN,MAAM,GAAC,OAAO,GAAC,MAAM,EAAE,GAAC,YAAY,GAAC,MAAM,QAsCrD;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,iBAbW,MAAM,GACJ,YAAY,CAoDxB;IAED;;;;;;;;;;;;OAYG;IACH,gBAJW,MAAM,QA0BhB;IAbC;;;OAGG;IACH,aAAkB;IAWpB;;;;;;;;;;;;;;OAcG;IACH,6BATW,MAAM,gBACN,MAAM,eACN,MAAM,gBACN,MAAM,MACN,MAAM,MACN,MAAM,QAqDhB;IAED;;;;;;;OAOG;IACH,8DAaC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,iBAnBW,MAAM,SACN,SAAS,GAAC,gBAAgB,GAAC,iBAAiB,GAAC,eAAe,GAAC,WAAW,WACxE,QAAQ,GAAC,UAAU,GAAC,UAAU,GAAC,WAAW,GACxC,YAAY,CA0GxB;IAED;;;;;;;;;OASG;IACH,0BAJW,MAAM,QAgGhB;IA/DI;;;OAGG;IACH,4CAAkC;IA6DvC;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,SATa,YAAY,CAsDxB;IAKD;;;OAGG;IACH,aAIC;IAED;;;OAGG;IACH,qCAIC;IAED;;;OAGG;IACH,iEAIC;IAED;;;OAGG;IACH,mCAEC;IAED;;;OAGG;IACH,kBAEC;IAED;;;OAGG;IACH,oBAEC;IAED;;;OAGG;IACH,qBAEC;IAED;;;OAGG;IACH,uBAEC;IAED;;;;OAIG;IACH,gBAyCC;CACD;qBAjhCoB,sBAAsB;kCAET,uBAAuB;sBAHnC,yBAAyB"}
1
+ {"version":3,"file":"shadereffect.d.ts","sourceRoot":"","sources":["../../../src/video/effects/shadereffect.js"],"names":[],"mappings":"AAwJA;IAiCC;;;;;;;;;;;;;;;;;;OAkBG;IACH,sBAlBW,QAAQ,QACR,MAAM,GAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAC,cAerC,MAAM,EAiKhB;IAlND;;;;;;OAMG;IACH,SAFU,OAAO,CAED;IAEhB;;;;;;;OAOG;IACH,oBAHU,OAAO,CAGC;IAElB;;;;;;;;;;OAUG;IACH,QAHU,OAAO,CAGF;IAsBd;;;;;;;OAOG;IACH,oBAAyB;IAEzB;;;;;;OAMG;IACH;eAnCyB,MAAM;eAAS,MAAM;MAmCrB;IACzB;;;OAGG;IACH,+BAA2B;IAoB3B;;;;;;;OAOG;IACH,0CAA+B;IAE/B;;;;;OAKG;IACH,0CAA+B;IAE/B;;;;OAIG;IACH,8BAAgC;IAQ/B;;;;;;OAMG;IACH,wBAJU,KAAK,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,CAAC,CAIK;IACpD;;;OAGG;IACH,iBAAkC;IAClC;;;;;;OAMG;IACH,eAA6B;IAC7B;;;OAGG;IACH,mBAAqC;IAErC;;;OAGG;IACH,8BAKC;IAyBD;;;OAGG;IACH,mDAAkC;IAsBpC;;;;OAIG;IACH,uBAsBC;IAjBA;;;OAGG;IACH,2CAAyC;IAe1C;;;;OAIG;IACH,2BAQC;IAED;;;;;;;;;;;;;;OAcG;IACH,iBAbW,MAAM,SACN,MAAM,GAAC,OAAO,GAAC,MAAM,EAAE,GAAC,YAAY,GAAC,MAAM,QAsCrD;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,iBAbW,MAAM,GACJ,YAAY,CAoDxB;IAED;;;;;;;;;;;;OAYG;IACH,gBAJW,MAAM,QA0BhB;IAbC;;;OAGG;IACH,aAAkB;IAWpB;;;;;;;;;;;;;;OAcG;IACH,6BATW,MAAM,gBACN,MAAM,eACN,MAAM,gBACN,MAAM,MACN,MAAM,MACN,MAAM,QAqDhB;IAED;;;;;;;OAOG;IACH,8DAaC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,iBAnBW,MAAM,SACN,SAAS,GAAC,gBAAgB,GAAC,iBAAiB,GAAC,eAAe,GAAC,WAAW,WACxE,QAAQ,GAAC,UAAU,GAAC,UAAU,GAAC,WAAW,GACxC,YAAY,CA0GxB;IAED;;;;;;;;;OASG;IACH,0BAJW,MAAM,QAgGhB;IA/DI;;;OAGG;IACH,4CAAkC;IA6DvC;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,SATa,YAAY,CAsDxB;IAKD;;;OAGG;IACH,aAIC;IAED;;;OAGG;IACH,qCAIC;IAED;;;OAGG;IACH,iEAIC;IAED;;;OAGG;IACH,mCAEC;IAED;;;OAGG;IACH,kBAEC;IAED;;;OAGG;IACH,oBAEC;IAED;;;OAGG;IACH,qBAEC;IAED;;;OAGG;IACH,uBAEC;IAED;;;;OAIG;IACH,gBAyCC;CACD;0BAthCwB,gBAAgB;qBATpB,sBAAsB;kCAET,uBAAuB;sBAHnC,yBAAyB"}
@@ -36,7 +36,7 @@
36
36
  */
37
37
  export default class ShineEffect extends ShaderEffect {
38
38
  /**
39
- * @param {WebGLRenderer|WebGPURenderer|CanvasRenderer} renderer - the current renderer instance
39
+ * @param {Renderer} renderer - the current renderer instance
40
40
  * @param {object} [options] - effect options
41
41
  * @param {number[]} [options.color=[1.0, 1.0, 1.0]] - shine color as [r, g, b] (0.0–1.0)
42
42
  * @param {number} [options.speed=0.5] - sweeps per second
@@ -47,7 +47,7 @@ export default class ShineEffect extends ShaderEffect {
47
47
  * @param {number} [options.pulseDepth=0.0] - subtle base-brightness pulse amplitude (0 disables the pulse)
48
48
  * @param {number} [options.pulseSpeed=3.0] - pulse oscillation rate (radians/second)
49
49
  */
50
- constructor(renderer: WebGLRenderer | WebGPURenderer | CanvasRenderer, options?: {
50
+ constructor(renderer: Renderer, options?: {
51
51
  color?: number[] | undefined;
52
52
  speed?: number | undefined;
53
53
  width?: number | undefined;
@@ -79,4 +79,5 @@ export default class ShineEffect extends ShaderEffect {
79
79
  setBands(value: number): void;
80
80
  }
81
81
  import ShaderEffect from "./shadereffect.js";
82
+ import type Renderer from "../renderer.js";
82
83
  //# sourceMappingURL=shine.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shine.d.ts","sourceRoot":"","sources":["../../../src/video/effects/shine.js"],"names":[],"mappings":"AA2CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH;IACC;;;;;;;;;;;OAWG;IACH,sBAXW,aAAa,GAAC,cAAc,GAAC,cAAc,YAEnD;QAA2B,KAAK;QACP,KAAK;QACL,KAAK;QACL,SAAS;QACT,KAAK;QACL,KAAK;QACL,UAAU;QACV,UAAU;KACrC,EAgEA;IAED;;;OAGG;IACH,gBAFW,MAAM,EAAE,QAIlB;IAED;;;OAGG;IACH,gBAFW,MAAM,QAIhB;IAED;;;OAGG;IACH,oBAFW,MAAM,QAIhB;IAED;;;OAGG;IACH,gBAFW,MAAM,QAIhB;CACD;yBA5LwB,mBAAmB"}
1
+ {"version":3,"file":"shine.d.ts","sourceRoot":"","sources":["../../../src/video/effects/shine.js"],"names":[],"mappings":"AAkDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH;IACC;;;;;;;;;;;OAWG;IACH,sBAXW,QAAQ,YAEhB;QAA2B,KAAK;QACP,KAAK;QACL,KAAK;QACL,SAAS;QACT,KAAK;QACL,KAAK;QACL,UAAU;QACV,UAAU;KACrC,EAgEA;IAED;;;OAGG;IACH,gBAFW,MAAM,EAAE,QAIlB;IAED;;;OAGG;IACH,gBAFW,MAAM,QAIhB;IAED;;;OAGG;IACH,oBAFW,MAAM,QAIhB;IAED;;;OAGG;IACH,gBAFW,MAAM,QAIhB;CACD;yBAnMwB,mBAAmB;0BAOnB,gBAAgB"}
@@ -17,22 +17,17 @@
17
17
  */
18
18
  export default class TintPulseEffect extends ShaderEffect {
19
19
  /**
20
- * @param {WebGLRenderer|WebGPURenderer|CanvasRenderer} renderer - the current renderer instance
20
+ * @param {Renderer} renderer - the current renderer instance
21
21
  * @param {object} [options] - effect options
22
22
  * @param {number[]} [options.color=[1.0, 0.0, 0.0]] - pulse color as [r, g, b] (0.0–1.0)
23
23
  * @param {number} [options.speed=2.0] - pulse speed (oscillations per second)
24
24
  * @param {number} [options.intensity=0.3] - maximum tint strength (0.0–1.0)
25
25
  */
26
- constructor(renderer: WebGLRenderer | WebGPURenderer | CanvasRenderer, options?: {
26
+ constructor(renderer: Renderer, options?: {
27
27
  color?: number[] | undefined;
28
28
  speed?: number | undefined;
29
29
  intensity?: number | undefined;
30
30
  });
31
- /**
32
- * set the current time (call each frame for animation)
33
- * @param {number} time - time in seconds
34
- */
35
- setTime(time: number): void;
36
31
  /**
37
32
  * set the pulse color
38
33
  * @param {number[]} color - pulse color as [r, g, b] (0.0–1.0)
@@ -40,4 +35,5 @@ export default class TintPulseEffect extends ShaderEffect {
40
35
  setColor(color: number[]): void;
41
36
  }
42
37
  import ShaderEffect from "./shadereffect.js";
38
+ import type Renderer from "../renderer.js";
43
39
  //# sourceMappingURL=tintPulse.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tintPulse.d.ts","sourceRoot":"","sources":["../../../src/video/effects/tintPulse.js"],"names":[],"mappings":"AAmBA;;;;;;;;;;;;;;;;GAgBG;AACH;IACC;;;;;;OAMG;IACH,sBANW,aAAa,GAAC,cAAc,GAAC,cAAc,YAEnD;QAA2B,KAAK;QACP,KAAK;QACL,SAAS;KACpC,EAqBA;IAED;;;OAGG;IACH,cAFW,MAAM,QAIhB;IAED;;;OAGG;IACH,gBAFW,MAAM,EAAE,QAIlB;CACD;yBAjFwB,mBAAmB"}
1
+ {"version":3,"file":"tintPulse.d.ts","sourceRoot":"","sources":["../../../src/video/effects/tintPulse.js"],"names":[],"mappings":"AA0BA;;;;;;;;;;;;;;;;GAgBG;AACH;IACC;;;;;;OAMG;IACH,sBANW,QAAQ,YAEhB;QAA2B,KAAK;QACP,KAAK;QACL,SAAS;KACpC,EAqBA;IAED;;;OAGG;IACH,gBAFW,MAAM,EAAE,QAIlB;CACD;yBAhFwB,mBAAmB;0BAOnB,gBAAgB"}
@@ -0,0 +1,121 @@
1
+ export namespace CURVES {
2
+ namespace reinhard {
3
+ let glsl: string;
4
+ let wgsl: string;
5
+ function fn(c: number): number;
6
+ }
7
+ namespace aces {
8
+ let glsl_1: string;
9
+ export { glsl_1 as glsl };
10
+ let wgsl_1: string;
11
+ export { wgsl_1 as wgsl };
12
+ export function fn_1(c: number): number;
13
+ export { fn_1 as fn };
14
+ }
15
+ namespace exponential {
16
+ let glsl_2: string;
17
+ export { glsl_2 as glsl };
18
+ let wgsl_2: string;
19
+ export { wgsl_2 as wgsl };
20
+ export function fn_2(c: number): number;
21
+ export { fn_2 as fn };
22
+ }
23
+ }
24
+ /**
25
+ * A shader effect that tone maps what it is applied to: values are lifted by
26
+ * `exposure` and brought back into display range by a curve, instead of
27
+ * clipping flat at white.
28
+ *
29
+ * Put it on the CAMERA, and put it LAST — after {@link BloomEffect}, so the
30
+ * light bloom spreads is mapped along with everything else rather than
31
+ * clipping where the two overlap.
32
+ *
33
+ * Three curves, chosen once at construction:
34
+ *
35
+ * | `mode` | character |
36
+ * |---|---|
37
+ * | `"aces"` | filmic: more midtone contrast, long shoulder. The default. Clamps internally, so it cannot feed `hdrOutput` |
38
+ * | `"reinhard"` | gentle and neutral, desaturates highlights as they climb |
39
+ * | `"exponential"` | channels saturate separately, so a hot core shifts toward white through its own hue |
40
+ *
41
+ * **Without `hdr: true` it is a grade, not a colour-managed pipeline.** The
42
+ * default render targets are `RGBA8`, so the frame reaching this is already
43
+ * clamped to `[0, 1]` and `exposure` is what gives the curve something to
44
+ * work on. With the `hdr` application setting on, the targets are half-float
45
+ * and the values arriving are genuinely above 1, which is what the curve is
46
+ * for. Either way it does not convert linear to sRGB, because nothing
47
+ * linearized it.
48
+ * @category Effects
49
+ * @see {@link Renderable#addPostEffect} for usage
50
+ * @example
51
+ * // the usual pairing: spread the bright parts, then map the result
52
+ * game.viewport.addPostEffect(new BloomEffect(renderer));
53
+ * game.viewport.addPostEffect(new ToneMappingEffect(renderer, { exposure: 1.6 }));
54
+ *
55
+ * @example
56
+ * // a hot core that shifts through its own colour on the way to white
57
+ * const grade = new ToneMappingEffect(renderer, {
58
+ * mode: "exponential",
59
+ * exposure: 2.2,
60
+ * });
61
+ * game.viewport.addPostEffect(grade);
62
+ * // and dip it for a moment when the player is hit
63
+ * grade.setExposure(0.7);
64
+ */
65
+ export default class ToneMappingEffect extends ShaderEffect {
66
+ /**
67
+ * @param {Renderer} renderer - the current renderer instance
68
+ * @param {object} [options] - effect options
69
+ * @param {string} [options.mode="aces"] - curve: `"aces"`, `"reinhard"` or `"exponential"`
70
+ * @param {number} [options.exposure=1.0] - multiplier applied before the curve; above `1` lifts the image into the curve's shoulder
71
+ * @param {number} [options.white] - the post-exposure value that should come out as display white. Omitted, the curve keeps its own shoulder and nothing reaches 1 exactly
72
+ * @throws {Error} on an unknown `mode`, or a non-finite `exposure` or `white`
73
+ */
74
+ constructor(renderer: Renderer, options?: {
75
+ mode?: string | undefined;
76
+ exposure?: number | undefined;
77
+ white?: number | undefined;
78
+ });
79
+ /**
80
+ * which curve this instance baked, for reading back
81
+ * @type {string}
82
+ * @readonly
83
+ */
84
+ readonly mode: string;
85
+ /**
86
+ * The post-exposure value that comes out as display white, or `0`
87
+ * when the curve is left with its own shoulder.
88
+ * @type {number}
89
+ * @readonly
90
+ */
91
+ readonly white: number;
92
+ /**
93
+ * Set the white point: the value that should come out as display white.
94
+ *
95
+ * This is the knob a "brightness" or "peak" slider in a settings screen
96
+ * drives. Without it a tone curve only approaches 1 asymptotically, so
97
+ * nothing in the frame is ever quite white and a player who wants a
98
+ * brighter picture can only raise `exposure`, which lifts the midtones
99
+ * with it. A white point moves where the shoulder lands instead.
100
+ *
101
+ * Implemented as a scale rather than a reshaped curve: the value is run
102
+ * through the same curve on the CPU and the shader multiplies by its
103
+ * reciprocal, so `white` maps to exactly 1 and everything under it keeps
104
+ * the curve's shape. Values above it clip, which is what "white point"
105
+ * means.
106
+ * @param {number} white - the value to map to white; `0` or less restores the curve's own shoulder
107
+ * @throws {Error} if `white` is not a finite number
108
+ */
109
+ setWhite(white: number): void;
110
+ /**
111
+ * set the exposure. Cheap, and safe to drive per frame: it is a uniform,
112
+ * so changing it does not rebuild the program the way `mode` would.
113
+ * @param {number} exposure - multiplier applied before the curve; `0` maps everything to black
114
+ * @throws {Error} if `exposure` is not a finite number
115
+ */
116
+ setExposure(exposure: number): void;
117
+ exposure: number | undefined;
118
+ }
119
+ import ShaderEffect from "./shadereffect.js";
120
+ import type Renderer from "../renderer.js";
121
+ //# sourceMappingURL=tonemap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tonemap.d.ts","sourceRoot":"","sources":["../../../src/video/effects/tonemap.js"],"names":[],"mappings":";;;;QAwEM,eAHO,MAAM,GACJ,MAAM,CAIlB;;;;;;;QAkBG,wBADQ,MAAM,GAA0B,MAAM,CAMjD;;;;;;;;QAWG,wBADQ,MAAM,GAA0B,MAAM,CAGjD;;;;AA6FH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH;IACC;;;;;;;OAOG;IACH,sBAPW,QAAQ,YAEhB;QAAyB,IAAI;QACJ,QAAQ;QACR,KAAK;KAC9B,EAuCF;IAhBA;;;;OAIG;IACH,eAHU,MAAM,CAGA;IAGhB;;;;;OAKG;IACH,gBAHU,MAAM,CAGF;IAIf;;;;;;;;;;;;;;;;OAgBG;IACH,gBAHW,MAAM,QAUhB;IAED;;;;;OAKG;IACH,sBAHW,MAAM,QAOhB;IAFA,6BAAqC;CAGtC;yBAzUwB,mBAAmB;0BAOnB,gBAAgB"}
@@ -16,12 +16,12 @@
16
16
  */
17
17
  export default class VignetteEffect extends ShaderEffect {
18
18
  /**
19
- * @param {WebGLRenderer|WebGPURenderer|CanvasRenderer} renderer - the current renderer instance
19
+ * @param {Renderer} renderer - the current renderer instance
20
20
  * @param {object} [options] - effect options
21
21
  * @param {number} [options.strength=0.15] - edge darkening power (lower = stronger darkening, higher = softer falloff)
22
22
  * @param {number} [options.size=25.0] - vignette spread multiplier (higher = smaller dark area)
23
23
  */
24
- constructor(renderer: WebGLRenderer | WebGPURenderer | CanvasRenderer, options?: {
24
+ constructor(renderer: Renderer, options?: {
25
25
  strength?: number | undefined;
26
26
  size?: number | undefined;
27
27
  });
@@ -39,4 +39,5 @@ export default class VignetteEffect extends ShaderEffect {
39
39
  setSize(size: number): void;
40
40
  }
41
41
  import ShaderEffect from "./shadereffect.js";
42
+ import type Renderer from "../renderer.js";
42
43
  //# sourceMappingURL=vignette.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"vignette.d.ts","sourceRoot":"","sources":["../../../src/video/effects/vignette.js"],"names":[],"mappings":"AA6BA;;;;;;;;;;;;;;;GAeG;AACH;IACC;;;;;OAKG;IACH,sBALW,aAAa,GAAC,cAAc,GAAC,cAAc,YAEnD;QAAyB,QAAQ;QACR,IAAI;KAC/B,EASA;IALA,iBAAwC;IACxC,aAAgC;IAMjC;;;OAGG;IACH,sBAFW,MAAM,QAKhB;IAED;;;OAGG;IACH,cAFW,MAAM,QAKhB;CACD;yBA/EwB,mBAAmB"}
1
+ {"version":3,"file":"vignette.d.ts","sourceRoot":"","sources":["../../../src/video/effects/vignette.js"],"names":[],"mappings":"AAoCA;;;;;;;;;;;;;;;GAeG;AACH;IACC;;;;;OAKG;IACH,sBALW,QAAQ,YAEhB;QAAyB,QAAQ;QACR,IAAI;KAC/B,EASA;IALA,iBAAwC;IACxC,aAAgC;IAMjC;;;OAGG;IACH,sBAFW,MAAM,QAKhB;IAED;;;OAGG;IACH,cAFW,MAAM,QAKhB;CACD;yBAtFwB,mBAAmB;0BAOnB,gBAAgB"}
@@ -12,22 +12,17 @@
12
12
  */
13
13
  export default class WaveEffect extends ShaderEffect {
14
14
  /**
15
- * @param {WebGLRenderer|WebGPURenderer|CanvasRenderer} renderer - the current renderer instance
15
+ * @param {Renderer} renderer - the current renderer instance
16
16
  * @param {object} [options] - effect options
17
17
  * @param {number} [options.amplitude=0.01] - wave displacement strength (in UV space, 0.01 = subtle)
18
18
  * @param {number} [options.frequency=10.0] - number of waves across the sprite
19
19
  * @param {number} [options.speed=2.0] - wave animation speed
20
20
  */
21
- constructor(renderer: WebGLRenderer | WebGPURenderer | CanvasRenderer, options?: {
21
+ constructor(renderer: Renderer, options?: {
22
22
  amplitude?: number | undefined;
23
23
  frequency?: number | undefined;
24
24
  speed?: number | undefined;
25
25
  });
26
- /**
27
- * set the current time (call each frame for animation)
28
- * @param {number} time - time in seconds
29
- */
30
- setTime(time: number): void;
31
26
  /**
32
27
  * set the wave amplitude
33
28
  * @param {number} amplitude - displacement strength in UV space
@@ -40,4 +35,5 @@ export default class WaveEffect extends ShaderEffect {
40
35
  setFrequency(frequency: number): void;
41
36
  }
42
37
  import ShaderEffect from "./shadereffect.js";
38
+ import type Renderer from "../renderer.js";
43
39
  //# sourceMappingURL=wave.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"wave.d.ts","sourceRoot":"","sources":["../../../src/video/effects/wave.js"],"names":[],"mappings":"AAoBA;;;;;;;;;;;GAWG;AACH;IACC;;;;;;OAMG;IACH,sBANW,aAAa,GAAC,cAAc,GAAC,cAAc,YAEnD;QAAyB,SAAS;QACT,SAAS;QACT,KAAK;KAChC,EAqBA;IAED;;;OAGG;IACH,cAFW,MAAM,QAIhB;IAED;;;OAGG;IACH,wBAFW,MAAM,QAIhB;IAED;;;OAGG;IACH,wBAFW,MAAM,QAIhB;CACD;yBArFwB,mBAAmB"}
1
+ {"version":3,"file":"wave.d.ts","sourceRoot":"","sources":["../../../src/video/effects/wave.js"],"names":[],"mappings":"AA2BA;;;;;;;;;;;GAWG;AACH;IACC;;;;;;OAMG;IACH,sBANW,QAAQ,YAEhB;QAAyB,SAAS;QACT,SAAS;QACT,KAAK;KAChC,EAqBA;IAED;;;OAGG;IACH,wBAFW,MAAM,QAIhB;IAED;;;OAGG;IACH,wBAFW,MAAM,QAIhB;CACD;yBApFwB,mBAAmB;0BAOnB,gBAAgB"}
@@ -24,10 +24,16 @@ export class Batcher {
24
24
  * Initialize (or re-initialize after a context/device loss) this batcher.
25
25
  * Derived classes override this with their full `(renderer, settings)`
26
26
  * signature and own the whole body; the base implementation only stores
27
- * the renderer reference.
27
+ * the renderer reference and ignores the settings.
28
+ *
29
+ * `settings` is declared here even though this body does not read it: a
30
+ * subclass cannot add a required parameter the base does not have without
31
+ * breaking substitutability, and the backends all take one.
28
32
  * @param {Renderer} renderer - the owning renderer
33
+ * @param {object} [settings] - backend-specific batcher settings, owned
34
+ * and documented by the derived class
29
35
  */
30
- init(renderer: Renderer): void;
36
+ init(renderer: Renderer, settings?: object): void;
31
37
  /**
32
38
  * the renderer this batcher is bound to
33
39
  * @type {Renderer}
@@ -1 +1 @@
1
- {"version":3,"file":"batcher.d.ts","sourceRoot":"","sources":["../../../src/video/gpu/batcher.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;GAQG;AACH,mCAAoC,IAAI,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;GAmBG;AACH;IAMC;;;;;;OAMG;IACH,eAFW,QAAQ,QAQlB;IALA;;;OAGG;IACH,+BAAwB;IAGzB;;OAEG;IACH,aAAS;IAET;;OAEG;IACH,eAAW;IAEX;;OAEG;IACH,cAAU;IAEV;;OAEG;IACH,cAAU;IAEV;;OAEG;IACH,gBAAY;CACZ;;0BA/EwB,gBAAgB"}
1
+ {"version":3,"file":"batcher.d.ts","sourceRoot":"","sources":["../../../src/video/gpu/batcher.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;GAQG;AACH,mCAAoC,IAAI,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;GAmBG;AACH;IAMC;;;;;;;;;;;;OAYG;IAEH,eALW,QAAQ,aACR,MAAM,QAUhB;IALA;;;OAGG;IACH,+BAAwB;IAGzB;;OAEG;IACH,aAAS;IAET;;OAEG;IACH,eAAW;IAEX;;OAEG;IACH,cAAU;IAEV;;OAEG;IACH,cAAU;IAEV;;OAEG;IACH,gBAAY;CACZ;;0BAtFwB,gBAAgB"}
@@ -1,3 +1,7 @@
1
+ /**
2
+ * additional import for TypeScript
3
+ * @import {VertexScalar} from "./vertexformat.ts";
4
+ */
1
5
  /**
2
6
  * Backend-neutral vertex attribute formats.
3
7
  *
@@ -18,6 +22,10 @@
18
22
  * import it without pulling in the WebGL layer.
19
23
  * @see {@link Batcher#addAttribute}
20
24
  */
25
+ /**
26
+ * The scalar component type underlying a {@link VertexFormat}.
27
+ */
28
+ export type VertexScalar = "float32" | "uint8" | "sint8" | "unorm8" | "snorm8" | "uint16" | "sint16" | "unorm16" | "snorm16" | "uint32" | "sint32";
21
29
  /**
22
30
  * A vertex attribute format: component type and count.
23
31
  *
@@ -28,6 +36,24 @@
28
36
  * indefinitely.
29
37
  */
30
38
  export type VertexFormat = "float32" | "float32x2" | "float32x3" | "float32x4" | "uint8" | "uint8x2" | "uint8x4" | "sint8" | "sint8x2" | "sint8x4" | "unorm8" | "unorm8x2" | "unorm8x4" | "snorm8" | "snorm8x2" | "snorm8x4" | "uint16" | "uint16x2" | "uint16x4" | "sint16" | "sint16x2" | "sint16x4" | "unorm16" | "unorm16x2" | "unorm16x4" | "snorm16" | "snorm16x2" | "snorm16x4" | "uint32" | "uint32x2" | "uint32x3" | "uint32x4" | "sint32" | "sint32x2" | "sint32x3" | "sint32x4";
39
+ /**
40
+ * What a {@link VertexFormat} resolves to.
41
+ *
42
+ * Public, because the exported `resolveVertexFormat()` returns it. Marked
43
+ * internal it was stripped from the declarations while that public signature
44
+ * kept naming it, which left the name unresolved and quietly turned the
45
+ * function's return type into `any` for every consumer.
46
+ */
47
+ export interface VertexFormatInfo {
48
+ /** number of components (1, 2, 3 or 4) */
49
+ components: 1 | 2 | 3 | 4;
50
+ /** total size of the attribute in bytes */
51
+ bytes: number;
52
+ /** whether integer values are scaled into `[0, 1]` / `[-1, 1]` when read by a shader */
53
+ normalized: boolean;
54
+ /** the underlying scalar type */
55
+ scalar: VertexScalar;
56
+ }
31
57
  /**
32
58
  * Whether a value is a supported vertex format name.
33
59
  * @param value - the value to test
@@ -1 +1 @@
1
- {"version":3,"file":"vertexformat.d.ts","sourceRoot":"","sources":["../../../src/video/gpu/vertexformat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAoBH;;;;;;;;GAQG;AACH,MAAM,MAAM,YAAY,GAErB,SAAS,GACT,WAAW,GACX,WAAW,GACX,WAAW,GAEX,OAAO,GACP,SAAS,GACT,SAAS,GACT,OAAO,GACP,SAAS,GACT,SAAS,GAET,QAAQ,GACR,UAAU,GACV,UAAU,GACV,QAAQ,GACR,UAAU,GACV,UAAU,GAEV,QAAQ,GACR,UAAU,GACV,UAAU,GACV,QAAQ,GACR,UAAU,GACV,UAAU,GAEV,SAAS,GACT,WAAW,GACX,WAAW,GACX,SAAS,GACT,WAAW,GACX,WAAW,GAEX,QAAQ,GACR,UAAU,GACV,UAAU,GACV,UAAU,GACV,QAAQ,GACR,UAAU,GACV,UAAU,GACV,UAAU,CAAC;AAkId;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAEpE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,gBAAgB,CAS1E"}
1
+ {"version":3,"file":"vertexformat.d.ts","sourceRoot":"","sources":["../../../src/video/gpu/vertexformat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;GAEG;AACH,MAAM,MAAM,YAAY,GACrB,SAAS,GACT,OAAO,GACP,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,SAAS,GACT,QAAQ,GACR,QAAQ,CAAC;AAEZ;;;;;;;;GAQG;AACH,MAAM,MAAM,YAAY,GAErB,SAAS,GACT,WAAW,GACX,WAAW,GACX,WAAW,GAEX,OAAO,GACP,SAAS,GACT,SAAS,GACT,OAAO,GACP,SAAS,GACT,SAAS,GAET,QAAQ,GACR,UAAU,GACV,UAAU,GACV,QAAQ,GACR,UAAU,GACV,UAAU,GAEV,QAAQ,GACR,UAAU,GACV,UAAU,GACV,QAAQ,GACR,UAAU,GACV,UAAU,GAEV,SAAS,GACT,WAAW,GACX,WAAW,GACX,SAAS,GACT,WAAW,GACX,WAAW,GAEX,QAAQ,GACR,UAAU,GACV,UAAU,GACV,UAAU,GACV,QAAQ,GACR,UAAU,GACV,UAAU,GACV,UAAU,CAAC;AAEd;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB;IAChC,0CAA0C;IAC1C,UAAU,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC1B,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,wFAAwF;IACxF,UAAU,EAAE,OAAO,CAAC;IACpB,iCAAiC;IACjC,MAAM,EAAE,YAAY,CAAC;CACrB;AAkHD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAEpE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,gBAAgB,CAS1E"}
@@ -1,3 +1,4 @@
1
+
1
2
  /**
2
3
  * A Gradient object representing a linear or radial gradient fill.
3
4
  * Created via {@link Renderer#createLinearGradient} or {@link Renderer#createRadialGradient}.
@@ -58,6 +59,5 @@ export class Gradient {
58
59
  */
59
60
  destroy(): void;
60
61
  }
61
- import CanvasRenderTarget from "./rendertarget/canvasrendertarget.js";
62
62
  import type { Color } from "../math/color.ts";
63
63
  //# sourceMappingURL=gradient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"gradient.d.ts","sourceRoot":"","sources":["../../src/video/gradient.js"],"names":[],"mappings":"AAmCA;;;;GAIG;AACH;IACC;;;OAGG;IACH,kBAHW,QAAQ,GAAC,QAAQ,UACjB,MAAM,EAAE,EA8DlB;IA3DA;;;OAGG;IACH;;;OAGG;IACH,YAA2B;IAE3B,0BAAgB;IAEhB;;;;;OAKG;IACH,QAJU,MAAM,EAAE,CAIE;IAEpB;;;;;OAKG;IACH,YAJU,KAAK,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC,CAI5B;IAEpB;;;;;OAKG;IACH,iBAJU,cAAc,GAAC,SAAS,CAIF;IAEhC;;;;;OAKG;IACH,eAJU,kBAAkB,GAAC,SAAS,CAIR;IAE9B;;;;;OAKG;IACH,QAJU,OAAO,CAIC;IAElB;;;;;OAKG;IACH,cAJU;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,KAAK,CAAA;KAAC,EAAE,GAAC,IAAI,CAIvB;IAGzB;;;;;;;;;OASG;IACH,qBARW,MAAM,SACN,KAAK,GAAC,MAAM,GACV,QAAQ,CA0BpB;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,0BAVW,wBAAwB,GACtB,cAAc,CAuC1B;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,mBATW,cAAc,GAAC,aAAa,KAC5B,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,GACJ;QAAC,MAAM,EAAE,iBAAiB,GAAC,eAAe,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,CAyFtF;IAED;;;;;;;;;;;OAWG;IACH,qBATW,MAAM,OACN,KAAK,GACH,KAAK,CA+CjB;IAED;;;;OAIG;IACH,0BAWC;IAED;;OAEG;IACH,gBAOC;CACD;+BAvX8B,sCAAsC;2BAF7C,kBAAkB"}
1
+ {"version":3,"file":"gradient.d.ts","sourceRoot":"","sources":["../../src/video/gradient.js"],"names":[],"mappings":"AA8XA;;;;;;;;;;;;;;;;;GAiBG;AACH,6CANG;IAAyE,QAAQ;aAAhD,MAAM;eAAS,MAAM,GAAC,KAAK;;IAC7B,KAAK;CACpC,GAAU,QAAQ,CAiCpB;AA1YD;;;;GAIG;AACH;IACC;;;OAGG;IACH,kBAHW,QAAQ,GAAC,QAAQ,UACjB,MAAM,EAAE,EA8DlB;IA3DA;;;OAGG;IACH;;;OAGG;IACH,YAA2B;IAE3B,0BAAgB;IAEhB;;;;;OAKG;IACH,QAJU,MAAM,EAAE,CAIE;IAEpB;;;;;OAKG;IACH,YAJU,KAAK,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC,CAI5B;IAEpB;;;;;OAKG;IACH,iBAJU,cAAc,GAAC,SAAS,CAIF;IAEhC;;;;;OAKG;IACH,eAJU,kBAAkB,GAAC,SAAS,CAIR;IAE9B;;;;;OAKG;IACH,QAJU,OAAO,CAIC;IAElB;;;;;OAKG;IACH,cAJU;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,KAAK,CAAA;KAAC,EAAE,GAAC,IAAI,CAIvB;IAGzB;;;;;;;;;OASG;IACH,qBARW,MAAM,SACN,KAAK,GAAC,MAAM,GACV,QAAQ,CA0BpB;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,0BAVW,wBAAwB,GACtB,cAAc,CAuC1B;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,mBATW,QAAQ,KACR,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,GACJ;QAAC,MAAM,EAAE,iBAAiB,GAAC,eAAe,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,CAyFtF;IAED;;;;;;;;;;;OAWG;IACH,qBATW,MAAM,OACN,KAAK,GACH,KAAK,CA+CjB;IAED;;;;OAIG;IACH,0BAWC;IAED;;OAEG;IACH,gBAOC;CACD;2BAzXuB,kBAAkB;+BAEX,sCAAsC"}
@@ -104,6 +104,42 @@ declare class Renderer {
104
104
  * @default false
105
105
  */
106
106
  supportsShaderTileLayers: boolean;
107
+ /**
108
+ * Whether the effect chain is carrying color values above 1 instead
109
+ * of clamping at every write. This is what the `hdr` application
110
+ * setting asked for and what it actually GOT: a GPU backend sets it
111
+ * when the setting is on and the driver can honour it, and leaves it
112
+ * `false` when either is missing. `false` always on the base/Canvas
113
+ * renderer, which has no render targets.
114
+ *
115
+ * Branch on this rather than on `settings.hdr` when a grade depends
116
+ * on it, because a look tuned for headroom applied to a chain that
117
+ * clamps is not a lesser version of that look, it is a dark picture.
118
+ *
119
+ * **Headroom through the chain, not HDR output.** The frame is
120
+ * presented in SDR by default, so anything still above 1 clamps on
121
+ * the final blit; what this buys is that nothing clamped BEFORE
122
+ * then, which is what makes a bloom threshold and a tone curve
123
+ * meaningful. To remove that last clamp as well, see
124
+ * {@link Renderer#supportsHDROutput} and the `hdrOutput` setting.
125
+ * @type {boolean}
126
+ * @default false
127
+ */
128
+ supportsHDR: boolean;
129
+ /**
130
+ * Whether the frame is PRESENTED in the display's full dynamic range
131
+ * rather than clamped to SDR on the way to the screen.
132
+ *
133
+ * The difference from {@link Renderer#supportsHDR}: that one is
134
+ * headroom through the effect chain, which still ends in a clamp;
135
+ * this one removes that clamp. Granted, not supported, and expect it
136
+ * to differ per backend on the same machine — only the WebGPU
137
+ * backend can do it, because the WebGL2 equivalent is an unapproved
138
+ * specification change no browser implements.
139
+ * @type {boolean}
140
+ * @default false
141
+ */
142
+ supportsHDROutput: boolean;
107
143
  /**
108
144
  * Whether this renderer backend can keep mesh geometry resident on the
109
145
  * GPU, letting a mesh supply a model matrix instead of vertices it has
@@ -543,6 +579,65 @@ declare class Renderer {
543
579
  * @param {boolean} [enable=false]
544
580
  */
545
581
  setAntiAlias(enable?: boolean): void;
582
+ /**
583
+ * Set the tone curve applied at the end of the camera's chain.
584
+ *
585
+ * The settings-screen entry point: a game can drive this straight from an
586
+ * options menu, and the cheap half is genuinely cheap. Changing `mode`
587
+ * rebuilds one shader, because the curve is baked into it; changing
588
+ * `exposure` or `white` is a uniform write, so either can be driven per
589
+ * frame (dipping exposure when the player is hit, say).
590
+ *
591
+ * **A curve is a look decision, not a companion to `hdr`.** Every curve
592
+ * maps 1 to less than 1, so switching one on will change a game whose art
593
+ * is authored against a clamp. Turn it on for art authored in linear
594
+ * light, or when you want a deliberate grade.
595
+ * @param {"none"|"aces"|"reinhard"|"exponential"} [mode="none"] - the curve, or `"none"` to remove it
596
+ * @param {object} [options] - curve parameters, each left as-is when omitted
597
+ * @param {number} [options.exposure] - multiplier applied before the curve
598
+ * @param {number} [options.white] - the post-exposure value to map to display white; `0` leaves the curve its own shoulder
599
+ * @throws {Error} on an unknown `mode`, or a non-finite `exposure` or `white`
600
+ * @example
601
+ * // straight from a settings screen
602
+ * renderer.setToneMapping(settings.curve, {
603
+ * exposure: settings.brightness,
604
+ * white: settings.peak,
605
+ * });
606
+ *
607
+ * // and off again
608
+ * renderer.setToneMapping("none");
609
+ */
610
+ setToneMapping(mode?: "none" | "aces" | "reinhard" | "exponential", options?: {
611
+ exposure?: number | undefined;
612
+ white?: number | undefined;
613
+ }): void;
614
+ /**
615
+ * Turn the `hdrOutput` application setting on or off at runtime.
616
+ *
617
+ * Records the request. A backend that can honour it overrides this to
618
+ * reconfigure the surface it presents into; read
619
+ * {@link Renderer#supportsHDROutput} afterwards for what was granted,
620
+ * which on every backend but WebGPU is `false`.
621
+ * @param {boolean} [enable=false] - whether to present in the display's full range
622
+ */
623
+ setHDROutput(enable?: boolean): void;
624
+ /**
625
+ * Turn the `hdr` application setting on or off at runtime.
626
+ *
627
+ * Records the request. A backend that can honour it overrides this to
628
+ * also move its render targets, so read {@link Renderer#supportsHDR}
629
+ * afterwards for what was actually granted — asking is not getting, and
630
+ * on this base renderer (and the Canvas one, which has no render targets)
631
+ * the answer is always `false`.
632
+ * @param {boolean} [enable=false] - whether the effect chain should carry
633
+ * values above 1
634
+ * @example
635
+ * renderer.setHDR(true);
636
+ * if (renderer.supportsHDR === false) {
637
+ * // this driver refused: grade for a chain that clamps instead
638
+ * }
639
+ */
640
+ setHDR(enable?: boolean): void;
546
641
  /**
547
642
  * Resolve the default texture filter **mode** for this renderer, decoupled
548
643
  * from {@link Renderer#setAntiAlias} (which controls polygon-edge MSAA on GPU
@@ -572,15 +667,15 @@ declare class Renderer {
572
667
  setProjection(matrix: Matrix3d): void;
573
668
  /**
574
669
  * stroke the given shape
575
- * @param {Rect|RoundRect|Polygon|Line|Ellipse|Bounds} shape - a shape object to stroke
670
+ * @param {Rect|RoundRect|Polygon|Line|Ellipse|Bounds|Box3d|Sphere} [shape] - a shape object to stroke
576
671
  * @param {boolean} [fill=false] - fill the shape with the current color if true
577
672
  */
578
- stroke(shape: Rect | RoundRect | Polygon | Line | Ellipse | Bounds, fill?: boolean): void;
673
+ stroke(shape?: Rect | RoundRect | Polygon | Line | Ellipse | Bounds | Box3d | Sphere, fill?: boolean): void;
579
674
  /**
580
675
  * fill the given shape
581
- * @param {Rect|RoundRect|Polygon|Line|Ellipse|Bounds} shape - a shape object to fill
676
+ * @param {Rect|RoundRect|Polygon|Line|Ellipse|Bounds|Box3d|Sphere} [shape] - a shape object to fill
582
677
  */
583
- fill(shape: Rect | RoundRect | Polygon | Line | Ellipse | Bounds): void;
678
+ fill(shape?: Rect | RoundRect | Polygon | Line | Ellipse | Bounds | Box3d | Sphere): void;
584
679
  /**
585
680
  * tint the given image or canvas using the given color
586
681
  * @param {HTMLImageElement|HTMLCanvasElement|OffscreenCanvas} src - the source image to be tinted
@@ -798,7 +893,11 @@ declare class Renderer {
798
893
  * NOTE the origin differs by backend: WebGL uses framebuffer coords
799
894
  * (**bottom-left** origin), Canvas uses **top-left** — relevant under
800
895
  * `video.AUTO`.
801
- * @returns {Texture2d} a texture holding the captured frame
896
+ * @returns {Texture2d|null} a texture holding the captured frame, or `null`
897
+ * when the backend has no device to capture with. The WebGPU renderer
898
+ * returns null in that case and there is a spec pinning it, so this is the
899
+ * honest contract: declaring a bare `Texture2d` here had every caller
900
+ * skipping a check the implementation can require
802
901
  * @example
803
902
  * effect.setTexture("uScene", renderer.toFrameTexture());
804
903
  */
@@ -810,7 +909,7 @@ declare class Renderer {
810
909
  width: number;
811
910
  height: number;
812
911
  } | undefined;
813
- }): Texture2d;
912
+ }): Texture2d | null;
814
913
  }
815
914
  declare namespace Renderer {
816
915
  let _whitePixel: any;
@@ -818,11 +917,13 @@ declare namespace Renderer {
818
917
  export default Renderer;
819
918
  import CanvasRenderTarget from "./rendertarget/canvasrendertarget.js";
820
919
  import { Vector2d } from "../math/vector2d.ts";
821
- import type RenderTargetPool from "./rendertarget/render_target_pool.js";
920
+ import type ShaderEffect from "./effects/shadereffect.js";
822
921
  import Path2D from "./../geometries/path2d.ts";
922
+ import type Application from "../application/application.ts";
823
923
  import { Color } from "./../math/color.ts";
824
924
  import RenderState from "./renderstate.js";
825
925
  import { Matrix3d } from "../math/matrix3d.ts";
926
+ import type Mesh from "../renderable/mesh.js";
826
927
  import type { Rect } from "./../geometries/rectangle.ts";
827
928
  import { Gradient } from "./gradient.js";
828
929
  import type { Bounds } from "./../physics/bounds.ts";
@@ -830,5 +931,8 @@ import type { RoundRect } from "./../geometries/roundrect.ts";
830
931
  import type { Polygon } from "../geometries/polygon.ts";
831
932
  import type { Line } from "./../geometries/line.ts";
832
933
  import type { Ellipse } from "./../geometries/ellipse.ts";
934
+ import type { Box3d } from "../geometries/box3d.ts";
935
+ import type { Sphere } from "../geometries/sphere.ts";
833
936
  import type { default as Texture2d } from "./texture/texture2d.ts";
937
+ import type { ApplicationSettings } from "../application/settings.ts";
834
938
  //# sourceMappingURL=renderer.d.ts.map