@babylonjs/smart-filters 1.0.12 → 8.18.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 (259) hide show
  1. package/dist/blockFoundation/aggregateBlock.d.ts +3 -3
  2. package/dist/blockFoundation/aggregateBlock.d.ts.map +1 -1
  3. package/dist/blockFoundation/aggregateBlock.js +1 -2
  4. package/dist/blockFoundation/aggregateBlock.js.map +1 -1
  5. package/dist/blockFoundation/baseBlock.d.ts +2 -2
  6. package/dist/blockFoundation/baseBlock.d.ts.map +1 -1
  7. package/dist/blockFoundation/baseBlock.js +5 -6
  8. package/dist/blockFoundation/baseBlock.js.map +1 -1
  9. package/dist/blockFoundation/customAggregateBlock.d.ts.map +1 -1
  10. package/dist/blockFoundation/customAggregateBlock.js +2 -2
  11. package/dist/blockFoundation/customAggregateBlock.js.map +1 -1
  12. package/dist/blockFoundation/customShaderBlock.d.ts.map +1 -1
  13. package/dist/blockFoundation/customShaderBlock.js +4 -6
  14. package/dist/blockFoundation/customShaderBlock.js.map +1 -1
  15. package/dist/blockFoundation/disableableShaderBlock.d.ts.map +1 -1
  16. package/dist/blockFoundation/disableableShaderBlock.js +4 -4
  17. package/dist/blockFoundation/disableableShaderBlock.js.map +1 -1
  18. package/dist/blockFoundation/index.js +0 -2
  19. package/dist/blockFoundation/index.js.map +1 -1
  20. package/dist/blockFoundation/inputBlock.d.ts +8 -8
  21. package/dist/blockFoundation/inputBlock.d.ts.map +1 -1
  22. package/dist/blockFoundation/inputBlock.deserializer.d.ts +1 -1
  23. package/dist/blockFoundation/inputBlock.deserializer.d.ts.map +1 -1
  24. package/dist/blockFoundation/inputBlock.deserializer.js +1 -1
  25. package/dist/blockFoundation/inputBlock.deserializer.js.map +1 -1
  26. package/dist/blockFoundation/inputBlock.js +7 -7
  27. package/dist/blockFoundation/inputBlock.js.map +1 -1
  28. package/dist/blockFoundation/inputBlock.serialization.types.d.ts.map +1 -1
  29. package/dist/blockFoundation/inputBlock.serializer.d.ts +1 -1
  30. package/dist/blockFoundation/inputBlock.serializer.js +26 -28
  31. package/dist/blockFoundation/inputBlock.serializer.js.map +1 -1
  32. package/dist/blockFoundation/outputBlock.d.ts +4 -9
  33. package/dist/blockFoundation/outputBlock.d.ts.map +1 -1
  34. package/dist/blockFoundation/outputBlock.js +13 -14
  35. package/dist/blockFoundation/outputBlock.js.map +1 -1
  36. package/dist/blockFoundation/shaderBlock.d.ts +4 -4
  37. package/dist/blockFoundation/shaderBlock.d.ts.map +1 -1
  38. package/dist/blockFoundation/shaderBlock.js +13 -19
  39. package/dist/blockFoundation/shaderBlock.js.map +1 -1
  40. package/dist/blockFoundation/textureOptions.d.ts +1 -1
  41. package/dist/blockFoundation/textureOptions.js +1 -1
  42. package/dist/command/command.d.ts +1 -1
  43. package/dist/command/command.js +1 -1
  44. package/dist/command/commandBuffer.d.ts +1 -1
  45. package/dist/command/commandBuffer.d.ts.map +1 -1
  46. package/dist/command/commandBuffer.js +2 -2
  47. package/dist/command/commandBufferDebugger.d.ts +2 -2
  48. package/dist/command/commandBufferDebugger.d.ts.map +1 -1
  49. package/dist/command/commandBufferDebugger.js +1 -1
  50. package/dist/command/commandBufferDebugger.js.map +1 -1
  51. package/dist/command/index.d.ts +3 -1
  52. package/dist/command/index.d.ts.map +1 -1
  53. package/dist/command/index.js +5 -1
  54. package/dist/command/index.js.map +1 -1
  55. package/dist/connection/connectionPoint.d.ts +3 -3
  56. package/dist/connection/connectionPoint.d.ts.map +1 -1
  57. package/dist/connection/connectionPoint.js +2 -2
  58. package/dist/connection/connectionPoint.js.map +1 -1
  59. package/dist/connection/connectionPointCompatibilityState.d.ts +1 -1
  60. package/dist/connection/connectionPointCompatibilityState.js +1 -1
  61. package/dist/connection/connectionPointType.d.ts +3 -3
  62. package/dist/connection/connectionPointType.d.ts.map +1 -1
  63. package/dist/connection/connectionPointWithDefault.d.ts +3 -3
  64. package/dist/connection/connectionPointWithDefault.d.ts.map +1 -1
  65. package/dist/connection/connectionPointWithDefault.js.map +1 -1
  66. package/dist/connection/index.d.ts +2 -1
  67. package/dist/connection/index.d.ts.map +1 -1
  68. package/dist/connection/index.js +3 -3
  69. package/dist/connection/index.js.map +1 -1
  70. package/dist/editorUtils/editableInPropertyPage.d.ts +2 -2
  71. package/dist/editorUtils/editableInPropertyPage.d.ts.map +1 -1
  72. package/dist/editorUtils/editableInPropertyPage.js +2 -2
  73. package/dist/editorUtils/editableInPropertyPage.js.map +1 -1
  74. package/dist/editorUtils/index.d.ts +1 -0
  75. package/dist/editorUtils/index.d.ts.map +1 -1
  76. package/dist/editorUtils/index.js +2 -0
  77. package/dist/editorUtils/index.js.map +1 -1
  78. package/dist/index.d.ts.map +1 -1
  79. package/dist/index.js +1 -1
  80. package/dist/index.js.map +1 -1
  81. package/dist/optimization/dependencyGraph.js.map +1 -1
  82. package/dist/optimization/optimizedShaderBlock.d.ts +4 -4
  83. package/dist/optimization/optimizedShaderBlock.d.ts.map +1 -1
  84. package/dist/optimization/optimizedShaderBlock.js.map +1 -1
  85. package/dist/optimization/smartFilterOptimizer.d.ts +2 -2
  86. package/dist/optimization/smartFilterOptimizer.d.ts.map +1 -1
  87. package/dist/optimization/smartFilterOptimizer.js +34 -57
  88. package/dist/optimization/smartFilterOptimizer.js.map +1 -1
  89. package/dist/runtime/index.d.ts +2 -1
  90. package/dist/runtime/index.d.ts.map +1 -1
  91. package/dist/runtime/index.js +3 -3
  92. package/dist/runtime/index.js.map +1 -1
  93. package/dist/runtime/renderTargetGenerator.d.ts +1 -1
  94. package/dist/runtime/renderTargetGenerator.d.ts.map +1 -1
  95. package/dist/runtime/renderTargetGenerator.js +5 -7
  96. package/dist/runtime/renderTargetGenerator.js.map +1 -1
  97. package/dist/runtime/shaderRuntime.d.ts +7 -7
  98. package/dist/runtime/shaderRuntime.d.ts.map +1 -1
  99. package/dist/runtime/shaderRuntime.js +7 -8
  100. package/dist/runtime/shaderRuntime.js.map +1 -1
  101. package/dist/runtime/smartFilterRuntime.d.ts +3 -3
  102. package/dist/runtime/smartFilterRuntime.d.ts.map +1 -1
  103. package/dist/runtime/smartFilterRuntime.js.map +1 -1
  104. package/dist/runtime/strongRef.d.ts +1 -1
  105. package/dist/runtime/strongRef.js +1 -1
  106. package/dist/serialization/importCustomBlockDefinition.d.ts +1 -1
  107. package/dist/serialization/importCustomBlockDefinition.js +8 -9
  108. package/dist/serialization/importCustomBlockDefinition.js.map +1 -1
  109. package/dist/serialization/index.d.ts +1 -0
  110. package/dist/serialization/index.d.ts.map +1 -1
  111. package/dist/serialization/index.js +3 -0
  112. package/dist/serialization/index.js.map +1 -1
  113. package/dist/serialization/serializedBlockDefinition.d.ts +2 -2
  114. package/dist/serialization/serializedBlockDefinition.d.ts.map +1 -1
  115. package/dist/serialization/serializedShaderBlockDefinition.d.ts +1 -1
  116. package/dist/serialization/serializedShaderBlockDefinition.d.ts.map +1 -1
  117. package/dist/serialization/serializedSmartFilter.d.ts +1 -1
  118. package/dist/serialization/serializedSmartFilter.d.ts.map +1 -1
  119. package/dist/serialization/smartFilterDeserializer.d.ts +6 -6
  120. package/dist/serialization/smartFilterDeserializer.d.ts.map +1 -1
  121. package/dist/serialization/smartFilterDeserializer.js +14 -12
  122. package/dist/serialization/smartFilterDeserializer.js.map +1 -1
  123. package/dist/serialization/smartFilterSerializer.d.ts +2 -2
  124. package/dist/serialization/smartFilterSerializer.d.ts.map +1 -1
  125. package/dist/serialization/smartFilterSerializer.js +10 -13
  126. package/dist/serialization/smartFilterSerializer.js.map +1 -1
  127. package/dist/serialization/v1/defaultBlockSerializer.d.ts +2 -2
  128. package/dist/serialization/v1/defaultBlockSerializer.d.ts.map +1 -1
  129. package/dist/serialization/v1/defaultBlockSerializer.js +3 -1
  130. package/dist/serialization/v1/defaultBlockSerializer.js.map +1 -1
  131. package/dist/serialization/v1/index.d.ts +1 -0
  132. package/dist/serialization/v1/index.d.ts.map +1 -1
  133. package/dist/serialization/v1/index.js +2 -0
  134. package/dist/serialization/v1/index.js.map +1 -1
  135. package/dist/serialization/v1/shaderBlockSerialization.types.d.ts +3 -3
  136. package/dist/serialization/v1/shaderBlockSerialization.types.d.ts.map +1 -1
  137. package/dist/serialization/v1/smartFilterSerialization.types.d.ts +5 -2
  138. package/dist/serialization/v1/smartFilterSerialization.types.d.ts.map +1 -1
  139. package/dist/smartFilter.d.ts +8 -8
  140. package/dist/smartFilter.d.ts.map +1 -1
  141. package/dist/smartFilter.js +6 -7
  142. package/dist/smartFilter.js.map +1 -1
  143. package/dist/utils/buildTools/buildShaders.d.ts +3 -2
  144. package/dist/utils/buildTools/buildShaders.d.ts.map +1 -1
  145. package/dist/utils/buildTools/buildShaders.js +7 -6
  146. package/dist/utils/buildTools/buildShaders.js.map +1 -1
  147. package/dist/utils/buildTools/convertGlslIntoBlock.d.ts +4 -2
  148. package/dist/utils/buildTools/convertGlslIntoBlock.d.ts.map +1 -1
  149. package/dist/utils/buildTools/convertGlslIntoBlock.js +136 -141
  150. package/dist/utils/buildTools/convertGlslIntoBlock.js.map +1 -1
  151. package/dist/utils/buildTools/convertGlslIntoShaderProgram.d.ts +4 -4
  152. package/dist/utils/buildTools/convertGlslIntoShaderProgram.d.ts.map +1 -1
  153. package/dist/utils/buildTools/convertGlslIntoShaderProgram.js +55 -48
  154. package/dist/utils/buildTools/convertGlslIntoShaderProgram.js.map +1 -1
  155. package/dist/utils/buildTools/convertShaders.d.ts +8 -5
  156. package/dist/utils/buildTools/convertShaders.d.ts.map +1 -1
  157. package/dist/utils/buildTools/convertShaders.js +38 -14
  158. package/dist/utils/buildTools/convertShaders.js.map +1 -1
  159. package/dist/utils/buildTools/shaderConverter.d.ts +4 -4
  160. package/dist/utils/buildTools/shaderConverter.d.ts.map +1 -1
  161. package/dist/utils/buildTools/shaderConverter.js +17 -21
  162. package/dist/utils/buildTools/shaderConverter.js.map +1 -1
  163. package/dist/utils/buildTools/watchShaders.d.ts +3 -2
  164. package/dist/utils/buildTools/watchShaders.d.ts.map +1 -1
  165. package/dist/utils/buildTools/watchShaders.js +10 -8
  166. package/dist/utils/buildTools/watchShaders.js.map +1 -1
  167. package/dist/utils/index.d.ts +1 -0
  168. package/dist/utils/index.d.ts.map +1 -1
  169. package/dist/utils/index.js +2 -1
  170. package/dist/utils/index.js.map +1 -1
  171. package/dist/utils/renderTargetUtils.d.ts +3 -3
  172. package/dist/utils/renderTargetUtils.d.ts.map +1 -1
  173. package/dist/utils/renderTargetUtils.js +4 -4
  174. package/dist/utils/renderTargetUtils.js.map +1 -1
  175. package/dist/utils/shaderCodeUtils.d.ts +8 -8
  176. package/dist/utils/shaderCodeUtils.d.ts.map +1 -1
  177. package/dist/utils/shaderCodeUtils.js +16 -28
  178. package/dist/utils/shaderCodeUtils.js.map +1 -1
  179. package/dist/utils/textureLoaders.d.ts +2 -2
  180. package/dist/utils/textureLoaders.d.ts.map +1 -1
  181. package/dist/utils/textureLoaders.js +2 -3
  182. package/dist/utils/textureLoaders.js.map +1 -1
  183. package/dist/utils/textureUtils.d.ts +5 -5
  184. package/dist/utils/textureUtils.d.ts.map +1 -1
  185. package/dist/utils/textureUtils.js +1 -1
  186. package/dist/utils/textureUtils.js.map +1 -1
  187. package/dist/version.d.ts +2 -2
  188. package/dist/version.js +2 -2
  189. package/license.md +21 -21
  190. package/package.json +14 -9
  191. package/src/blockFoundation/aggregateBlock.ts +148 -151
  192. package/src/blockFoundation/baseBlock.ts +339 -364
  193. package/src/blockFoundation/customAggregateBlock.ts +88 -104
  194. package/src/blockFoundation/customShaderBlock.ts +312 -326
  195. package/src/blockFoundation/disableableShaderBlock.ts +91 -100
  196. package/src/blockFoundation/index.ts +9 -9
  197. package/src/blockFoundation/inputBlock.deserializer.ts +72 -97
  198. package/src/blockFoundation/inputBlock.serialization.types.ts +126 -132
  199. package/src/blockFoundation/inputBlock.serializer.ts +150 -150
  200. package/src/blockFoundation/inputBlock.ts +181 -192
  201. package/src/blockFoundation/outputBlock.ts +144 -151
  202. package/src/blockFoundation/shaderBlock.ts +156 -163
  203. package/src/blockFoundation/textureOptions.ts +57 -57
  204. package/src/command/command.ts +59 -59
  205. package/src/command/commandBuffer.ts +71 -71
  206. package/src/command/commandBufferDebugger.ts +14 -14
  207. package/src/command/index.ts +7 -3
  208. package/src/connection/connectionPoint.ts +205 -214
  209. package/src/connection/connectionPointCompatibilityState.ts +31 -31
  210. package/src/connection/connectionPointType.ts +45 -45
  211. package/src/connection/connectionPointWithDefault.ts +27 -35
  212. package/src/connection/index.ts +8 -9
  213. package/src/editorUtils/editableInPropertyPage.ts +106 -106
  214. package/src/editorUtils/index.ts +3 -1
  215. package/src/index.ts +16 -15
  216. package/src/optimization/dependencyGraph.ts +96 -96
  217. package/src/optimization/index.ts +1 -1
  218. package/src/optimization/optimizedShaderBlock.ts +131 -134
  219. package/src/optimization/smartFilterOptimizer.ts +757 -825
  220. package/src/runtime/index.ts +8 -6
  221. package/src/runtime/renderTargetGenerator.ts +222 -248
  222. package/src/runtime/shaderRuntime.ts +174 -173
  223. package/src/runtime/smartFilterRuntime.ts +112 -112
  224. package/src/runtime/strongRef.ts +18 -18
  225. package/src/serialization/importCustomBlockDefinition.ts +86 -86
  226. package/src/serialization/index.ts +10 -7
  227. package/src/serialization/serializedBlockDefinition.ts +12 -12
  228. package/src/serialization/serializedShaderBlockDefinition.ts +7 -7
  229. package/src/serialization/serializedSmartFilter.ts +6 -6
  230. package/src/serialization/smartFilterDeserializer.ts +190 -214
  231. package/src/serialization/smartFilterSerializer.ts +110 -121
  232. package/src/serialization/v1/defaultBlockSerializer.ts +21 -19
  233. package/src/serialization/v1/index.ts +4 -2
  234. package/src/serialization/v1/shaderBlockSerialization.types.ts +85 -85
  235. package/src/serialization/v1/smartFilterSerialization.types.ts +129 -129
  236. package/src/smartFilter.ts +255 -260
  237. package/src/utils/buildTools/buildShaders.ts +14 -13
  238. package/src/utils/buildTools/convertGlslIntoBlock.ts +370 -385
  239. package/src/utils/buildTools/convertGlslIntoShaderProgram.ts +173 -172
  240. package/src/utils/buildTools/convertShaders.ts +65 -43
  241. package/src/utils/buildTools/recordVersionNumber.js +17 -0
  242. package/src/utils/buildTools/shaderConverter.ts +466 -478
  243. package/src/utils/buildTools/watchShaders.ts +44 -42
  244. package/src/utils/index.ts +4 -2
  245. package/src/utils/renderTargetUtils.ts +30 -35
  246. package/src/utils/shaderCodeUtils.ts +192 -207
  247. package/src/utils/textureLoaders.ts +31 -43
  248. package/src/utils/textureUtils.ts +28 -32
  249. package/src/version.ts +2 -2
  250. package/dist/utils/buildTools/determineVersion.d.ts +0 -36
  251. package/dist/utils/buildTools/determineVersion.d.ts.map +0 -1
  252. package/dist/utils/buildTools/determineVersion.js +0 -109
  253. package/dist/utils/buildTools/determineVersion.js.map +0 -1
  254. package/dist/utils/buildTools/versionUp.d.ts +0 -2
  255. package/dist/utils/buildTools/versionUp.d.ts.map +0 -1
  256. package/dist/utils/buildTools/versionUp.js +0 -53
  257. package/dist/utils/buildTools/versionUp.js.map +0 -1
  258. package/src/utils/buildTools/determineVersion.ts +0 -128
  259. package/src/utils/buildTools/versionUp.ts +0 -61
@@ -1,4 +1,4 @@
1
- import { createCommand } from "../command/command.js";
1
+ import { CreateCommand } from "../command/command.js";
2
2
  /**
3
3
  * Registers the final command of the command queue - the one that draws to either the canvas or
4
4
  * renderTargetTexture.
@@ -7,15 +7,15 @@ import { createCommand } from "../command/command.js";
7
7
  * @param commandOwner - The owner of the command.
8
8
  * @param shaderBlockRuntime - The shader block runtime to use.
9
9
  */
10
- export function registerFinalRenderCommand(outputBlock, runtime, commandOwner, shaderBlockRuntime) {
10
+ export function RegisterFinalRenderCommand(outputBlock, runtime, commandOwner, shaderBlockRuntime) {
11
11
  const commandOwnerBlockType = commandOwner.blockType;
12
12
  if (outputBlock.renderTargetWrapper) {
13
- runtime.registerCommand(createCommand(`${commandOwnerBlockType}.renderToFinalTexture`, commandOwner, () => {
13
+ runtime.registerCommand(CreateCommand(`${commandOwnerBlockType}.renderToFinalTexture`, commandOwner, () => {
14
14
  shaderBlockRuntime.renderToTargetWrapper(outputBlock);
15
15
  }));
16
16
  }
17
17
  else {
18
- runtime.registerCommand(createCommand(`${commandOwnerBlockType}.renderToCanvas`, commandOwner, () => {
18
+ runtime.registerCommand(CreateCommand(`${commandOwnerBlockType}.renderToCanvas`, commandOwner, () => {
19
19
  shaderBlockRuntime.renderToCanvas();
20
20
  }));
21
21
  }
@@ -1 +1 @@
1
- {"version":3,"file":"renderTargetUtils.js","sourceRoot":"","sources":["../../src/utils/renderTargetUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAMtD;;;;;;;GAOG;AACH,MAAM,UAAU,0BAA0B,CACtC,WAAwB,EACxB,OAAmC,EACnC,YAAuB,EACvB,kBAAiC;IAEjC,MAAM,qBAAqB,GAAG,YAAY,CAAC,SAAS,CAAC;IACrD,IAAI,WAAW,CAAC,mBAAmB,EAAE,CAAC;QAClC,OAAO,CAAC,eAAe,CACnB,aAAa,CAAC,GAAG,qBAAqB,uBAAuB,EAAE,YAAY,EAAE,GAAG,EAAE;YAC9E,kBAAkB,CAAC,qBAAqB,CAAC,WAAW,CAAC,CAAC;QAC1D,CAAC,CAAC,CACL,CAAC;IACN,CAAC;SAAM,CAAC;QACJ,OAAO,CAAC,eAAe,CACnB,aAAa,CAAC,GAAG,qBAAqB,iBAAiB,EAAE,YAAY,EAAE,GAAG,EAAE;YACxE,kBAAkB,CAAC,cAAc,EAAE,CAAC;QACxC,CAAC,CAAC,CACL,CAAC;IACN,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"renderTargetUtils.js","sourceRoot":"","sources":["../../src/utils/renderTargetUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAMtD;;;;;;;GAOG;AACH,MAAM,UAAU,0BAA0B,CAAC,WAAwB,EAAE,OAAmC,EAAE,YAAuB,EAAE,kBAAiC;IAChK,MAAM,qBAAqB,GAAG,YAAY,CAAC,SAAS,CAAC;IACrD,IAAI,WAAW,CAAC,mBAAmB,EAAE,CAAC;QAClC,OAAO,CAAC,eAAe,CACnB,aAAa,CAAC,GAAG,qBAAqB,uBAAuB,EAAE,YAAY,EAAE,GAAG,EAAE;YAC9E,kBAAkB,CAAC,qBAAqB,CAAC,WAAW,CAAC,CAAC;QAC1D,CAAC,CAAC,CACL,CAAC;IACN,CAAC;SAAM,CAAC;QACJ,OAAO,CAAC,eAAe,CACnB,aAAa,CAAC,GAAG,qBAAqB,iBAAiB,EAAE,YAAY,EAAE,GAAG,EAAE;YACxE,kBAAkB,CAAC,cAAc,EAAE,CAAC;QACxC,CAAC,CAAC,CACL,CAAC;IACN,CAAC;AACL,CAAC"}
@@ -1,10 +1,10 @@
1
- import type { Effect } from "@babylonjs/core/Materials/effect";
2
- import type { ShaderCode } from "./buildTools/shaderCode.types";
1
+ import type { Effect } from "@babylonjs/core/Materials/effect.js";
2
+ import type { ShaderCode } from "./buildTools/shaderCode.types.js";
3
3
  /**
4
4
  * The shader code decorator.
5
5
  * Used to decorate the names of uniform, function and const variables for easier parsing.
6
6
  */
7
- export declare const decorateChar = "_";
7
+ export declare const DecorateChar = "_";
8
8
  /**
9
9
  * Describes a shader program.
10
10
  */
@@ -62,30 +62,30 @@ export declare const DisableUniform = "disabled";
62
62
  * Injects the disable uniform and adds a check for it at the beginning of the main function
63
63
  * @param shaderProgram - The shader program to inject the disable feature into
64
64
  */
65
- export declare function injectAutoSampleDisableCode(shaderProgram: ShaderProgram): void;
65
+ export declare function InjectAutoSampleDisableCode(shaderProgram: ShaderProgram): void;
66
66
  /**
67
67
  * Gets the shader fragment code.
68
68
  * @param shaderProgram - The shader program to extract the code from.
69
69
  * @param mainCodeOnly - If true, only the main function code will be returned.
70
70
  * @returns The shader fragment code.
71
71
  */
72
- export declare function getShaderFragmentCode(shaderProgram: ShaderProgram, mainCodeOnly?: boolean): string;
72
+ export declare function GetShaderFragmentCode(shaderProgram: ShaderProgram, mainCodeOnly?: boolean): string;
73
73
  /**
74
74
  * Gets the shader creation options from a shader program.
75
75
  * @param shaderProgram - The shader program to build the create options from.
76
76
  * @returns The shader creation options.
77
77
  */
78
- export declare function getShaderCreateOptions(shaderProgram: ShaderProgram): ShaderCreationOptions;
78
+ export declare function GetShaderCreateOptions(shaderProgram: ShaderProgram): ShaderCreationOptions;
79
79
  /**
80
80
  * Decorates a symbol (uniform, function or const) name.
81
81
  * @param symbol - The symbol to decorate.
82
82
  * @returns The decorated symbol.
83
83
  */
84
- export declare function decorateSymbol(symbol: string): string;
84
+ export declare function DecorateSymbol(symbol: string): string;
85
85
  /**
86
86
  * Undecorates a symbol (uniform, function or const) name.
87
87
  * @param symbol - The symbol to undecorate.
88
88
  * @returns The undecorated symbol. Throws an error if the symbol is not decorated.
89
89
  */
90
- export declare function undecorateSymbol(symbol: string): string;
90
+ export declare function UndecorateSymbol(symbol: string): string;
91
91
  //# sourceMappingURL=shaderCodeUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shaderCodeUtils.d.ts","sourceRoot":"","sources":["../../src/utils/shaderCodeUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAEhE;;;GAGG;AACH,eAAO,MAAM,YAAY,MAAM,CAAC;AAEhC;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IACxB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE5B;;OAEG;IACH,QAAQ,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAChC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,cAAc,CAAC,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AACH,MAAM,MAAM,qBAAqB,GAAG;IAChC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC/B;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC7B;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC7B;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACxB;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC,CAAC;AAEF,eAAO,MAAM,6BAA6B,uBAAuB,CAAC;AAClE,eAAO,MAAM,cAAc,aAAa,CAAC;AAEzC;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,aAAa,EAAE,aAAa,QAwBvE;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,aAAa,EAAE,YAAY,UAAQ,GAAG,MAAM,CAoBhG;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,aAAa,GAAG,qBAAqB,CAwC1F;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAErD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAMvD"}
@@ -2,17 +2,17 @@
2
2
  * The shader code decorator.
3
3
  * Used to decorate the names of uniform, function and const variables for easier parsing.
4
4
  */
5
- export const decorateChar = "_";
5
+ export const DecorateChar = "_";
6
6
  export const AutoDisableMainInputColorName = "autoMainInputColor";
7
7
  export const DisableUniform = "disabled";
8
8
  /**
9
9
  * Injects the disable uniform and adds a check for it at the beginning of the main function
10
10
  * @param shaderProgram - The shader program to inject the disable feature into
11
11
  */
12
- export function injectAutoSampleDisableCode(shaderProgram) {
12
+ export function InjectAutoSampleDisableCode(shaderProgram) {
13
13
  const shaderFragment = shaderProgram.fragment;
14
14
  // Inject the disable uniform
15
- shaderFragment.uniform += `\nuniform bool ${decorateSymbol(DisableUniform)};`;
15
+ shaderFragment.uniform += `\nuniform bool ${DecorateSymbol(DisableUniform)};`;
16
16
  // Find the main function
17
17
  const mainFunction = shaderFragment.functions.find((f) => f.name === shaderFragment.mainFunctionName);
18
18
  if (!mainFunction) {
@@ -23,9 +23,9 @@ export function injectAutoSampleDisableCode(shaderProgram) {
23
23
  throw new Error(`Main input texture not found when trying to inject auto disable into ${shaderFragment.mainFunctionName}`);
24
24
  }
25
25
  // Inject the code
26
- const autoDisableVariableName = decorateSymbol(AutoDisableMainInputColorName);
27
- mainFunction.code = mainFunction.code.replace("{", `{\n vec4 ${autoDisableVariableName} = texture2D(${shaderFragment.mainInputTexture}, vUV);\n
28
- if (${decorateSymbol(DisableUniform)}) return ${autoDisableVariableName};\n`);
26
+ const autoDisableVariableName = DecorateSymbol(AutoDisableMainInputColorName);
27
+ mainFunction.code = mainFunction.code.replace("{", `{\n vec4 ${autoDisableVariableName} = texture2D(${shaderFragment.mainInputTexture}, vUV);\n
28
+ if (${DecorateSymbol(DisableUniform)}) return ${autoDisableVariableName};\n`);
29
29
  }
30
30
  /**
31
31
  * Gets the shader fragment code.
@@ -33,15 +33,9 @@ export function injectAutoSampleDisableCode(shaderProgram) {
33
33
  * @param mainCodeOnly - If true, only the main function code will be returned.
34
34
  * @returns The shader fragment code.
35
35
  */
36
- export function getShaderFragmentCode(shaderProgram, mainCodeOnly = false) {
37
- var _a, _b;
36
+ export function GetShaderFragmentCode(shaderProgram, mainCodeOnly = false) {
38
37
  const shaderFragment = shaderProgram.fragment;
39
- const declarations = ((_a = shaderFragment.const) !== null && _a !== void 0 ? _a : "") +
40
- "\n" +
41
- shaderFragment.uniform +
42
- "\n" +
43
- ((_b = shaderFragment.uniformSingle) !== null && _b !== void 0 ? _b : "") +
44
- "\n";
38
+ const declarations = (shaderFragment.const ?? "") + "\n" + shaderFragment.uniform + "\n" + (shaderFragment.uniformSingle ?? "") + "\n";
45
39
  let mainFunctionCode = "";
46
40
  let otherFunctionsCode = "";
47
41
  for (let i = 0; i < shaderFragment.functions.length; ++i) {
@@ -63,11 +57,10 @@ export function getShaderFragmentCode(shaderProgram, mainCodeOnly = false) {
63
57
  * @param shaderProgram - The shader program to build the create options from.
64
58
  * @returns The shader creation options.
65
59
  */
66
- export function getShaderCreateOptions(shaderProgram) {
67
- var _a;
60
+ export function GetShaderCreateOptions(shaderProgram) {
68
61
  const shaderFragment = shaderProgram.fragment;
69
- let code = getShaderFragmentCode(shaderProgram);
70
- const uniforms = shaderFragment.uniform + "\n" + ((_a = shaderFragment.uniformSingle) !== null && _a !== void 0 ? _a : "");
62
+ let code = GetShaderFragmentCode(shaderProgram);
63
+ const uniforms = shaderFragment.uniform + "\n" + (shaderFragment.uniformSingle ?? "");
71
64
  const uniformNames = [];
72
65
  const samplerNames = [];
73
66
  const rx = new RegExp(`uniform\\s+(\\S+)\\s+(\\w+)\\s*;`, "g");
@@ -83,12 +76,7 @@ export function getShaderCreateOptions(shaderProgram) {
83
76
  }
84
77
  match = rx.exec(uniforms);
85
78
  }
86
- code =
87
- "varying vec2 vUV;\n" +
88
- code +
89
- "\nvoid main(void) {\ngl_FragColor = " +
90
- shaderFragment.mainFunctionName +
91
- "(vUV);\n}";
79
+ code = "varying vec2 vUV;\n" + code + "\nvoid main(void) {\ngl_FragColor = " + shaderFragment.mainFunctionName + "(vUV);\n}";
92
80
  const options = {
93
81
  name: shaderFragment.mainFunctionName,
94
82
  fragmentShader: code,
@@ -106,16 +94,16 @@ export function getShaderCreateOptions(shaderProgram) {
106
94
  * @param symbol - The symbol to decorate.
107
95
  * @returns The decorated symbol.
108
96
  */
109
- export function decorateSymbol(symbol) {
110
- return decorateChar + symbol + decorateChar;
97
+ export function DecorateSymbol(symbol) {
98
+ return DecorateChar + symbol + DecorateChar;
111
99
  }
112
100
  /**
113
101
  * Undecorates a symbol (uniform, function or const) name.
114
102
  * @param symbol - The symbol to undecorate.
115
103
  * @returns The undecorated symbol. Throws an error if the symbol is not decorated.
116
104
  */
117
- export function undecorateSymbol(symbol) {
118
- if (symbol.charAt(0) !== decorateChar || symbol.charAt(symbol.length - 1) !== decorateChar) {
105
+ export function UndecorateSymbol(symbol) {
106
+ if (symbol.charAt(0) !== DecorateChar || symbol.charAt(symbol.length - 1) !== DecorateChar) {
119
107
  throw new Error(`undecorateSymbol: Invalid symbol name "${symbol}"`);
120
108
  }
121
109
  return symbol.substring(1, symbol.length - 1);
@@ -1 +1 @@
1
- {"version":3,"file":"shaderCodeUtils.js","sourceRoot":"","sources":["../../src/utils/shaderCodeUtils.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAC;AAwDhC,MAAM,CAAC,MAAM,6BAA6B,GAAG,oBAAoB,CAAC;AAClE,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC;AAEzC;;;GAGG;AACH,MAAM,UAAU,2BAA2B,CAAC,aAA4B;IACpE,MAAM,cAAc,GAAG,aAAa,CAAC,QAAQ,CAAC;IAE9C,6BAA6B;IAC7B,cAAc,CAAC,OAAO,IAAI,kBAAkB,cAAc,CAAC,cAAc,CAAC,GAAG,CAAC;IAE9E,yBAAyB;IACzB,MAAM,YAAY,GAAG,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,cAAc,CAAC,gBAAgB,CAAC,CAAC;IACtG,IAAI,CAAC,YAAY,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CACX,mEAAmE,cAAc,CAAC,gBAAgB,EAAE,CACvG,CAAC;IACN,CAAC;IAED,6CAA6C;IAC7C,IA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O,CAAC,CAAC;QAC/B,CAAC;QAED,KAAK,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC;IAED,IAAI,GAAG,qBAAqB,GAAG,IAAI,GAAG,sCAAsC,GAAG,cAAc,CAAC,gBAAgB,GAAG,WAAW,CAAC;IAE7H,MAAM,OAAO,GAA0B;QACnC,IAAI,EAAE,cAAc,CAAC,gBAAgB;QACrC,cAAc,EAAE,IAAI;QACpB,YAAY,EAAE,YAAY;QAC1B,YAAY,EAAE,YAAY;QAC1B,OAAO,EAAE,cAAc,CAAC,OAAO;KAClC,CAAC;IAEF,IAAI,aAAa,CAAC,MAAM,EAAE,CAAC;QACvB,OAAO,CAAC,YAAY,GAAG,aAAa,CAAC,MAAM,CAAC;IAChD,CAAC;IAED,OAAO,OAAO,CAAC;AACnB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,MAAc;IACzC,OAAO,YAAY,GAAG,MAAM,GAAG,YAAY,CAAC;AAChD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAc;IAC3C,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,YAAY,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,YAAY,EAAE,CAAC;QACzF,MAAM,IAAI,KAAK,CAAC,0CAA0C,MAAM,GAAG,CAAC,CAAC;IACzE,CAAC;IAED,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AAClD,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { ThinTexture } from "@babylonjs/core/Materials/Textures/thinTexture.js";
2
2
  import { type ThinEngine } from "@babylonjs/core/Engines/thinEngine.js";
3
- import type { Nullable } from "@babylonjs/core/types";
3
+ import type { Nullable } from "@babylonjs/core/types.js";
4
4
  /**
5
5
  * Helper that takes in a URL to an image and returns a ThinTexture
6
6
  * @param engine - defines the engine to use to create the texture
@@ -12,5 +12,5 @@ import type { Nullable } from "@babylonjs/core/types";
12
12
  * @param forcedExtension - defines the extension to use to pick the right loader
13
13
  * @returns A ThinTexture of the image
14
14
  */
15
- export declare function createImageTexture(engine: ThinEngine, url: string, flipY?: Nullable<boolean>, samplingMode?: number | undefined, forcedExtension?: string | null): ThinTexture;
15
+ export declare function CreateImageTexture(engine: ThinEngine, url: string, flipY?: Nullable<boolean>, samplingMode?: number | undefined, forcedExtension?: string | null): ThinTexture;
16
16
  //# sourceMappingURL=textureLoaders.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"textureLoaders.d.ts","sourceRoot":"","sources":["../../src/utils/textureLoaders.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mDAAmD,CAAC;AAChF,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAC9B,MAAM,EAAE,UAAU,EAClB,GAAG,EAAE,MAAM,EACX,KAAK,GAAE,QAAQ,CAAC,OAAO,CAAQ,EAC/B,YAAY,GAAE,MAAM,GAAG,SAAqB,EAC5C,eAAe,GAAE,MAAM,GAAG,IAAW,GACtC,WAAW,CAeb"}
1
+ {"version":3,"file":"textureLoaders.d.ts","sourceRoot":"","sources":["../../src/utils/textureLoaders.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,0DAA+C;AACrE,OAAO,EAAE,KAAK,UAAU,EAAE,8CAAmC;AAC7D,OAAO,KAAK,EAAE,QAAQ,EAAE,iCAAsB;AAE9C;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAC9B,MAAM,EAAE,UAAU,EAClB,GAAG,EAAE,MAAM,EACX,KAAK,GAAE,QAAQ,CAAC,OAAO,CAAQ,EAC/B,YAAY,GAAE,MAAM,GAAG,SAAqB,EAC5C,eAAe,GAAE,MAAM,GAAG,IAAW,GACtC,WAAW,CAGb"}
@@ -1,5 +1,4 @@
1
1
  import { ThinTexture } from "@babylonjs/core/Materials/Textures/thinTexture.js";
2
- import {} from "@babylonjs/core/Engines/thinEngine.js";
3
2
  /**
4
3
  * Helper that takes in a URL to an image and returns a ThinTexture
5
4
  * @param engine - defines the engine to use to create the texture
@@ -11,8 +10,8 @@ import {} from "@babylonjs/core/Engines/thinEngine.js";
11
10
  * @param forcedExtension - defines the extension to use to pick the right loader
12
11
  * @returns A ThinTexture of the image
13
12
  */
14
- export function createImageTexture(engine, url, flipY = null, samplingMode = undefined, forcedExtension = null) {
15
- const internalTexture = engine.createTexture(url, true, flipY !== null && flipY !== void 0 ? flipY : true, null, samplingMode, null, null, null, null, null, forcedExtension);
13
+ export function CreateImageTexture(engine, url, flipY = null, samplingMode = undefined, forcedExtension = null) {
14
+ const internalTexture = engine.createTexture(url, true, flipY ?? true, null, samplingMode, null, null, null, null, null, forcedExtension);
16
15
  return new ThinTexture(internalTexture);
17
16
  }
18
17
  /*
@@ -1 +1 @@
1
- {"version":3,"file":"textureLoaders.js","sourceRoot":"","sources":["../../src/utils/textureLoaders.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mDAAmD,CAAC;AAChF,OAAO,EAAmB,MAAM,uCAAuC,CAAC;AAGxE;;;;;;;;;;GAUG;AACH,MAAM,UAAU,kBAAkB,CAC9B,MAAkB,EAClB,GAAW,EACX,QAA2B,IAAI,EAC/B,eAAmC,SAAS,EAC5C,kBAAiC,IAAI;IAErC,MAAM,eAAe,GAAG,MAAM,CAAC,aAAa,CACxC,GAAG,EACH,IAAI,EACJ,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,IAAI,EACb,IAAI,EACJ,YAAY,EACZ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,eAAe,CAClB,CAAC;IACF,OAAO,IAAI,WAAW,CAAC,eAAe,CAAC,CAAC;AAC5C,CAAC;AAED;;;;EAIE"}
1
+ {"version":3,"file":"textureLoaders.js","sourceRoot":"","sources":["../../src/utils/textureLoaders.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,0DAA+C;AAIrE;;;;;;;;;;GAUG;AACH,MAAM,UAAU,kBAAkB,CAC9B,MAAkB,EAClB,GAAW,EACX,QAA2B,IAAI,EAC/B,eAAmC,SAAS,EAC5C,kBAAiC,IAAI;IAErC,MAAM,eAAe,GAAG,MAAM,CAAC,aAAa,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,IAAI,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC;IAC1I,OAAO,IAAI,WAAW,CAAC,eAAe,CAAC,CAAC;AAC5C,CAAC;AAED;;;;EAIE"}
@@ -1,7 +1,7 @@
1
- import type { TextureSize } from "@babylonjs/core/Materials/Textures/textureCreationOptions";
2
- import type { OutputTextureOptions } from "../blockFoundation/textureOptions";
3
- import type { SmartFilter } from "../smartFilter";
4
- import type { ThinEngine } from "@babylonjs/core/Engines/thinEngine";
1
+ import type { TextureSize } from "@babylonjs/core/Materials/Textures/textureCreationOptions.js";
2
+ import type { OutputTextureOptions } from "../blockFoundation/textureOptions.js";
3
+ import type { SmartFilter } from "../smartFilter.js";
4
+ import type { ThinEngine } from "@babylonjs/core/Engines/thinEngine.js";
5
5
  /**
6
6
  * Determines the output texture size for a given shader block
7
7
  * @param smartFilter - The smart filter to use
@@ -9,5 +9,5 @@ import type { ThinEngine } from "@babylonjs/core/Engines/thinEngine";
9
9
  * @param textureOptions - The texture options to use
10
10
  * @returns - The output texture size
11
11
  */
12
- export declare function getBlockOutputTextureSize(smartFilter: SmartFilter, engine: ThinEngine, textureOptions: OutputTextureOptions): TextureSize;
12
+ export declare function GetBlockOutputTextureSize(smartFilter: SmartFilter, engine: ThinEngine, textureOptions: OutputTextureOptions): TextureSize;
13
13
  //# sourceMappingURL=textureUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"textureUtils.d.ts","sourceRoot":"","sources":["../../src/utils/textureUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2DAA2D,CAAC;AAC7F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAErE;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACrC,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,UAAU,EAClB,cAAc,EAAE,oBAAoB,GACrC,WAAW,CAeb"}
1
+ {"version":3,"file":"textureUtils.d.ts","sourceRoot":"","sources":["../../src/utils/textureUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,qEAA0D;AACrF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,8CAAmC;AAE7D;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,oBAAoB,GAAG,WAAW,CAezI"}
@@ -5,7 +5,7 @@
5
5
  * @param textureOptions - The texture options to use
6
6
  * @returns - The output texture size
7
7
  */
8
- export function getBlockOutputTextureSize(smartFilter, engine, textureOptions) {
8
+ export function GetBlockOutputTextureSize(smartFilter, engine, textureOptions) {
9
9
  let outputWidth;
10
10
  let outputHeight;
11
11
  const renderTargetWrapper = smartFilter.outputBlock.renderTargetWrapper;
@@ -1 +1 @@
1
- {"version":3,"file":"textureUtils.js","sourceRoot":"","sources":["../../src/utils/textureUtils.ts"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,MAAM,UAAU,yBAAyB,CACrC,WAAwB,EACxB,MAAkB,EAClB,cAAoC;IAEpC,IAAI,WAAmB,CAAC;IACxB,IAAI,YAAoB,CAAC;IACzB,MAAM,mBAAmB,GAAG,WAAW,CAAC,WAAW,CAAC,mBAAmB,CAAC;IACxE,IAAI,mBAAmB,EAAE,CAAC;QACtB,WAAW,GAAG,mBAAmB,CAAC,KAAK,CAAC;QACxC,YAAY,GAAG,mBAAmB,CAAC,MAAM,CAAC;IAC9C,CAAC;SAAM,CAAC;QACJ,WAAW,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAC1C,YAAY,GAAG,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;IACD,OAAO;QACH,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,GAAG,cAAc,CAAC,KAAK,CAAC;QACrD,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,cAAc,CAAC,KAAK,CAAC;KAC1D,CAAC;AACN,CAAC"}
1
+ {"version":3,"file":"textureUtils.js","sourceRoot":"","sources":["../../src/utils/textureUtils.ts"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,MAAM,UAAU,yBAAyB,CAAC,WAAwB,EAAE,MAAkB,EAAE,cAAoC;IACxH,IAAI,WAAmB,CAAC;IACxB,IAAI,YAAoB,CAAC;IACzB,MAAM,mBAAmB,GAAG,WAAW,CAAC,WAAW,CAAC,mBAAmB,CAAC;IACxE,IAAI,mBAAmB,EAAE,CAAC;QACtB,WAAW,GAAG,mBAAmB,CAAC,KAAK,CAAC;QACxC,YAAY,GAAG,mBAAmB,CAAC,MAAM,CAAC;IAC9C,CAAC;SAAM,CAAC;QACJ,WAAW,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAC1C,YAAY,GAAG,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;IACD,OAAO;QACH,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,GAAG,cAAc,CAAC,KAAK,CAAC;QACrD,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,cAAc,CAAC,KAAK,CAAC;KAC1D,CAAC;AACN,CAAC"}
package/dist/version.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * The version of the SmartFilter core. During publish, this file is overwritten by versionUp.ts with the same version that is used for the NPM publish.
2
+ * The version of the SmartFilter core. During publish, this file is overwritten by recordVersionNumber.ts with the same version that is used for the NPM publish.
3
3
  */
4
- export declare const SmartFilterCoreVersion = "1.0.12";
4
+ export declare const SmartFilterCoreVersion = "8.18.0";
5
5
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * The version of the SmartFilter core. During publish, this file is overwritten by versionUp.ts with the same version that is used for the NPM publish.
2
+ * The version of the SmartFilter core. During publish, this file is overwritten by recordVersionNumber.ts with the same version that is used for the NPM publish.
3
3
  */
4
- export const SmartFilterCoreVersion = "1.0.12";
4
+ export const SmartFilterCoreVersion = "8.18.0";
5
5
  //# sourceMappingURL=version.js.map
package/license.md CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 Babylon.js
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Babylon.js
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babylonjs/smart-filters",
3
- "version": "1.0.12",
3
+ "version": "8.18.0",
4
4
  "description": "Babylon.js Smart Filter core",
5
5
  "keywords": [
6
6
  "video",
@@ -26,7 +26,7 @@
26
26
  ],
27
27
  "repository": {
28
28
  "type": "git",
29
- "url": "git+https://github.com/BabylonJS/SmartFilters.git"
29
+ "url": "git+https://github.com/BabylonJS/Babylon.js.git"
30
30
  },
31
31
  "files": [
32
32
  "dist",
@@ -35,13 +35,18 @@
35
35
  "readme.md"
36
36
  ],
37
37
  "scripts": {
38
- "clean": "rimraf dist && rimraf tsconfig.build.tsbuildinfo",
39
- "preparePublish": "node dist/utils/buildTools/versionUp.js",
40
- "build": "tsc -p ./tsconfig.build.json",
41
- "watch": "tsc -p ./tsconfig.build.json --watch",
42
- "test": "echo \"Error: run test from the root of the monorepo\" && exit 1"
38
+ "build": "npm run clean && npm run copySrc && npm run compile",
39
+ "clean": "rimraf dist && rimraf src && rimraf *.tsbuildinfo -g && rimraf \"./**/*.!(cmd|md|json|build.json|lts.json|tasks.json|cjs)\" -g",
40
+ "copySrc": "node -e \"require('fs').cpSync('../../../dev/smartFilters/src', './src', { recursive: true })\"",
41
+ "compile": "node src/utils/buildTools/recordVersionNumber.js && tsc -b tsconfig.build.json",
42
+ "postcompile": "build-tools -c add-js-to-es6"
43
+ },
44
+ "devDependencies": {
45
+ "@dev/build-tools": "^1.0.0",
46
+ "@dev/core": "^1.0.0",
47
+ "@dev/shared-ui-components": "1.0.0"
43
48
  },
44
49
  "peerDependencies": {
45
- "@babylonjs/core": "^8.0.1"
50
+ "@babylonjs/core": "^7.47.3 || ^8.0.1"
46
51
  }
47
- }
52
+ }