@lightningjs/renderer 2.12.1 → 3.0.0-beta1

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 (323) hide show
  1. package/dist/exports/canvas-shaders.d.ts +10 -0
  2. package/dist/exports/canvas-shaders.js +27 -0
  3. package/dist/exports/canvas-shaders.js.map +1 -0
  4. package/dist/exports/canvas.d.ts +7 -1
  5. package/dist/exports/canvas.js +7 -1
  6. package/dist/exports/canvas.js.map +1 -1
  7. package/dist/exports/index.d.ts +15 -8
  8. package/dist/exports/index.js +7 -4
  9. package/dist/exports/index.js.map +1 -1
  10. package/dist/exports/webgl-shaders.d.ts +11 -0
  11. package/dist/exports/webgl-shaders.js +28 -0
  12. package/dist/exports/webgl-shaders.js.map +1 -0
  13. package/dist/exports/webgl.d.ts +9 -1
  14. package/dist/exports/webgl.js +9 -1
  15. package/dist/exports/webgl.js.map +1 -1
  16. package/dist/src/core/CoreNode.d.ts +19 -5
  17. package/dist/src/core/CoreNode.js +117 -24
  18. package/dist/src/core/CoreNode.js.map +1 -1
  19. package/dist/src/core/CoreShaderManager.d.ts +29 -71
  20. package/dist/src/core/CoreShaderManager.js +110 -97
  21. package/dist/src/core/CoreShaderManager.js.map +1 -1
  22. package/dist/src/core/CoreTextNode.js +1 -1
  23. package/dist/src/core/CoreTextNode.js.map +1 -1
  24. package/dist/src/core/CoreTextureManager.d.ts +13 -7
  25. package/dist/src/core/CoreTextureManager.js +92 -105
  26. package/dist/src/core/CoreTextureManager.js.map +1 -1
  27. package/dist/src/core/Stage.d.ts +15 -16
  28. package/dist/src/core/Stage.js +45 -32
  29. package/dist/src/core/Stage.js.map +1 -1
  30. package/dist/src/core/TextureMemoryManager.d.ts +16 -6
  31. package/dist/src/core/TextureMemoryManager.js +75 -17
  32. package/dist/src/core/TextureMemoryManager.js.map +1 -1
  33. package/dist/src/core/animations/CoreAnimation.d.ts +0 -1
  34. package/dist/src/core/animations/CoreAnimation.js +6 -52
  35. package/dist/src/core/animations/CoreAnimation.js.map +1 -1
  36. package/dist/src/core/lib/ImageWorker.d.ts +1 -1
  37. package/dist/src/core/lib/ImageWorker.js +13 -11
  38. package/dist/src/core/lib/ImageWorker.js.map +1 -1
  39. package/dist/src/core/lib/WebGlContextWrapper.d.ts +67 -54
  40. package/dist/src/core/lib/WebGlContextWrapper.js +126 -157
  41. package/dist/src/core/lib/WebGlContextWrapper.js.map +1 -1
  42. package/dist/src/core/lib/textureCompression.js +0 -1
  43. package/dist/src/core/lib/textureCompression.js.map +1 -1
  44. package/dist/src/core/lib/utils.d.ts +4 -0
  45. package/dist/src/core/lib/utils.js +26 -0
  46. package/dist/src/core/lib/utils.js.map +1 -1
  47. package/dist/src/core/lib/validateImageBitmap.d.ts +6 -0
  48. package/dist/src/core/lib/validateImageBitmap.js +68 -0
  49. package/dist/src/core/lib/validateImageBitmap.js.map +1 -0
  50. package/dist/src/core/platform.js +4 -3
  51. package/dist/src/core/platform.js.map +1 -1
  52. package/dist/src/core/renderers/CoreRenderer.d.ts +11 -21
  53. package/dist/src/core/renderers/CoreRenderer.js +0 -6
  54. package/dist/src/core/renderers/CoreRenderer.js.map +1 -1
  55. package/dist/src/core/renderers/CoreShaderNode.d.ts +59 -0
  56. package/dist/src/core/renderers/CoreShaderNode.js +107 -0
  57. package/dist/src/core/renderers/CoreShaderNode.js.map +1 -0
  58. package/dist/src/core/renderers/CoreShaderProgram.d.ts +4 -0
  59. package/{src/core/renderers/CoreShader.ts → dist/src/core/renderers/CoreShaderProgram.js} +2 -23
  60. package/dist/src/core/renderers/CoreShaderProgram.js.map +1 -0
  61. package/dist/src/core/renderers/canvas/CanvasRenderer.d.ts +36 -0
  62. package/dist/src/core/renderers/canvas/CanvasRenderer.js +212 -0
  63. package/dist/src/core/renderers/canvas/CanvasRenderer.js.map +1 -0
  64. package/dist/src/core/renderers/canvas/CanvasShaderNode.d.ts +21 -0
  65. package/dist/src/core/renderers/canvas/CanvasShaderNode.js +60 -0
  66. package/dist/src/core/renderers/canvas/CanvasShaderNode.js.map +1 -0
  67. package/dist/src/core/renderers/canvas/CanvasTexture.d.ts +16 -0
  68. package/dist/src/core/renderers/canvas/CanvasTexture.js +123 -0
  69. package/dist/src/core/renderers/canvas/CanvasTexture.js.map +1 -0
  70. package/dist/src/core/renderers/canvas/internal/C2DShaderUtils.d.ts +0 -13
  71. package/dist/src/core/renderers/canvas/internal/C2DShaderUtils.js +192 -113
  72. package/dist/src/core/renderers/canvas/internal/C2DShaderUtils.js.map +1 -1
  73. package/dist/src/core/renderers/canvas/internal/ColorUtils.d.ts +2 -0
  74. package/dist/src/core/renderers/canvas/internal/ColorUtils.js +14 -0
  75. package/dist/src/core/renderers/canvas/internal/ColorUtils.js.map +1 -1
  76. package/dist/src/core/renderers/webgl/WebGlCoreCtxTexture.js +7 -12
  77. package/dist/src/core/renderers/webgl/WebGlCoreCtxTexture.js.map +1 -1
  78. package/dist/src/core/renderers/webgl/WebGlCtxRenderTexture.d.ts +12 -0
  79. package/dist/src/core/renderers/webgl/WebGlCtxRenderTexture.js +55 -0
  80. package/dist/src/core/renderers/webgl/WebGlCtxRenderTexture.js.map +1 -0
  81. package/dist/src/core/renderers/webgl/WebGlCtxSubTexture.d.ts +9 -0
  82. package/dist/src/core/renderers/webgl/WebGlCtxSubTexture.js +38 -0
  83. package/dist/src/core/renderers/webgl/WebGlCtxSubTexture.js.map +1 -0
  84. package/dist/src/core/renderers/webgl/WebGlCtxTexture.d.ts +57 -0
  85. package/dist/src/core/renderers/webgl/WebGlCtxTexture.js +227 -0
  86. package/dist/src/core/renderers/webgl/WebGlCtxTexture.js.map +1 -0
  87. package/dist/src/core/renderers/webgl/WebGlRenderOp.d.ts +36 -0
  88. package/dist/src/core/renderers/webgl/WebGlRenderOp.js +107 -0
  89. package/dist/src/core/renderers/webgl/WebGlRenderOp.js.map +1 -0
  90. package/dist/src/core/renderers/webgl/WebGlRenderer.d.ts +134 -0
  91. package/dist/src/core/renderers/webgl/WebGlRenderer.js +546 -0
  92. package/dist/src/core/renderers/webgl/WebGlRenderer.js.map +1 -0
  93. package/dist/src/core/renderers/webgl/WebGlShaderNode.d.ts +221 -0
  94. package/dist/src/core/renderers/webgl/WebGlShaderNode.js +334 -0
  95. package/dist/src/core/renderers/webgl/WebGlShaderNode.js.map +1 -0
  96. package/dist/src/core/renderers/webgl/WebGlShaderProgram.d.ts +35 -0
  97. package/dist/src/core/renderers/webgl/WebGlShaderProgram.js +195 -0
  98. package/dist/src/core/renderers/webgl/WebGlShaderProgram.js.map +1 -0
  99. package/dist/src/core/renderers/webgl/internal/ShaderUtils.d.ts +32 -5
  100. package/dist/src/core/renderers/webgl/internal/ShaderUtils.js +50 -0
  101. package/dist/src/core/renderers/webgl/internal/ShaderUtils.js.map +1 -1
  102. package/dist/src/core/shaders/canvas/Border.d.ts +9 -0
  103. package/dist/src/core/shaders/canvas/Border.js +57 -0
  104. package/dist/src/core/shaders/canvas/Border.js.map +1 -0
  105. package/dist/src/core/shaders/canvas/HolePunch.d.ts +7 -0
  106. package/dist/src/core/shaders/canvas/HolePunch.js +38 -0
  107. package/dist/src/core/shaders/canvas/HolePunch.js.map +1 -0
  108. package/dist/src/core/shaders/canvas/LinearGradient.d.ts +10 -0
  109. package/dist/src/core/shaders/canvas/LinearGradient.js +46 -0
  110. package/dist/src/core/shaders/canvas/LinearGradient.js.map +1 -0
  111. package/dist/src/core/shaders/canvas/RadialGradient.d.ts +11 -0
  112. package/dist/src/core/shaders/canvas/RadialGradient.js +68 -0
  113. package/dist/src/core/shaders/canvas/RadialGradient.js.map +1 -0
  114. package/dist/src/core/shaders/canvas/Rounded.d.ts +7 -0
  115. package/dist/src/core/shaders/canvas/Rounded.js +33 -0
  116. package/dist/src/core/shaders/canvas/Rounded.js.map +1 -0
  117. package/dist/src/core/shaders/canvas/RoundedWithBorder.d.ts +7 -0
  118. package/dist/src/core/shaders/canvas/RoundedWithBorder.js +35 -0
  119. package/dist/src/core/shaders/canvas/RoundedWithBorder.js.map +1 -0
  120. package/dist/src/core/shaders/canvas/RoundedWithBorderAndShadow.d.ts +8 -0
  121. package/dist/src/core/shaders/canvas/RoundedWithBorderAndShadow.js +39 -0
  122. package/dist/src/core/shaders/canvas/RoundedWithBorderAndShadow.js.map +1 -0
  123. package/dist/src/core/shaders/canvas/RoundedWithShadow.d.ts +7 -0
  124. package/dist/src/core/shaders/canvas/RoundedWithShadow.js +38 -0
  125. package/dist/src/core/shaders/canvas/RoundedWithShadow.js.map +1 -0
  126. package/dist/src/core/shaders/canvas/Shadow.d.ts +8 -0
  127. package/dist/src/core/shaders/canvas/Shadow.js +31 -0
  128. package/dist/src/core/shaders/canvas/Shadow.js.map +1 -0
  129. package/dist/src/core/shaders/canvas/utils/render.d.ts +5 -0
  130. package/dist/src/core/shaders/canvas/utils/render.js +84 -0
  131. package/dist/src/core/shaders/canvas/utils/render.js.map +1 -0
  132. package/dist/src/core/shaders/templates/BorderTemplate.d.ts +37 -0
  133. package/dist/src/core/shaders/templates/BorderTemplate.js +73 -0
  134. package/dist/src/core/shaders/templates/BorderTemplate.js.map +1 -0
  135. package/dist/src/core/shaders/templates/HolePunchTemplate.d.ts +46 -0
  136. package/dist/src/core/shaders/templates/HolePunchTemplate.js +35 -0
  137. package/dist/src/core/shaders/templates/HolePunchTemplate.js.map +1 -0
  138. package/dist/src/core/shaders/templates/LinearGradientTemplate.d.ts +23 -0
  139. package/dist/src/core/shaders/templates/LinearGradientTemplate.js +47 -0
  140. package/dist/src/core/shaders/templates/LinearGradientTemplate.js.map +1 -0
  141. package/dist/src/core/shaders/templates/RadialGradientTemplate.d.ts +31 -0
  142. package/dist/src/core/shaders/templates/RadialGradientTemplate.js +49 -0
  143. package/dist/src/core/shaders/templates/RadialGradientTemplate.js.map +1 -0
  144. package/dist/src/core/shaders/templates/RoundedTemplate.d.ts +29 -0
  145. package/dist/src/core/shaders/templates/RoundedTemplate.js +67 -0
  146. package/dist/src/core/shaders/templates/RoundedTemplate.js.map +1 -0
  147. package/dist/src/core/shaders/templates/RoundedWithBorderAndShadowTemplate.d.ts +7 -0
  148. package/dist/src/core/shaders/templates/RoundedWithBorderAndShadowTemplate.js +24 -0
  149. package/dist/src/core/shaders/templates/RoundedWithBorderAndShadowTemplate.js.map +1 -0
  150. package/dist/src/core/shaders/templates/RoundedWithBorderTemplate.d.ts +6 -0
  151. package/dist/src/core/shaders/templates/RoundedWithBorderTemplate.js +23 -0
  152. package/dist/src/core/shaders/templates/RoundedWithBorderTemplate.js.map +1 -0
  153. package/dist/src/core/shaders/templates/RoundedWithShadowTemplate.d.ts +6 -0
  154. package/dist/src/core/shaders/templates/RoundedWithShadowTemplate.js +23 -0
  155. package/dist/src/core/shaders/templates/RoundedWithShadowTemplate.js.map +1 -0
  156. package/dist/src/core/shaders/templates/ShadowTemplate.d.ts +34 -0
  157. package/dist/src/core/shaders/templates/ShadowTemplate.js +66 -0
  158. package/dist/src/core/shaders/templates/ShadowTemplate.js.map +1 -0
  159. package/dist/src/core/shaders/templates/shaderUtils.d.ts +5 -0
  160. package/dist/src/core/shaders/templates/shaderUtils.js +41 -0
  161. package/dist/src/core/shaders/templates/shaderUtils.js.map +1 -0
  162. package/dist/src/core/shaders/webgl/Border.d.ts +3 -0
  163. package/dist/src/core/shaders/webgl/Border.js +87 -0
  164. package/dist/src/core/shaders/webgl/Border.js.map +1 -0
  165. package/dist/src/core/shaders/webgl/Default.d.ts +2 -0
  166. package/dist/src/core/shaders/webgl/Default.js +86 -0
  167. package/dist/src/core/shaders/webgl/Default.js.map +1 -0
  168. package/dist/src/core/shaders/webgl/DefaultBatched.d.ts +2 -0
  169. package/dist/src/core/shaders/webgl/DefaultBatched.js +104 -0
  170. package/dist/src/core/shaders/webgl/DefaultBatched.js.map +1 -0
  171. package/dist/src/core/shaders/webgl/HolePunch.d.ts +3 -0
  172. package/dist/src/core/shaders/webgl/HolePunch.js +64 -0
  173. package/dist/src/core/shaders/webgl/HolePunch.js.map +1 -0
  174. package/dist/src/core/shaders/webgl/LinearGradient.d.ts +3 -0
  175. package/dist/src/core/shaders/webgl/LinearGradient.js +75 -0
  176. package/dist/src/core/shaders/webgl/LinearGradient.js.map +1 -0
  177. package/dist/src/core/shaders/webgl/RadialGradient.d.ts +3 -0
  178. package/dist/src/core/shaders/webgl/RadialGradient.js +73 -0
  179. package/dist/src/core/shaders/webgl/RadialGradient.js.map +1 -0
  180. package/dist/src/core/shaders/webgl/Rounded.d.ts +7 -0
  181. package/dist/src/core/shaders/webgl/Rounded.js +86 -0
  182. package/dist/src/core/shaders/webgl/Rounded.js.map +1 -0
  183. package/dist/src/core/shaders/webgl/RoundedWithBorder.d.ts +3 -0
  184. package/dist/src/core/shaders/webgl/RoundedWithBorder.js +97 -0
  185. package/dist/src/core/shaders/webgl/RoundedWithBorder.js.map +1 -0
  186. package/dist/src/core/shaders/webgl/RoundedWithBorderAndShadow.d.ts +3 -0
  187. package/dist/src/core/shaders/webgl/RoundedWithBorderAndShadow.js +112 -0
  188. package/dist/src/core/shaders/webgl/RoundedWithBorderAndShadow.js.map +1 -0
  189. package/dist/src/core/shaders/webgl/RoundedWithShadow.d.ts +3 -0
  190. package/dist/src/core/shaders/webgl/RoundedWithShadow.js +84 -0
  191. package/dist/src/core/shaders/webgl/RoundedWithShadow.js.map +1 -0
  192. package/dist/src/core/shaders/webgl/SdfShader.d.ts +32 -0
  193. package/dist/src/core/shaders/webgl/SdfShader.js +116 -0
  194. package/dist/src/core/shaders/webgl/SdfShader.js.map +1 -0
  195. package/dist/src/core/shaders/webgl/Shadow.d.ts +3 -0
  196. package/dist/src/core/shaders/webgl/Shadow.js +110 -0
  197. package/dist/src/core/shaders/webgl/Shadow.js.map +1 -0
  198. package/dist/src/core/text-rendering/TextTextureRendererUtils.js.map +1 -1
  199. package/dist/src/core/text-rendering/font-face-types/SdfTrFontFace/SdfTrFontFace.js +2 -2
  200. package/dist/src/core/text-rendering/font-face-types/SdfTrFontFace/SdfTrFontFace.js.map +1 -1
  201. package/dist/src/core/text-rendering/renderers/LightningTextTextureRenderer.d.ts +6 -0
  202. package/dist/src/core/text-rendering/renderers/LightningTextTextureRenderer.js.map +1 -1
  203. package/dist/src/core/text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.d.ts +2 -3
  204. package/dist/src/core/text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.js +34 -30
  205. package/dist/src/core/text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.js.map +1 -1
  206. package/dist/src/core/text-rendering/renderers/TextRenderer.d.ts +1 -4
  207. package/dist/src/core/text-rendering/renderers/TextRenderer.js.map +1 -1
  208. package/dist/src/core/textures/ImageTexture.js +10 -16
  209. package/dist/src/core/textures/ImageTexture.js.map +1 -1
  210. package/dist/src/core/textures/Texture.d.ts +1 -1
  211. package/dist/src/main-api/INode.d.ts +9 -9
  212. package/dist/src/main-api/Inspector.js +16 -2
  213. package/dist/src/main-api/Inspector.js.map +1 -1
  214. package/dist/src/main-api/Renderer.d.ts +35 -92
  215. package/dist/src/main-api/Renderer.js +11 -57
  216. package/dist/src/main-api/Renderer.js.map +1 -1
  217. package/dist/src/utils.d.ts +6 -0
  218. package/dist/src/utils.js +18 -0
  219. package/dist/src/utils.js.map +1 -1
  220. package/dist/tsconfig.dist.tsbuildinfo +1 -1
  221. package/exports/canvas-shaders.ts +28 -0
  222. package/exports/canvas.ts +7 -1
  223. package/exports/index.ts +17 -17
  224. package/exports/webgl-shaders.ts +28 -0
  225. package/exports/webgl.ts +13 -1
  226. package/package.json +3 -1
  227. package/src/core/CoreNode.test.ts +157 -153
  228. package/src/core/CoreNode.ts +173 -38
  229. package/src/core/CoreShaderManager.ts +127 -226
  230. package/src/core/CoreTextNode.ts +1 -8
  231. package/src/core/CoreTextureManager.ts +127 -126
  232. package/src/core/Stage.ts +62 -44
  233. package/src/core/TextureMemoryManager.ts +108 -27
  234. package/src/core/animations/CoreAnimation.ts +8 -64
  235. package/src/core/lib/ImageWorker.ts +20 -12
  236. package/src/core/lib/WebGlContextWrapper.ts +228 -236
  237. package/src/core/lib/textureCompression.ts +3 -3
  238. package/src/core/lib/utils.ts +51 -0
  239. package/src/core/lib/validateImageBitmap.ts +76 -0
  240. package/src/core/platform.ts +6 -3
  241. package/src/core/renderers/CoreRenderer.ts +19 -27
  242. package/src/core/renderers/CoreShaderNode.ts +171 -0
  243. package/src/core/renderers/{canvas/shaders/UnsupportedShader.ts → CoreShaderProgram.ts} +3 -28
  244. package/src/core/renderers/canvas/CanvasRenderer.ts +299 -0
  245. package/src/core/renderers/canvas/CanvasShaderNode.ts +99 -0
  246. package/src/core/renderers/canvas/{CanvasCoreTexture.ts → CanvasTexture.ts} +1 -1
  247. package/src/core/renderers/canvas/internal/C2DShaderUtils.ts +2 -13
  248. package/src/core/renderers/canvas/internal/ColorUtils.ts +16 -0
  249. package/src/core/renderers/webgl/{WebGlCoreCtxRenderTexture.ts → WebGlCtxRenderTexture.ts} +2 -2
  250. package/src/core/renderers/webgl/{WebGlCoreCtxSubTexture.ts → WebGlCtxSubTexture.ts} +2 -2
  251. package/src/core/renderers/webgl/{WebGlCoreCtxTexture.ts → WebGlCtxTexture.ts} +12 -14
  252. package/src/core/renderers/webgl/{WebGlCoreRenderOp.ts → WebGlRenderOp.ts} +56 -36
  253. package/src/core/renderers/webgl/{WebGlCoreRenderer.ts → WebGlRenderer.ts} +143 -243
  254. package/src/core/renderers/webgl/WebGlShaderNode.ts +433 -0
  255. package/src/core/renderers/webgl/WebGlShaderProgram.ts +310 -0
  256. package/src/core/renderers/webgl/internal/ShaderUtils.ts +143 -5
  257. package/src/core/shaders/canvas/Border.ts +78 -0
  258. package/src/core/shaders/canvas/HolePunch.ts +62 -0
  259. package/src/core/shaders/canvas/LinearGradient.ts +69 -0
  260. package/src/core/shaders/canvas/RadialGradient.ts +113 -0
  261. package/src/core/shaders/canvas/Rounded.ts +55 -0
  262. package/src/core/shaders/canvas/RoundedWithBorder.ts +68 -0
  263. package/src/core/shaders/canvas/RoundedWithBorderAndShadow.ts +88 -0
  264. package/src/core/shaders/canvas/RoundedWithShadow.ts +69 -0
  265. package/src/core/shaders/canvas/Shadow.ts +52 -0
  266. package/src/core/shaders/canvas/utils/render.ts +151 -0
  267. package/src/core/shaders/templates/BorderTemplate.ts +115 -0
  268. package/src/core/shaders/templates/HolePunchTemplate.ts +82 -0
  269. package/src/core/shaders/templates/LinearGradientTemplate.ts +71 -0
  270. package/src/core/shaders/templates/RadialGradientTemplate.ts +81 -0
  271. package/src/core/shaders/templates/RoundedTemplate.ts +98 -0
  272. package/src/core/shaders/templates/RoundedWithBorderAndShadowTemplate.ts +38 -0
  273. package/src/core/shaders/templates/RoundedWithBorderTemplate.ts +35 -0
  274. package/src/core/shaders/templates/RoundedWithShadowTemplate.ts +35 -0
  275. package/src/core/shaders/templates/ShadowTemplate.ts +106 -0
  276. package/src/core/shaders/templates/shaderUtils.ts +47 -0
  277. package/src/core/shaders/webgl/Border.ts +96 -0
  278. package/src/core/shaders/webgl/Default.ts +89 -0
  279. package/src/core/shaders/webgl/DefaultBatched.ts +129 -0
  280. package/src/core/shaders/webgl/HolePunch.ts +78 -0
  281. package/src/core/shaders/webgl/LinearGradient.ts +81 -0
  282. package/src/core/shaders/webgl/RadialGradient.ts +84 -0
  283. package/src/core/shaders/webgl/Rounded.ts +117 -0
  284. package/src/core/shaders/webgl/RoundedWithBorder.ts +114 -0
  285. package/src/core/shaders/webgl/RoundedWithBorderAndShadow.ts +133 -0
  286. package/src/core/shaders/webgl/RoundedWithShadow.ts +98 -0
  287. package/src/core/shaders/webgl/SdfShader.ts +137 -0
  288. package/src/core/shaders/webgl/Shadow.ts +115 -0
  289. package/src/core/text-rendering/TextTextureRendererUtils.ts +1 -1
  290. package/src/core/text-rendering/font-face-types/SdfTrFontFace/SdfTrFontFace.ts +2 -2
  291. package/src/core/text-rendering/renderers/LightningTextTextureRenderer.ts +12 -5
  292. package/src/core/text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.ts +44 -56
  293. package/src/core/text-rendering/renderers/TextRenderer.ts +2 -9
  294. package/src/core/textures/ImageTexture.ts +11 -17
  295. package/src/core/textures/Texture.ts +1 -1
  296. package/src/main-api/INode.ts +11 -13
  297. package/src/main-api/Inspector.ts +19 -2
  298. package/src/main-api/Renderer.ts +59 -130
  299. package/src/utils.ts +19 -0
  300. package/src/core/renderers/canvas/CanvasCoreRenderer.ts +0 -375
  301. package/src/core/renderers/webgl/WebGlCoreShader.ts +0 -362
  302. package/src/core/renderers/webgl/shaders/DefaultShader.ts +0 -93
  303. package/src/core/renderers/webgl/shaders/DefaultShaderBatched.ts +0 -132
  304. package/src/core/renderers/webgl/shaders/DynamicShader.ts +0 -580
  305. package/src/core/renderers/webgl/shaders/RoundedRectangle.ts +0 -167
  306. package/src/core/renderers/webgl/shaders/SdfShader.ts +0 -204
  307. package/src/core/renderers/webgl/shaders/effects/BorderBottomEffect.ts +0 -101
  308. package/src/core/renderers/webgl/shaders/effects/BorderEffect.ts +0 -87
  309. package/src/core/renderers/webgl/shaders/effects/BorderLeftEffect.ts +0 -101
  310. package/src/core/renderers/webgl/shaders/effects/BorderRightEffect.ts +0 -101
  311. package/src/core/renderers/webgl/shaders/effects/BorderTopEffect.ts +0 -101
  312. package/src/core/renderers/webgl/shaders/effects/EffectUtils.ts +0 -159
  313. package/src/core/renderers/webgl/shaders/effects/FadeOutEffect.ts +0 -127
  314. package/src/core/renderers/webgl/shaders/effects/GlitchEffect.ts +0 -148
  315. package/src/core/renderers/webgl/shaders/effects/GrayscaleEffect.ts +0 -67
  316. package/src/core/renderers/webgl/shaders/effects/HolePunchEffect.ts +0 -157
  317. package/src/core/renderers/webgl/shaders/effects/LinearGradientEffect.ts +0 -171
  318. package/src/core/renderers/webgl/shaders/effects/RadialGradientEffect.ts +0 -168
  319. package/src/core/renderers/webgl/shaders/effects/RadialProgressEffect.ts +0 -187
  320. package/src/core/renderers/webgl/shaders/effects/RadiusEffect.ts +0 -110
  321. package/src/core/renderers/webgl/shaders/effects/ShaderEffect.ts +0 -196
  322. package/src/main-api/DynamicShaderController.ts +0 -104
  323. package/src/main-api/ShaderController.ts +0 -80
@@ -0,0 +1,221 @@
1
+ import type { CoreNode } from '../../CoreNode.js';
2
+ import type { WebGlContextWrapper } from '../../lib/WebGlContextWrapper.js';
3
+ import type { Stage } from '../../Stage.js';
4
+ import type { QuadOptions } from '../CoreRenderer.js';
5
+ import { CoreShaderNode, type CoreShaderType } from '../CoreShaderNode.js';
6
+ import type { UniformCollection, Vec2, Vec3, Vec4 } from './internal/ShaderUtils.js';
7
+ import type { WebGlRenderer } from './WebGlRenderer.js';
8
+ import type { WebGlShaderProgram } from './WebGlShaderProgram.js';
9
+ export type ShaderSource<T> = string | ((renderer: WebGlRenderer, props: T) => string);
10
+ /**
11
+ * This is the WebGL specific ShaderType @mixes CoreShaderType
12
+ */
13
+ export type WebGlShaderType<T extends object = Record<string, unknown>> = CoreShaderType<T> & {
14
+ /**
15
+ * fragment shader source for WebGl or WebGl2
16
+ */
17
+ fragment: ShaderSource<T>;
18
+ /**
19
+ * vertex shader source for WebGl or WebGl2
20
+ */
21
+ vertex?: ShaderSource<T>;
22
+ /**
23
+ * This function is called when one of the props is changed, here you can update the uniforms you use in the fragment / vertex shader.
24
+ * @param node WebGlContextWrapper with utilities to update uniforms, and other actions.
25
+ */
26
+ update?: (this: WebGlShaderNode<T>, node: CoreNode) => void;
27
+ /**
28
+ * only used for SDF shader, will be removed in the future.
29
+ *
30
+ * @warning don't use this in your shader type
31
+ */
32
+ onSdfBind?: (this: WebGlContextWrapper, props: T) => void;
33
+ /**
34
+ * This function is used to check if the shader can be reused based on quad info
35
+ * @param props
36
+ */
37
+ canBatch?: (renderOpA: QuadOptions, renderOpB: QuadOptions) => boolean;
38
+ /**
39
+ * extensions required for specific shader?
40
+ */
41
+ webgl1Extensions?: string[];
42
+ webgl2Extensions?: string[];
43
+ supportsIndexedTextures?: boolean;
44
+ };
45
+ export declare class WebGlShaderNode<Props extends object = Record<string, unknown>> extends CoreShaderNode<Props> {
46
+ readonly program: WebGlShaderProgram;
47
+ private updater;
48
+ private valueKey;
49
+ uniforms: UniformCollection;
50
+ constructor(shaderKey: string, config: WebGlShaderType<Props>, program: WebGlShaderProgram, stage: Stage, props?: Props);
51
+ /**
52
+ * Sets the value of a RGBA variable
53
+ * @param location
54
+ * @param value
55
+ */
56
+ uniformRGBA(location: string, value: number): void;
57
+ /**
58
+ * Sets the value of a single float uniform variable.
59
+ *
60
+ * @param location - The location of the uniform variable.
61
+ * @param v0 - The value to set.
62
+ */
63
+ uniform1f(location: string, value: number): void;
64
+ /**
65
+ * Sets the value of a float array uniform variable.
66
+ *
67
+ * @param location - The location of the uniform variable.
68
+ * @param value - The array of values to set.
69
+ */
70
+ uniform1fv(location: string, value: Float32Array): void;
71
+ /**
72
+ * Sets the value of a single integer uniform variable.
73
+ *
74
+ * @param location - The location of the uniform variable.
75
+ * @param v0 - The value to set.
76
+ */
77
+ uniform1i(location: string, value: number): void;
78
+ /**
79
+ * Sets the value of an integer array uniform variable.
80
+ *
81
+ * @param location - The location of the uniform variable.
82
+ * @param value - The array of values to set.
83
+ */
84
+ uniform1iv(location: string, value: Int32Array): void;
85
+ /**
86
+ * Sets the value of a vec2 uniform variable.
87
+ *
88
+ * @param location - The location of the uniform variable.
89
+ * @param v0 - The first component of the vector.
90
+ * @param v1 - The second component of the vector.
91
+ */
92
+ uniform2f(location: string, v0: number, v1: number): void;
93
+ /**
94
+ * Sets the value of a vec2 array uniform variable.
95
+ *
96
+ * @param location - The location of the uniform variable.
97
+ * @param value - The array of vec2 values to set as FloatArray.
98
+ */
99
+ uniform2fv(location: string, value: Float32Array): void;
100
+ /**
101
+ * Sets the value of a vec2 array uniform variable.
102
+ *
103
+ * @param location - The location of the uniform variable.
104
+ * @param value - The array of vec2 values to set.
105
+ */
106
+ uniform2fa(location: string, value: Vec2): void;
107
+ /**
108
+ * Sets the value of a ivec2 uniform variable.
109
+ *
110
+ * @param location - The location of the uniform variable.
111
+ * @param v0 - The first component of the vector.
112
+ * @param v1 - The second component of the vector.
113
+ */
114
+ uniform2i(location: string, v0: number, v1: number): void;
115
+ /**
116
+ * Sets the value of an ivec2 array uniform variable.
117
+ *
118
+ * @param location - The location of the uniform variable.
119
+ * @param value - The array of ivec2 values to set.
120
+ */
121
+ uniform2iv(location: string, value: Int32Array): void;
122
+ /**
123
+ * Sets the value of a vec3 uniform variable.
124
+ *
125
+ * @param location - The location of the uniform variable.
126
+ * @param v0 - The first component of the vector.
127
+ * @param v1 - The second component of the vector.
128
+ * @param v2 - The third component of the vector.
129
+ */
130
+ uniform3f(location: string, v0: number, v1: number, v2: number): void;
131
+ /**
132
+ * Sets the value of a vec3 uniform variable.
133
+ *
134
+ * @param location - The location of the uniform variable.
135
+ * @param
136
+ */
137
+ uniform3fa(location: string, value: Vec3): void;
138
+ /**
139
+ * Sets the value of a vec3 array uniform variable.
140
+ *
141
+ * @param location - The location of the uniform variable.
142
+ * @param value - The array of vec3 values to set.
143
+ */
144
+ uniform3fv(location: string, value: Float32Array): void;
145
+ /**
146
+ * Sets the value of a ivec3 uniform variable.
147
+ *
148
+ * @param location - The location of the uniform variable.
149
+ * @param v0 - The first component of the vector.
150
+ * @param v1 - The second component of the vector.
151
+ * @param v2 - The third component of the vector.
152
+ */
153
+ uniform3i(location: string, v0: number, v1: number, v2: number): void;
154
+ /**
155
+ * Sets the value of an ivec3 array uniform variable.
156
+ *
157
+ * @param location - The location of the uniform variable.
158
+ * @param value - The array of ivec3 values to set.
159
+ */
160
+ uniform3iv(location: string, value: Int32Array): void;
161
+ /**
162
+ * Sets the value of a vec4 uniform variable.
163
+ *
164
+ * @param location - The location of the uniform variable.
165
+ * @param v0 - The first component of the vector.
166
+ * @param v1 - The second component of the vector.
167
+ * @param v2 - The third component of the vector.
168
+ * @param v3 - The fourth component of the vector.
169
+ */
170
+ uniform4f(location: string, v0: number, v1: number, v2: number, v3: number): void;
171
+ /**
172
+ * Sets an array of numbers
173
+ * @param location The location of the uniform variable.
174
+ * @param value
175
+ */
176
+ uniform4fa(location: string, value: Vec4): void;
177
+ /**
178
+ * Sets the value of a vec4 array uniform variable.
179
+ *
180
+ * @param location - The location of the uniform variable.
181
+ * @param value - The array of vec4 values to set.
182
+ */
183
+ uniform4fv(location: string, value: Float32Array): void;
184
+ /**
185
+ * Sets the value of a ivec4 uniform variable.
186
+ *
187
+ * @param location - The location of the uniform variable.
188
+ * @param v0 - The first component of the vector.
189
+ * @param v1 - The second component of the vector.
190
+ * @param v2 - The third component of the vector.
191
+ * @param v3 - The fourth component of the vector.
192
+ */
193
+ uniform4i(location: string, v0: number, v1: number, v2: number, v3: number): void;
194
+ /**
195
+ * Sets the value of an ivec4 array uniform variable.
196
+ *
197
+ * @param location - The location of the uniform variable.
198
+ * @param value - The array of ivec4 values to set.
199
+ */
200
+ uniform4iv(location: string, value: Int32Array): void;
201
+ /**
202
+ * Sets the value of a mat2 uniform variable.
203
+ *
204
+ * @param location - The location of the uniform variable.
205
+ * @param transpose - Whether to transpose the matrix.
206
+ * @param value - The array of mat2 values to set.
207
+ */
208
+ uniformMatrix2fv(location: string, value: Float32Array): void;
209
+ /**
210
+ * Sets the value of a mat2 uniform variable.
211
+ * @param location - The location of the uniform variable.
212
+ * @param value - The array of mat2 values to set.
213
+ */
214
+ uniformMatrix3fv(location: string, value: Float32Array): void;
215
+ /**
216
+ * Sets the value of a mat4 uniform variable.
217
+ * @param location - The location of the uniform variable.
218
+ * @param value - The array of mat4 values to set.
219
+ */
220
+ uniformMatrix4fv(location: string, value: Float32Array): void;
221
+ }
@@ -0,0 +1,334 @@
1
+ import { getNormalizedRgbaComponents } from '../../lib/utils.js';
2
+ import { CoreShaderNode } from '../CoreShaderNode.js';
3
+ export class WebGlShaderNode extends CoreShaderNode {
4
+ program;
5
+ updater = undefined;
6
+ valueKey = '';
7
+ uniforms = {
8
+ single: {},
9
+ vec2: {},
10
+ vec3: {},
11
+ vec4: {},
12
+ };
13
+ constructor(shaderKey, config, program, stage, props) {
14
+ super(shaderKey, config, stage, props);
15
+ this.program = program;
16
+ if (config.update !== undefined) {
17
+ this.updater = config.update;
18
+ this.update = () => {
19
+ if (this.props === undefined) {
20
+ this.updater(this.node, this.props);
21
+ return;
22
+ }
23
+ const prevKey = this.valueKey;
24
+ this.valueKey = '';
25
+ for (const key in this.resolvedProps) {
26
+ this.valueKey += `${key}:${this.resolvedProps[key]};`;
27
+ }
28
+ if (prevKey === this.valueKey) {
29
+ return;
30
+ }
31
+ if (prevKey.length > 0) {
32
+ this.stage.shManager.mutateShaderValueUsage(prevKey, -1);
33
+ }
34
+ const values = this.stage.shManager.getShaderValues(this.valueKey);
35
+ if (values !== undefined) {
36
+ this.uniforms = values;
37
+ return;
38
+ }
39
+ //create empty uniform collection when calculating new values
40
+ this.uniforms = {
41
+ single: {},
42
+ vec2: {},
43
+ vec3: {},
44
+ vec4: {},
45
+ };
46
+ this.updater(this.node);
47
+ this.stage.shManager.setShaderValues(this.valueKey, this.uniforms);
48
+ };
49
+ }
50
+ }
51
+ /**
52
+ * Sets the value of a RGBA variable
53
+ * @param location
54
+ * @param value
55
+ */
56
+ uniformRGBA(location, value) {
57
+ this.uniform4fv(location, new Float32Array(getNormalizedRgbaComponents(value)));
58
+ }
59
+ /**
60
+ * Sets the value of a single float uniform variable.
61
+ *
62
+ * @param location - The location of the uniform variable.
63
+ * @param v0 - The value to set.
64
+ */
65
+ uniform1f(location, value) {
66
+ this.uniforms.single[location] = {
67
+ method: 'uniform1f',
68
+ value,
69
+ };
70
+ }
71
+ /**
72
+ * Sets the value of a float array uniform variable.
73
+ *
74
+ * @param location - The location of the uniform variable.
75
+ * @param value - The array of values to set.
76
+ */
77
+ uniform1fv(location, value) {
78
+ this.uniforms.single[location] = {
79
+ method: 'uniform1fv',
80
+ value,
81
+ };
82
+ }
83
+ /**
84
+ * Sets the value of a single integer uniform variable.
85
+ *
86
+ * @param location - The location of the uniform variable.
87
+ * @param v0 - The value to set.
88
+ */
89
+ uniform1i(location, value) {
90
+ this.uniforms.single[location] = {
91
+ method: 'uniform1i',
92
+ value,
93
+ };
94
+ }
95
+ /**
96
+ * Sets the value of an integer array uniform variable.
97
+ *
98
+ * @param location - The location of the uniform variable.
99
+ * @param value - The array of values to set.
100
+ */
101
+ uniform1iv(location, value) {
102
+ this.uniforms.single[location] = {
103
+ method: 'uniform1iv',
104
+ value,
105
+ };
106
+ }
107
+ /**
108
+ * Sets the value of a vec2 uniform variable.
109
+ *
110
+ * @param location - The location of the uniform variable.
111
+ * @param v0 - The first component of the vector.
112
+ * @param v1 - The second component of the vector.
113
+ */
114
+ uniform2f(location, v0, v1) {
115
+ this.uniforms.vec2[location] = {
116
+ method: 'uniform2f',
117
+ value: [v0, v1],
118
+ };
119
+ }
120
+ /**
121
+ * Sets the value of a vec2 array uniform variable.
122
+ *
123
+ * @param location - The location of the uniform variable.
124
+ * @param value - The array of vec2 values to set as FloatArray.
125
+ */
126
+ uniform2fv(location, value) {
127
+ this.uniforms.single[location] = {
128
+ method: 'uniform2fv',
129
+ value,
130
+ };
131
+ }
132
+ /**
133
+ * Sets the value of a vec2 array uniform variable.
134
+ *
135
+ * @param location - The location of the uniform variable.
136
+ * @param value - The array of vec2 values to set.
137
+ */
138
+ uniform2fa(location, value) {
139
+ this.uniforms.vec2[location] = {
140
+ method: 'uniform2f',
141
+ value,
142
+ };
143
+ }
144
+ /**
145
+ * Sets the value of a ivec2 uniform variable.
146
+ *
147
+ * @param location - The location of the uniform variable.
148
+ * @param v0 - The first component of the vector.
149
+ * @param v1 - The second component of the vector.
150
+ */
151
+ uniform2i(location, v0, v1) {
152
+ this.uniforms.vec2[location] = {
153
+ method: 'uniform2i',
154
+ value: [v0, v1],
155
+ };
156
+ }
157
+ /**
158
+ * Sets the value of an ivec2 array uniform variable.
159
+ *
160
+ * @param location - The location of the uniform variable.
161
+ * @param value - The array of ivec2 values to set.
162
+ */
163
+ uniform2iv(location, value) {
164
+ this.uniforms.single[location] = {
165
+ method: 'uniform2iv',
166
+ value,
167
+ };
168
+ }
169
+ /**
170
+ * Sets the value of a vec3 uniform variable.
171
+ *
172
+ * @param location - The location of the uniform variable.
173
+ * @param v0 - The first component of the vector.
174
+ * @param v1 - The second component of the vector.
175
+ * @param v2 - The third component of the vector.
176
+ */
177
+ uniform3f(location, v0, v1, v2) {
178
+ this.uniforms.vec3[location] = {
179
+ method: 'uniform3f',
180
+ value: [v0, v1, v2],
181
+ };
182
+ }
183
+ /**
184
+ * Sets the value of a vec3 uniform variable.
185
+ *
186
+ * @param location - The location of the uniform variable.
187
+ * @param
188
+ */
189
+ uniform3fa(location, value) {
190
+ this.uniforms.vec3[location] = {
191
+ method: 'uniform3f',
192
+ value,
193
+ };
194
+ }
195
+ /**
196
+ * Sets the value of a vec3 array uniform variable.
197
+ *
198
+ * @param location - The location of the uniform variable.
199
+ * @param value - The array of vec3 values to set.
200
+ */
201
+ uniform3fv(location, value) {
202
+ this.uniforms.single[location] = {
203
+ method: 'uniform3fv',
204
+ value,
205
+ };
206
+ }
207
+ /**
208
+ * Sets the value of a ivec3 uniform variable.
209
+ *
210
+ * @param location - The location of the uniform variable.
211
+ * @param v0 - The first component of the vector.
212
+ * @param v1 - The second component of the vector.
213
+ * @param v2 - The third component of the vector.
214
+ */
215
+ uniform3i(location, v0, v1, v2) {
216
+ this.uniforms.vec3[location] = {
217
+ method: 'uniform3i',
218
+ value: [v0, v1, v2],
219
+ };
220
+ }
221
+ /**
222
+ * Sets the value of an ivec3 array uniform variable.
223
+ *
224
+ * @param location - The location of the uniform variable.
225
+ * @param value - The array of ivec3 values to set.
226
+ */
227
+ uniform3iv(location, value) {
228
+ this.uniforms.single[location] = {
229
+ method: 'uniform3iv',
230
+ value,
231
+ };
232
+ }
233
+ /**
234
+ * Sets the value of a vec4 uniform variable.
235
+ *
236
+ * @param location - The location of the uniform variable.
237
+ * @param v0 - The first component of the vector.
238
+ * @param v1 - The second component of the vector.
239
+ * @param v2 - The third component of the vector.
240
+ * @param v3 - The fourth component of the vector.
241
+ */
242
+ uniform4f(location, v0, v1, v2, v3) {
243
+ this.uniforms.vec4[location] = {
244
+ method: 'uniform4f',
245
+ value: [v0, v1, v2, v3],
246
+ };
247
+ }
248
+ /**
249
+ * Sets an array of numbers
250
+ * @param location The location of the uniform variable.
251
+ * @param value
252
+ */
253
+ uniform4fa(location, value) {
254
+ this.uniforms.vec4[location] = {
255
+ method: 'uniform4f',
256
+ value,
257
+ };
258
+ }
259
+ /**
260
+ * Sets the value of a vec4 array uniform variable.
261
+ *
262
+ * @param location - The location of the uniform variable.
263
+ * @param value - The array of vec4 values to set.
264
+ */
265
+ uniform4fv(location, value) {
266
+ this.uniforms.single[location] = {
267
+ method: 'uniform4fv',
268
+ value,
269
+ };
270
+ }
271
+ /**
272
+ * Sets the value of a ivec4 uniform variable.
273
+ *
274
+ * @param location - The location of the uniform variable.
275
+ * @param v0 - The first component of the vector.
276
+ * @param v1 - The second component of the vector.
277
+ * @param v2 - The third component of the vector.
278
+ * @param v3 - The fourth component of the vector.
279
+ */
280
+ uniform4i(location, v0, v1, v2, v3) {
281
+ this.uniforms.vec4[location] = {
282
+ method: 'uniform4i',
283
+ value: [v0, v1, v2, v3],
284
+ };
285
+ }
286
+ /**
287
+ * Sets the value of an ivec4 array uniform variable.
288
+ *
289
+ * @param location - The location of the uniform variable.
290
+ * @param value - The array of ivec4 values to set.
291
+ */
292
+ uniform4iv(location, value) {
293
+ this.uniforms.single[location] = {
294
+ method: 'uniform4iv',
295
+ value,
296
+ };
297
+ }
298
+ /**
299
+ * Sets the value of a mat2 uniform variable.
300
+ *
301
+ * @param location - The location of the uniform variable.
302
+ * @param transpose - Whether to transpose the matrix.
303
+ * @param value - The array of mat2 values to set.
304
+ */
305
+ uniformMatrix2fv(location, value) {
306
+ this.uniforms.single[location] = {
307
+ method: 'uniformMatrix2fv',
308
+ value,
309
+ };
310
+ }
311
+ /**
312
+ * Sets the value of a mat2 uniform variable.
313
+ * @param location - The location of the uniform variable.
314
+ * @param value - The array of mat2 values to set.
315
+ */
316
+ uniformMatrix3fv(location, value) {
317
+ this.uniforms.single[location] = {
318
+ method: 'uniformMatrix3fv',
319
+ value,
320
+ };
321
+ }
322
+ /**
323
+ * Sets the value of a mat4 uniform variable.
324
+ * @param location - The location of the uniform variable.
325
+ * @param value - The array of mat4 values to set.
326
+ */
327
+ uniformMatrix4fv(location, value) {
328
+ this.uniforms.single[location] = {
329
+ method: 'uniformMatrix4fv',
330
+ value,
331
+ };
332
+ }
333
+ }
334
+ //# sourceMappingURL=WebGlShaderNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebGlShaderNode.js","sourceRoot":"","sources":["../../../../../src/core/renderers/webgl/WebGlShaderNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AAIjE,OAAO,EAAE,cAAc,EAAuB,MAAM,sBAAsB,CAAC;AAoD3E,MAAM,OAAO,eAEX,SAAQ,cAAqB;IACpB,OAAO,CAAqB;IAC7B,OAAO,GACb,SAAS,CAAC;IACJ,QAAQ,GAAW,EAAE,CAAC;IAC9B,QAAQ,GAAsB;QAC5B,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,EAAE;KACT,CAAC;IAEF,YACE,SAAiB,EACjB,MAA8B,EAC9B,OAA2B,EAC3B,KAAY,EACZ,KAAa;QAEb,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QACvC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YAChC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,MAAO,CAAC;YAE9B,IAAI,CAAC,MAAM,GAAG,GAAG,EAAE;gBACjB,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;oBAC7B,IAAI,CAAC,OAAQ,CAAC,IAAI,CAAC,IAAgB,EAAE,IA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AC;IAED;;;;;OAKG;IACH,UAAU,CAAC,QAAgB,EAAE,KAAiB;QAC5C,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG;YAC/B,MAAM,EAAE,YAAY;YACpB,KAAK;SACN,CAAC;IACJ,CAAC;IAED;;;;;;OAMG;IACH,gBAAgB,CAAC,QAAgB,EAAE,KAAmB;QACpD,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG;YAC/B,MAAM,EAAE,kBAAkB;YAC1B,KAAK;SACN,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,gBAAgB,CAAC,QAAgB,EAAE,KAAmB;QACpD,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG;YAC/B,MAAM,EAAE,kBAAkB;YAC1B,KAAK;SACN,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,gBAAgB,CAAC,QAAgB,EAAE,KAAmB;QACpD,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG;YAC/B,MAAM,EAAE,kBAAkB;YAC1B,KAAK;SACN,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,35 @@
1
+ import type { WebGlContextWrapper } from '../../lib/WebGlContextWrapper.js';
2
+ import type { QuadOptions } from '../CoreRenderer.js';
3
+ import type { CoreShaderProgram } from '../CoreShaderProgram.js';
4
+ import type { WebGlCtxTexture } from './WebGlCtxTexture.js';
5
+ import type { WebGlRenderOp } from './WebGlRenderOp.js';
6
+ import type { WebGlRenderer } from './WebGlRenderer.js';
7
+ import type { WebGlShaderType } from './WebGlShaderNode.js';
8
+ import type { BufferCollection } from './internal/BufferCollection.js';
9
+ export declare class WebGlShaderProgram implements CoreShaderProgram {
10
+ protected boundBufferCollection: BufferCollection | null;
11
+ protected program: WebGLProgram;
12
+ /**
13
+ * Vertex Array Object
14
+ *
15
+ * @remarks
16
+ * Used by WebGL2 Only
17
+ */
18
+ protected vao: WebGLVertexArrayObject | undefined;
19
+ protected renderer: WebGlRenderer;
20
+ protected glw: WebGlContextWrapper;
21
+ protected attributeLocations: Record<string, number>;
22
+ protected lifecycle: Pick<WebGlShaderType, 'update' | 'canBatch'>;
23
+ protected useSystemAlpha: boolean;
24
+ protected useSystemDimensions: boolean;
25
+ supportsIndexedTextures: boolean;
26
+ constructor(renderer: WebGlRenderer, config: WebGlShaderType, resolvedProps: Record<string, any>);
27
+ disableAttribute(location: number): void;
28
+ disableAttributes(): void;
29
+ reuseRenderOp(renderOpA: QuadOptions, renderOpB: QuadOptions): boolean;
30
+ bindRenderOp(renderOp: WebGlRenderOp): void;
31
+ bindBufferCollection(buffer: BufferCollection): void;
32
+ bindTextures(textures: WebGlCtxTexture[]): void;
33
+ attach(): void;
34
+ detach(): void;
35
+ }