@babylonjs/smart-filters 0.7.11-alpha → 0.7.13-alpha

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 (237) hide show
  1. package/dist/blockFoundation/outputBlock.d.ts +5 -0
  2. package/dist/blockFoundation/outputBlock.d.ts.map +1 -1
  3. package/dist/blockFoundation/outputBlock.js +30 -1
  4. package/dist/blockFoundation/outputBlock.js.map +1 -1
  5. package/dist/index.d.ts +0 -2
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +0 -2
  8. package/dist/index.js.map +1 -1
  9. package/dist/serialization/importCustomBlockDefinition.js +1 -25
  10. package/dist/serialization/importCustomBlockDefinition.js.map +1 -1
  11. package/dist/utils/buildTools/buildShaders.js +1 -1
  12. package/dist/utils/buildTools/buildShaders.js.map +1 -1
  13. package/dist/utils/buildTools/convertGlslIntoBlock.d.ts +7 -0
  14. package/dist/utils/buildTools/convertGlslIntoBlock.d.ts.map +1 -0
  15. package/dist/utils/buildTools/convertGlslIntoBlock.js +217 -0
  16. package/dist/utils/buildTools/convertGlslIntoBlock.js.map +1 -0
  17. package/dist/utils/buildTools/convertGlslIntoShaderProgram.d.ts +26 -0
  18. package/dist/utils/buildTools/convertGlslIntoShaderProgram.d.ts.map +1 -0
  19. package/dist/utils/buildTools/{convertShaderForHardcodedBlock.js → convertGlslIntoShaderProgram.js} +43 -30
  20. package/dist/utils/buildTools/convertGlslIntoShaderProgram.js.map +1 -0
  21. package/dist/utils/buildTools/convertShaders.d.ts +13 -0
  22. package/dist/utils/buildTools/convertShaders.d.ts.map +1 -0
  23. package/dist/utils/buildTools/convertShaders.js +37 -0
  24. package/dist/utils/buildTools/convertShaders.js.map +1 -0
  25. package/dist/utils/buildTools/shaderConverter.d.ts +2 -1
  26. package/dist/utils/buildTools/shaderConverter.d.ts.map +1 -1
  27. package/dist/utils/buildTools/shaderConverter.js +26 -1
  28. package/dist/utils/buildTools/shaderConverter.js.map +1 -1
  29. package/dist/utils/buildTools/watchShaders.js +2 -2
  30. package/dist/utils/buildTools/watchShaders.js.map +1 -1
  31. package/dist/version.d.ts +1 -1
  32. package/dist/version.js +1 -1
  33. package/package.json +5 -10
  34. package/readme.md +2 -0
  35. package/src/blockFoundation/outputBlock.ts +33 -1
  36. package/src/index.ts +0 -2
  37. package/src/serialization/importCustomBlockDefinition.ts +1 -26
  38. package/src/utils/buildTools/buildShaders.ts +1 -1
  39. package/src/utils/buildTools/convertGlslIntoBlock.ts +251 -0
  40. package/src/utils/buildTools/{convertShaderForHardcodedBlock.ts → convertGlslIntoShaderProgram.ts} +56 -35
  41. package/src/utils/buildTools/convertShaders.ts +42 -0
  42. package/src/utils/buildTools/shaderConverter.ts +28 -2
  43. package/src/utils/buildTools/watchShaders.ts +2 -2
  44. package/src/version.ts +1 -1
  45. package/dist/blockFoundation/outputBlock.shader.d.ts +0 -13
  46. package/dist/blockFoundation/outputBlock.shader.d.ts.map +0 -1
  47. package/dist/blockFoundation/outputBlock.shader.js +0 -31
  48. package/dist/blockFoundation/outputBlock.shader.js.map +0 -1
  49. package/dist/blockRegistration/IBlockRegistration.d.ts +0 -36
  50. package/dist/blockRegistration/IBlockRegistration.d.ts.map +0 -1
  51. package/dist/blockRegistration/IBlockRegistration.js +0 -2
  52. package/dist/blockRegistration/IBlockRegistration.js.map +0 -1
  53. package/dist/blockRegistration/blockSerializers.d.ts +0 -13
  54. package/dist/blockRegistration/blockSerializers.d.ts.map +0 -1
  55. package/dist/blockRegistration/blockSerializers.js +0 -35
  56. package/dist/blockRegistration/blockSerializers.js.map +0 -1
  57. package/dist/blockRegistration/builtInBlockRegistrations.d.ts +0 -13
  58. package/dist/blockRegistration/builtInBlockRegistrations.d.ts.map +0 -1
  59. package/dist/blockRegistration/builtInBlockRegistrations.js +0 -266
  60. package/dist/blockRegistration/builtInBlockRegistrations.js.map +0 -1
  61. package/dist/blockRegistration/index.d.ts +0 -3
  62. package/dist/blockRegistration/index.d.ts.map +0 -1
  63. package/dist/blockRegistration/index.js +0 -3
  64. package/dist/blockRegistration/index.js.map +0 -1
  65. package/dist/blocks/babylon/demo/effects/blackAndWhiteBlock.d.ts +0 -56
  66. package/dist/blocks/babylon/demo/effects/blackAndWhiteBlock.d.ts.map +0 -1
  67. package/dist/blocks/babylon/demo/effects/blackAndWhiteBlock.js +0 -66
  68. package/dist/blocks/babylon/demo/effects/blackAndWhiteBlock.js.map +0 -1
  69. package/dist/blocks/babylon/demo/effects/blackAndWhiteBlock.shader.d.ts +0 -13
  70. package/dist/blocks/babylon/demo/effects/blackAndWhiteBlock.shader.d.ts.map +0 -1
  71. package/dist/blocks/babylon/demo/effects/blackAndWhiteBlock.shader.js +0 -36
  72. package/dist/blocks/babylon/demo/effects/blackAndWhiteBlock.shader.js.map +0 -1
  73. package/dist/blocks/babylon/demo/effects/blurBlock.d.ts +0 -56
  74. package/dist/blocks/babylon/demo/effects/blurBlock.d.ts.map +0 -1
  75. package/dist/blocks/babylon/demo/effects/blurBlock.deserializer.d.ts +0 -29
  76. package/dist/blocks/babylon/demo/effects/blurBlock.deserializer.d.ts.map +0 -1
  77. package/dist/blocks/babylon/demo/effects/blurBlock.deserializer.js +0 -16
  78. package/dist/blocks/babylon/demo/effects/blurBlock.deserializer.js.map +0 -1
  79. package/dist/blocks/babylon/demo/effects/blurBlock.js +0 -100
  80. package/dist/blocks/babylon/demo/effects/blurBlock.js.map +0 -1
  81. package/dist/blocks/babylon/demo/effects/blurBlock.serializer.d.ts +0 -8
  82. package/dist/blocks/babylon/demo/effects/blurBlock.serializer.d.ts.map +0 -1
  83. package/dist/blocks/babylon/demo/effects/blurBlock.serializer.js +0 -28
  84. package/dist/blocks/babylon/demo/effects/blurBlock.serializer.js.map +0 -1
  85. package/dist/blocks/babylon/demo/effects/compositionBlock.d.ts +0 -118
  86. package/dist/blocks/babylon/demo/effects/compositionBlock.d.ts.map +0 -1
  87. package/dist/blocks/babylon/demo/effects/compositionBlock.deserializer.d.ts +0 -25
  88. package/dist/blocks/babylon/demo/effects/compositionBlock.deserializer.d.ts.map +0 -1
  89. package/dist/blocks/babylon/demo/effects/compositionBlock.deserializer.js +0 -15
  90. package/dist/blocks/babylon/demo/effects/compositionBlock.deserializer.js.map +0 -1
  91. package/dist/blocks/babylon/demo/effects/compositionBlock.js +0 -219
  92. package/dist/blocks/babylon/demo/effects/compositionBlock.js.map +0 -1
  93. package/dist/blocks/babylon/demo/effects/compositionBlock.serializer.d.ts +0 -6
  94. package/dist/blocks/babylon/demo/effects/compositionBlock.serializer.d.ts.map +0 -1
  95. package/dist/blocks/babylon/demo/effects/compositionBlock.serializer.js +0 -25
  96. package/dist/blocks/babylon/demo/effects/compositionBlock.serializer.js.map +0 -1
  97. package/dist/blocks/babylon/demo/effects/contrastBlock.d.ts +0 -63
  98. package/dist/blocks/babylon/demo/effects/contrastBlock.d.ts.map +0 -1
  99. package/dist/blocks/babylon/demo/effects/contrastBlock.js +0 -122
  100. package/dist/blocks/babylon/demo/effects/contrastBlock.js.map +0 -1
  101. package/dist/blocks/babylon/demo/effects/desaturateBlock.d.ts +0 -63
  102. package/dist/blocks/babylon/demo/effects/desaturateBlock.d.ts.map +0 -1
  103. package/dist/blocks/babylon/demo/effects/desaturateBlock.js +0 -107
  104. package/dist/blocks/babylon/demo/effects/desaturateBlock.js.map +0 -1
  105. package/dist/blocks/babylon/demo/effects/directionalBlurBlock.d.ts +0 -79
  106. package/dist/blocks/babylon/demo/effects/directionalBlurBlock.d.ts.map +0 -1
  107. package/dist/blocks/babylon/demo/effects/directionalBlurBlock.deserializer.d.ts +0 -33
  108. package/dist/blocks/babylon/demo/effects/directionalBlurBlock.deserializer.d.ts.map +0 -1
  109. package/dist/blocks/babylon/demo/effects/directionalBlurBlock.deserializer.js +0 -17
  110. package/dist/blocks/babylon/demo/effects/directionalBlurBlock.deserializer.js.map +0 -1
  111. package/dist/blocks/babylon/demo/effects/directionalBlurBlock.js +0 -171
  112. package/dist/blocks/babylon/demo/effects/directionalBlurBlock.js.map +0 -1
  113. package/dist/blocks/babylon/demo/effects/directionalBlurBlock.serializer.d.ts +0 -6
  114. package/dist/blocks/babylon/demo/effects/directionalBlurBlock.serializer.d.ts.map +0 -1
  115. package/dist/blocks/babylon/demo/effects/directionalBlurBlock.serializer.js +0 -27
  116. package/dist/blocks/babylon/demo/effects/directionalBlurBlock.serializer.js.map +0 -1
  117. package/dist/blocks/babylon/demo/effects/exposureBlock.d.ts +0 -63
  118. package/dist/blocks/babylon/demo/effects/exposureBlock.d.ts.map +0 -1
  119. package/dist/blocks/babylon/demo/effects/exposureBlock.js +0 -95
  120. package/dist/blocks/babylon/demo/effects/exposureBlock.js.map +0 -1
  121. package/dist/blocks/babylon/demo/effects/greenScreenBlock.d.ts +0 -75
  122. package/dist/blocks/babylon/demo/effects/greenScreenBlock.d.ts.map +0 -1
  123. package/dist/blocks/babylon/demo/effects/greenScreenBlock.js +0 -121
  124. package/dist/blocks/babylon/demo/effects/greenScreenBlock.js.map +0 -1
  125. package/dist/blocks/babylon/demo/effects/index.d.ts +0 -15
  126. package/dist/blocks/babylon/demo/effects/index.d.ts.map +0 -1
  127. package/dist/blocks/babylon/demo/effects/index.js +0 -15
  128. package/dist/blocks/babylon/demo/effects/index.js.map +0 -1
  129. package/dist/blocks/babylon/demo/effects/kaleidoscopeBlock.d.ts +0 -63
  130. package/dist/blocks/babylon/demo/effects/kaleidoscopeBlock.d.ts.map +0 -1
  131. package/dist/blocks/babylon/demo/effects/kaleidoscopeBlock.js +0 -159
  132. package/dist/blocks/babylon/demo/effects/kaleidoscopeBlock.js.map +0 -1
  133. package/dist/blocks/babylon/demo/effects/maskBlock.d.ts +0 -62
  134. package/dist/blocks/babylon/demo/effects/maskBlock.d.ts.map +0 -1
  135. package/dist/blocks/babylon/demo/effects/maskBlock.js +0 -75
  136. package/dist/blocks/babylon/demo/effects/maskBlock.js.map +0 -1
  137. package/dist/blocks/babylon/demo/effects/maskBlock.shader.d.ts +0 -14
  138. package/dist/blocks/babylon/demo/effects/maskBlock.shader.d.ts.map +0 -1
  139. package/dist/blocks/babylon/demo/effects/maskBlock.shader.js +0 -37
  140. package/dist/blocks/babylon/demo/effects/maskBlock.shader.js.map +0 -1
  141. package/dist/blocks/babylon/demo/effects/pixelateBlock.d.ts +0 -62
  142. package/dist/blocks/babylon/demo/effects/pixelateBlock.d.ts.map +0 -1
  143. package/dist/blocks/babylon/demo/effects/pixelateBlock.js +0 -77
  144. package/dist/blocks/babylon/demo/effects/pixelateBlock.js.map +0 -1
  145. package/dist/blocks/babylon/demo/effects/pixelateBlock.shader.d.ts +0 -15
  146. package/dist/blocks/babylon/demo/effects/pixelateBlock.shader.d.ts.map +0 -1
  147. package/dist/blocks/babylon/demo/effects/pixelateBlock.shader.js +0 -44
  148. package/dist/blocks/babylon/demo/effects/pixelateBlock.shader.js.map +0 -1
  149. package/dist/blocks/babylon/demo/effects/posterizeBlock.d.ts +0 -63
  150. package/dist/blocks/babylon/demo/effects/posterizeBlock.d.ts.map +0 -1
  151. package/dist/blocks/babylon/demo/effects/posterizeBlock.js +0 -108
  152. package/dist/blocks/babylon/demo/effects/posterizeBlock.js.map +0 -1
  153. package/dist/blocks/babylon/demo/effects/spritesheetBlock.d.ts +0 -81
  154. package/dist/blocks/babylon/demo/effects/spritesheetBlock.d.ts.map +0 -1
  155. package/dist/blocks/babylon/demo/effects/spritesheetBlock.js +0 -103
  156. package/dist/blocks/babylon/demo/effects/spritesheetBlock.js.map +0 -1
  157. package/dist/blocks/babylon/demo/effects/spritesheetBlock.shader.d.ts +0 -18
  158. package/dist/blocks/babylon/demo/effects/spritesheetBlock.shader.d.ts.map +0 -1
  159. package/dist/blocks/babylon/demo/effects/spritesheetBlock.shader.js +0 -57
  160. package/dist/blocks/babylon/demo/effects/spritesheetBlock.shader.js.map +0 -1
  161. package/dist/blocks/babylon/demo/effects/tintBlock.d.ts +0 -7
  162. package/dist/blocks/babylon/demo/effects/tintBlock.d.ts.map +0 -1
  163. package/dist/blocks/babylon/demo/effects/tintBlock.js +0 -51
  164. package/dist/blocks/babylon/demo/effects/tintBlock.js.map +0 -1
  165. package/dist/blocks/babylon/demo/transitions/index.d.ts +0 -2
  166. package/dist/blocks/babylon/demo/transitions/index.d.ts.map +0 -1
  167. package/dist/blocks/babylon/demo/transitions/index.js +0 -2
  168. package/dist/blocks/babylon/demo/transitions/index.js.map +0 -1
  169. package/dist/blocks/babylon/demo/transitions/wipeBlock.d.ts +0 -69
  170. package/dist/blocks/babylon/demo/transitions/wipeBlock.d.ts.map +0 -1
  171. package/dist/blocks/babylon/demo/transitions/wipeBlock.js +0 -110
  172. package/dist/blocks/babylon/demo/transitions/wipeBlock.js.map +0 -1
  173. package/dist/blocks/babylon/demo/utilities/index.d.ts +0 -2
  174. package/dist/blocks/babylon/demo/utilities/index.d.ts.map +0 -1
  175. package/dist/blocks/babylon/demo/utilities/index.js +0 -2
  176. package/dist/blocks/babylon/demo/utilities/index.js.map +0 -1
  177. package/dist/blocks/babylon/demo/utilities/premultiplyAlphaBlock.d.ts +0 -58
  178. package/dist/blocks/babylon/demo/utilities/premultiplyAlphaBlock.d.ts.map +0 -1
  179. package/dist/blocks/babylon/demo/utilities/premultiplyAlphaBlock.js +0 -87
  180. package/dist/blocks/babylon/demo/utilities/premultiplyAlphaBlock.js.map +0 -1
  181. package/dist/blocks/blockNamespaces.d.ts +0 -5
  182. package/dist/blocks/blockNamespaces.d.ts.map +0 -1
  183. package/dist/blocks/blockNamespaces.js +0 -5
  184. package/dist/blocks/blockNamespaces.js.map +0 -1
  185. package/dist/blocks/blockTypes.d.ts +0 -22
  186. package/dist/blocks/blockTypes.d.ts.map +0 -1
  187. package/dist/blocks/blockTypes.js +0 -22
  188. package/dist/blocks/blockTypes.js.map +0 -1
  189. package/dist/blocks/index.d.ts +0 -6
  190. package/dist/blocks/index.d.ts.map +0 -1
  191. package/dist/blocks/index.js +0 -6
  192. package/dist/blocks/index.js.map +0 -1
  193. package/dist/utils/buildTools/convertShaderForHardcodedBlock.d.ts +0 -13
  194. package/dist/utils/buildTools/convertShaderForHardcodedBlock.d.ts.map +0 -1
  195. package/dist/utils/buildTools/convertShaderForHardcodedBlock.js.map +0 -1
  196. package/src/blockFoundation/outputBlock.fragment.glsl +0 -5
  197. package/src/blockFoundation/outputBlock.shader.ts +0 -33
  198. package/src/blockRegistration/IBlockRegistration.ts +0 -45
  199. package/src/blockRegistration/blockSerializers.ts +0 -52
  200. package/src/blockRegistration/builtInBlockRegistrations.ts +0 -390
  201. package/src/blockRegistration/index.ts +0 -2
  202. package/src/blocks/babylon/demo/effects/blackAndWhiteBlock.fragment.glsl +0 -10
  203. package/src/blocks/babylon/demo/effects/blackAndWhiteBlock.shader.ts +0 -38
  204. package/src/blocks/babylon/demo/effects/blackAndWhiteBlock.ts +0 -80
  205. package/src/blocks/babylon/demo/effects/blurBlock.deserializer.ts +0 -38
  206. package/src/blocks/babylon/demo/effects/blurBlock.serializer.ts +0 -32
  207. package/src/blocks/babylon/demo/effects/blurBlock.ts +0 -119
  208. package/src/blocks/babylon/demo/effects/compositionBlock.deserializer.ts +0 -32
  209. package/src/blocks/babylon/demo/effects/compositionBlock.serializer.ts +0 -29
  210. package/src/blocks/babylon/demo/effects/compositionBlock.ts +0 -293
  211. package/src/blocks/babylon/demo/effects/contrastBlock.ts +0 -152
  212. package/src/blocks/babylon/demo/effects/desaturateBlock.ts +0 -137
  213. package/src/blocks/babylon/demo/effects/directionalBlurBlock.deserializer.ts +0 -47
  214. package/src/blocks/babylon/demo/effects/directionalBlurBlock.serializer.ts +0 -31
  215. package/src/blocks/babylon/demo/effects/directionalBlurBlock.ts +0 -193
  216. package/src/blocks/babylon/demo/effects/exposureBlock.ts +0 -120
  217. package/src/blocks/babylon/demo/effects/greenScreenBlock.ts +0 -152
  218. package/src/blocks/babylon/demo/effects/index.ts +0 -14
  219. package/src/blocks/babylon/demo/effects/kaleidoscopeBlock.ts +0 -186
  220. package/src/blocks/babylon/demo/effects/maskBlock.fragment.glsl +0 -10
  221. package/src/blocks/babylon/demo/effects/maskBlock.shader.ts +0 -39
  222. package/src/blocks/babylon/demo/effects/maskBlock.ts +0 -94
  223. package/src/blocks/babylon/demo/effects/pixelateBlock.fragment.glsl +0 -18
  224. package/src/blocks/babylon/demo/effects/pixelateBlock.shader.ts +0 -46
  225. package/src/blocks/babylon/demo/effects/pixelateBlock.ts +0 -101
  226. package/src/blocks/babylon/demo/effects/posterizeBlock.ts +0 -139
  227. package/src/blocks/babylon/demo/effects/spritesheetBlock.fragment.glsl +0 -26
  228. package/src/blocks/babylon/demo/effects/spritesheetBlock.shader.ts +0 -59
  229. package/src/blocks/babylon/demo/effects/spritesheetBlock.ts +0 -135
  230. package/src/blocks/babylon/demo/effects/tintBlock.ts +0 -52
  231. package/src/blocks/babylon/demo/transitions/index.ts +0 -1
  232. package/src/blocks/babylon/demo/transitions/wipeBlock.ts +0 -138
  233. package/src/blocks/babylon/demo/utilities/index.ts +0 -1
  234. package/src/blocks/babylon/demo/utilities/premultiplyAlphaBlock.ts +0 -106
  235. package/src/blocks/blockNamespaces.ts +0 -4
  236. package/src/blocks/blockTypes.ts +0 -21
  237. package/src/blocks/index.ts +0 -5
@@ -1,171 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import {} from "../../../../connection/connectionPoint.js";
8
- import { ConnectionPointType } from "../../../../connection/connectionPointType.js";
9
- import { ShaderBinding } from "../../../../runtime/shaderRuntime.js";
10
- import { ShaderBlock } from "../../../../blockFoundation/shaderBlock.js";
11
- import { editableInPropertyPage, PropertyTypeForEdition } from "../../../../editorUtils/editableInPropertyPage.js";
12
- import { directionalBlurBlockType } from "../../../blockTypes.js";
13
- import { babylonDemoEffectsNamespace } from "../../../blockNamespaces.js";
14
- const shaderProgram = {
15
- fragment: {
16
- const: `
17
- const float _epsilon_ = 0.01;
18
- `,
19
- uniform: `
20
- uniform vec2 _texelStep_;
21
- uniform sampler2D _input_;
22
- `,
23
- uniformSingle: `
24
- uniform float[7] _weights_;
25
- `,
26
- mainFunctionName: "_directionalBlur_",
27
- mainInputTexture: "_input_",
28
- functions: [
29
- {
30
- name: "_directionalBlur_",
31
- code: `
32
- vec4 _directionalBlur_(vec2 vUV) {
33
- vec2 start = vUV - 3.0 * _texelStep_;
34
-
35
- vec4 finalWeightedColor = vec4(0., 0., 0., 0.);
36
-
37
- for (int i = 0; i < 7; i++)
38
- {
39
- vec2 fetchUV = start + _texelStep_ * float(i);
40
- fetchUV = clamp(fetchUV, 0., 1.);
41
- vec4 colorSample = texture2D(_input_, fetchUV);
42
-
43
- // Ignore samples from mostly transparent pixels
44
- if (colorSample.a < _epsilon_) continue;
45
-
46
- finalWeightedColor += colorSample * _weights_[i];
47
- }
48
-
49
- return finalWeightedColor;
50
- }
51
- `,
52
- },
53
- ],
54
- },
55
- };
56
- const wideWeights = Float32Array.from([0.05, 0.1, 0.2, 0.3, 0.2, 0.1, 0.05]);
57
- /**
58
- * The shader bindings for the DirectionalBlur block.
59
- */
60
- export class DirectionalBlurShaderBinding extends ShaderBinding {
61
- /**
62
- * Creates a new shader binding instance for the DirectionalBlur block.
63
- * @param inputTexture - The input texture
64
- * @param blurHorizontalWidth - The horizontal blur width
65
- * @param blurVerticalWidth - The vertical blur width
66
- */
67
- constructor(inputTexture, blurHorizontalWidth, blurVerticalWidth) {
68
- super();
69
- this._inputTexture = inputTexture;
70
- this._blurHorizontalWidth = blurHorizontalWidth;
71
- this._blurVerticalWidth = blurVerticalWidth;
72
- }
73
- /**
74
- * Binds all the required data to the shader when rendering.
75
- * @param effect - defines the effect to bind the data to
76
- */
77
- bind(effect) {
78
- // Global pass Setup
79
- effect.setFloatArray(this.getRemappedName("weights"), wideWeights);
80
- // V blur
81
- effect.setTexture(this.getRemappedName("input"), this._inputTexture.value);
82
- // Texel size
83
- if (this._inputTexture.value) {
84
- const inputSize = this._inputTexture.value.getSize();
85
- const texelWidth = this._blurHorizontalWidth / inputSize.width;
86
- const texelHeight = this._blurVerticalWidth / inputSize.height;
87
- effect.setFloat2(this.getRemappedName("texelStep"), texelWidth, texelHeight);
88
- }
89
- }
90
- }
91
- /**
92
- * A block performing a directional "gaussian" blur.
93
- *
94
- * It is aggregated as part of the @see BlurBlock.
95
- */
96
- export class DirectionalBlurBlock extends ShaderBlock {
97
- /**
98
- * Instantiates a new Block.
99
- * @param smartFilter - The smart filter this block belongs to
100
- * @param name - The friendly name of the block
101
- */
102
- constructor(smartFilter, name) {
103
- super(smartFilter, name, true);
104
- /**
105
- * The input texture connection point.
106
- */
107
- this.input = this._registerInput("input", ConnectionPointType.Texture);
108
- /**
109
- * Defines how smaller we should make the target compared to the screen size.
110
- */
111
- this.blurTextureRatio = 0.5;
112
- /**
113
- * Defines the horizontal strength of the blur.
114
- */
115
- this.blurHorizontalWidth = 0;
116
- /**
117
- * Defines the vertical strength of the blur.
118
- */
119
- this.blurVerticalWidth = 1;
120
- }
121
- /**
122
- * Prepares the block for runtime.
123
- * This is called by the smart filter just before creating the smart filter runtime.
124
- */
125
- prepareForRuntime() {
126
- super.prepareForRuntime();
127
- this.outputTextureOptions.ratio = this.blurTextureRatio;
128
- }
129
- /**
130
- * Get the class instance that binds all the required data to the shader (effect) when rendering.
131
- * @returns The class instance that binds the data to the effect
132
- */
133
- getShaderBinding() {
134
- const input = this._confirmRuntimeDataSupplied(this.input);
135
- return new DirectionalBlurShaderBinding(input, this.blurHorizontalWidth, this.blurVerticalWidth);
136
- }
137
- }
138
- /**
139
- * The class name of the block.
140
- */
141
- DirectionalBlurBlock.ClassName = directionalBlurBlockType;
142
- /**
143
- * The namespace of the block.
144
- */
145
- DirectionalBlurBlock.Namespace = babylonDemoEffectsNamespace;
146
- /**
147
- * The shader program (vertex and fragment code) to use to render the block
148
- */
149
- DirectionalBlurBlock.ShaderCode = shaderProgram;
150
- __decorate([
151
- editableInPropertyPage("Texture Ratio", PropertyTypeForEdition.Float, "PROPERTIES", {
152
- min: 0,
153
- max: 1,
154
- notifiers: { rebuild: true },
155
- })
156
- ], DirectionalBlurBlock.prototype, "blurTextureRatio", void 0);
157
- __decorate([
158
- editableInPropertyPage("Horizontal strength", PropertyTypeForEdition.Float, "PROPERTIES", {
159
- min: 0,
160
- max: 1,
161
- notifiers: { rebuild: true },
162
- })
163
- ], DirectionalBlurBlock.prototype, "blurHorizontalWidth", void 0);
164
- __decorate([
165
- editableInPropertyPage("Vertical strength", PropertyTypeForEdition.Float, "PROPERTIES", {
166
- min: 0,
167
- max: 1,
168
- notifiers: { rebuild: true },
169
- })
170
- ], DirectionalBlurBlock.prototype, "blurVerticalWidth", void 0);
171
- //# sourceMappingURL=directionalBlurBlock.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"directionalBlurBlock.js","sourceRoot":"","sources":["../../../../../src/blocks/babylon/demo/effects/directionalBlurBlock.ts"],"names":[],"mappings":";;;;;;AAEA,OAAO,EAAoB,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAGrE,OAAO,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,mDAAmD,CAAC;AAEnH,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAE1E,MAAM,aAAa,GAAkB;IACjC,QAAQ,EAAE;QACN,KAAK,EAAE;;aAEF;QACL,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,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;KAC/B,CAAC;8DAC4B;AAUvB;IALN,sBAAsB,CAAC,qBAAqB,EAAE,sBAAsB,CAAC,KAAK,EAAE,YAAY,EAAE;QACvF,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,CAAC;QACN,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;KAC/B,CAAC;iEAC6B;AAUxB;IALN,sBAAsB,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,KAAK,EAAE,YAAY,EAAE;QACrF,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,CAAC;QACN,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;KAC/B,CAAC;+DAC2B"}
@@ -1,6 +0,0 @@
1
- import type { IBlockSerializerV1 } from "../../../../serialization";
2
- /**
3
- * The V1 serializer for a Directional Blur Block
4
- */
5
- export declare const directionalBlurBlockSerializer: IBlockSerializerV1;
6
- //# sourceMappingURL=directionalBlurBlock.serializer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"directionalBlurBlock.serializer.d.ts","sourceRoot":"","sources":["../../../../../src/blocks/babylon/demo/effects/directionalBlurBlock.serializer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAKpE;;GAEG;AACH,eAAO,MAAM,8BAA8B,EAAE,kBAqB5C,CAAC"}
@@ -1,27 +0,0 @@
1
- import { directionalBlurBlockType } from "../../../blockTypes.js";
2
- import { babylonDemoEffectsNamespace } from "../../../blockNamespaces.js";
3
- /**
4
- * The V1 serializer for a Directional Blur Block
5
- */
6
- export const directionalBlurBlockSerializer = {
7
- blockType: directionalBlurBlockType,
8
- serialize: (block) => {
9
- if (block.getClassName() !== directionalBlurBlockType) {
10
- throw new Error("Was asked to serialize an unrecognized block type");
11
- }
12
- const directionalBlurBlock = block;
13
- return {
14
- name: block.name,
15
- uniqueId: block.uniqueId,
16
- blockType: directionalBlurBlockType,
17
- namespace: babylonDemoEffectsNamespace,
18
- comments: block.comments,
19
- data: {
20
- blurTextureRatio: directionalBlurBlock.blurTextureRatio,
21
- blurHorizontalWidth: directionalBlurBlock.blurHorizontalWidth,
22
- blurVerticalWidth: directionalBlurBlock.blurVerticalWidth,
23
- },
24
- };
25
- },
26
- };
27
- //# sourceMappingURL=directionalBlurBlock.serializer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"directionalBlurBlock.serializer.js","sourceRoot":"","sources":["../../../../../src/blocks/babylon/demo/effects/directionalBlurBlock.serializer.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAE1E;;GAEG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAuB;IAC9D,SAAS,EAAE,wBAAwB;IACnC,SAAS,EAAE,CAAC,KAAgB,EAAE,EAAE;QAC5B,IAAI,KAAK,CAAC,YAAY,EAAE,KAAK,wBAAwB,EAAE,CAAC;YACpD,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;QACzE,CAAC;QAED,MAAM,oBAAoB,GAAG,KAA6B,CAAC;QAC3D,OAAO;YACH,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,SAAS,EAAE,wBAAwB;YACnC,SAAS,EAAE,2BAA2B;YACtC,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,IAAI,EAAE;gBACF,gBAAgB,EAAE,oBAAoB,CAAC,gBAAgB;gBACvD,mBAAmB,EAAE,oBAAoB,CAAC,mBAAmB;gBAC7D,iBAAiB,EAAE,oBAAoB,CAAC,iBAAiB;aAC5D;SACJ,CAAC;IACN,CAAC;CACJ,CAAC"}
@@ -1,63 +0,0 @@
1
- import type { Effect } from "@babylonjs/core/Materials/effect";
2
- import { type RuntimeData } from "../../../../connection/connectionPoint.js";
3
- import { ConnectionPointType } from "../../../../connection/connectionPointType.js";
4
- import { type IDisableableBlock, DisableableShaderBlock } from "../../../../blockFoundation/disableableShaderBlock.js";
5
- import { DisableableShaderBinding } from "../../../../runtime/shaderRuntime.js";
6
- import type { ShaderProgram } from "../../../../utils/shaderCodeUtils.js";
7
- import type { SmartFilter } from "../../../../smartFilter.js";
8
- /**
9
- * The shader bindings for the ExposureBlock.
10
- */
11
- export declare class ExposureBinding extends DisableableShaderBinding {
12
- private readonly _inputTexture;
13
- private readonly _amount;
14
- /**
15
- * Creates a new shader binding instance for the exposure block.
16
- * @param parentBlock - The parent block
17
- * @param inputTexture - The input texture
18
- * @param amount - The exposure adjustment amount (1.0 means no adjustment)
19
- */
20
- constructor(parentBlock: IDisableableBlock, inputTexture: RuntimeData<ConnectionPointType.Texture>, amount: RuntimeData<ConnectionPointType.Float>);
21
- /**
22
- * Binds all the required data to the shader when rendering.
23
- * @param effect - defines the effect to bind the data to
24
- */
25
- bind(effect: Effect): void;
26
- }
27
- /**
28
- * Applies an exposure adjustment to the input texture.
29
- */
30
- export declare class ExposureBlock extends DisableableShaderBlock {
31
- /**
32
- * The class name of the block.
33
- */
34
- static ClassName: string;
35
- /**
36
- * The namespace of the block.
37
- */
38
- static Namespace: string;
39
- /**
40
- * The input texture connection point.
41
- */
42
- readonly input: import("../../../../connection/connectionPoint.js").ConnectionPoint<ConnectionPointType.Texture>;
43
- /**
44
- * The amount of exposure adjustment to apply (1.0 is no adjustment).
45
- */
46
- readonly amount: import("../../../../connection/connectionPoint.js").ConnectionPoint<ConnectionPointType.Float>;
47
- /**
48
- * The shader program (vertex and fragment code) to use to render the block
49
- */
50
- static ShaderCode: ShaderProgram;
51
- /**
52
- * Instantiates a new Block.
53
- * @param smartFilter - The smart filter this block belongs to
54
- * @param name - The friendly name of the block
55
- */
56
- constructor(smartFilter: SmartFilter, name: string);
57
- /**
58
- * Get the class instance that binds all the required data to the shader (effect) when rendering.
59
- * @returns The class instance that binds the data to the effect
60
- */
61
- getShaderBinding(): DisableableShaderBinding;
62
- }
63
- //# sourceMappingURL=exposureBlock.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"exposureBlock.d.ts","sourceRoot":"","sources":["../../../../../src/blocks/babylon/demo/effects/exposureBlock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAE/D,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC;AACpF,OAAO,EAAE,KAAK,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,uDAAuD,CAAC;AACvH,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AA8B9D;;GAEG;AACH,qBAAa,eAAgB,SAAQ,wBAAwB;IACzD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA2C;IACzE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyC;IAEjE;;;;;OAKG;gBAEC,WAAW,EAAE,iBAAiB,EAC9B,YAAY,EAAE,WAAW,CAAC,mBAAmB,CAAC,OAAO,CAAC,EACtD,MAAM,EAAE,WAAW,CAAC,mBAAmB,CAAC,KAAK,CAAC;IAOlD;;;OAGG;IACa,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;CAK7C;AAED;;GAEG;AACH,qBAAa,aAAc,SAAQ,sBAAsB;IACrD;;OAEG;IACH,OAAuB,SAAS,SAAqB;IAErD;;OAEG;IACH,OAAuB,SAAS,SAA+B;IAE/D;;OAEG;IACH,SAAgB,KAAK,mGAA6D;IAElF;;OAEG;IACH,SAAgB,MAAM,iGAA4D;IAElF;;OAEG;IACH,OAAuB,UAAU,gBAAiB;IAElD;;;;OAIG;gBACS,WAAW,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM;IAIlD;;;OAGG;IACI,gBAAgB,IAAI,wBAAwB;CAMtD"}
@@ -1,95 +0,0 @@
1
- import {} from "../../../../connection/connectionPoint.js";
2
- import { ConnectionPointType } from "../../../../connection/connectionPointType.js";
3
- import { DisableableShaderBlock } from "../../../../blockFoundation/disableableShaderBlock.js";
4
- import { DisableableShaderBinding } from "../../../../runtime/shaderRuntime.js";
5
- import { exposureBlockType } from "../../../blockTypes.js";
6
- import { babylonDemoEffectsNamespace } from "../../../blockNamespaces.js";
7
- const shaderProgram = {
8
- fragment: {
9
- uniform: `
10
- uniform sampler2D _input_;
11
- uniform float _amount_;
12
- `,
13
- mainFunctionName: "_exposure_",
14
- mainInputTexture: "_input_",
15
- functions: [
16
- {
17
- name: "_exposure_",
18
- code: `
19
- vec4 _exposure_(vec2 vUV) {
20
- vec4 color = texture2D(_input_, vUV);
21
- return vec4(color.rgb * _amount_, color.a);
22
- }
23
- `,
24
- },
25
- ],
26
- },
27
- };
28
- /**
29
- * The shader bindings for the ExposureBlock.
30
- */
31
- export class ExposureBinding extends DisableableShaderBinding {
32
- /**
33
- * Creates a new shader binding instance for the exposure block.
34
- * @param parentBlock - The parent block
35
- * @param inputTexture - The input texture
36
- * @param amount - The exposure adjustment amount (1.0 means no adjustment)
37
- */
38
- constructor(parentBlock, inputTexture, amount) {
39
- super(parentBlock);
40
- this._inputTexture = inputTexture;
41
- this._amount = amount;
42
- }
43
- /**
44
- * Binds all the required data to the shader when rendering.
45
- * @param effect - defines the effect to bind the data to
46
- */
47
- bind(effect) {
48
- super.bind(effect);
49
- effect.setTexture(this.getRemappedName("input"), this._inputTexture.value);
50
- effect.setFloat(this.getRemappedName("amount"), this._amount.value);
51
- }
52
- }
53
- /**
54
- * Applies an exposure adjustment to the input texture.
55
- */
56
- export class ExposureBlock extends DisableableShaderBlock {
57
- /**
58
- * Instantiates a new Block.
59
- * @param smartFilter - The smart filter this block belongs to
60
- * @param name - The friendly name of the block
61
- */
62
- constructor(smartFilter, name) {
63
- super(smartFilter, name);
64
- /**
65
- * The input texture connection point.
66
- */
67
- this.input = this._registerInput("input", ConnectionPointType.Texture);
68
- /**
69
- * The amount of exposure adjustment to apply (1.0 is no adjustment).
70
- */
71
- this.amount = this._registerInput("amount", ConnectionPointType.Float);
72
- }
73
- /**
74
- * Get the class instance that binds all the required data to the shader (effect) when rendering.
75
- * @returns The class instance that binds the data to the effect
76
- */
77
- getShaderBinding() {
78
- const input = this._confirmRuntimeDataSupplied(this.input);
79
- const amount = this._confirmRuntimeDataSupplied(this.amount);
80
- return new ExposureBinding(this, input, amount);
81
- }
82
- }
83
- /**
84
- * The class name of the block.
85
- */
86
- ExposureBlock.ClassName = exposureBlockType;
87
- /**
88
- * The namespace of the block.
89
- */
90
- ExposureBlock.Namespace = babylonDemoEffectsNamespace;
91
- /**
92
- * The shader program (vertex and fragment code) to use to render the block
93
- */
94
- ExposureBlock.ShaderCode = shaderProgram;
95
- //# sourceMappingURL=exposureBlock.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"exposureBlock.js","sourceRoot":"","sources":["../../../../../src/blocks/babylon/demo/effects/exposureBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAoB,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC;AACpF,OAAO,EAA0B,sBAAsB,EAAE,MAAM,uDAAuD,CAAC;AACvH,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAIhF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAE1E,MAAM,aAAa,GAAkB;IACjC,QAAQ,EAAE;QACN,OAAO,EAAE;;;aAGJ;QAEL,gBAAgB,EAAE,YAAY;QAE9B,gBAAgB,EAAE,SAAS;QAE3B,SAAS,EAAE;YACP;gBACI,IAAI,EAAE,YAA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,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IACpD,CAAC;;AA3CD;;GAEG;AACoB,uBAAS,GAAG,iBAAiB,AAApB,CAAqB;AAErD;;GAEG;AACoB,uBAAS,GAAG,2BAA2B,AAA9B,CAA+B;AAY/D;;GAEG;AACoB,wBAAU,GAAG,aAAa,AAAhB,CAAiB"}
@@ -1,75 +0,0 @@
1
- import type { Effect } from "@babylonjs/core/Materials/effect";
2
- import { type RuntimeData } from "../../../../connection/connectionPoint.js";
3
- import { ConnectionPointType } from "../../../../connection/connectionPointType.js";
4
- import { type IDisableableBlock, DisableableShaderBlock } from "../../../../blockFoundation/disableableShaderBlock.js";
5
- import { DisableableShaderBinding } from "../../../../runtime/shaderRuntime.js";
6
- import type { ShaderProgram } from "../../../../utils/shaderCodeUtils.js";
7
- import type { SmartFilter } from "../../../../smartFilter.js";
8
- /**
9
- * The shader bindings for the Green block.
10
- */
11
- export declare class GreenShaderBinding extends DisableableShaderBinding {
12
- private readonly _inputTexture;
13
- private readonly _backgroundTexture;
14
- private readonly _reference;
15
- private readonly _distance;
16
- /**
17
- * Creates a new shader binding instance for the Green block.
18
- * @param parentBlock - The parent block
19
- * @param inputTexture - the input texture
20
- * @param backgroundTexture - the background texture
21
- * @param reference - the reference color
22
- * @param distance - the distance from the reference color
23
- */
24
- constructor(parentBlock: IDisableableBlock, inputTexture: RuntimeData<ConnectionPointType.Texture>, backgroundTexture: RuntimeData<ConnectionPointType.Texture>, reference: RuntimeData<ConnectionPointType.Color3>, distance: RuntimeData<ConnectionPointType.Float>);
25
- /**
26
- * Binds all the required data to the shader when rendering.
27
- * @param effect - defines the effect to bind the data to
28
- */
29
- bind(effect: Effect): void;
30
- }
31
- /**
32
- * A simple block to insert a background in place of a green screen.
33
- */
34
- export declare class GreenScreenBlock extends DisableableShaderBlock {
35
- /**
36
- * The class name of the block.
37
- */
38
- static ClassName: string;
39
- /**
40
- * The namespace of the block.
41
- */
42
- static Namespace: string;
43
- /**
44
- * The input texture connection point.
45
- */
46
- readonly input: import("../../../../connection/connectionPoint.js").ConnectionPoint<ConnectionPointType.Texture>;
47
- /**
48
- * The background texture connection point.
49
- */
50
- readonly background: import("../../../../connection/connectionPoint.js").ConnectionPoint<ConnectionPointType.Texture>;
51
- /**
52
- * The reference color of the green screen.
53
- */
54
- readonly reference: import("../../../../connection/connectionPoint.js").ConnectionPoint<ConnectionPointType.Color3>;
55
- /**
56
- * The "distance" from the color the reference is allowed to have for replacement.
57
- */
58
- readonly distance: import("../../../../connection/connectionPointWithDefault.js").ConnectionPointWithDefault<ConnectionPointType.Float>;
59
- /**
60
- * The shader program (vertex and fragment code) to use to render the block
61
- */
62
- static ShaderCode: ShaderProgram;
63
- /**
64
- * Instantiates a new Block.
65
- * @param smartFilter - The smart filter this block belongs to
66
- * @param name - The friendly name of the block
67
- */
68
- constructor(smartFilter: SmartFilter, name: string);
69
- /**
70
- * Get the class instance that binds all the required data to the shader (effect) when rendering.
71
- * @returns The class instance that binds the data to the effect
72
- */
73
- getShaderBinding(): DisableableShaderBinding;
74
- }
75
- //# sourceMappingURL=greenScreenBlock.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"greenScreenBlock.d.ts","sourceRoot":"","sources":["../../../../../src/blocks/babylon/demo/effects/greenScreenBlock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAE/D,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC;AACpF,OAAO,EAAE,KAAK,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,uDAAuD,CAAC;AACvH,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAwC9D;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,wBAAwB;IAC5D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA2C;IACzE,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAA2C;IAC9E,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA0C;IACrE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAyC;IAEnE;;;;;;;OAOG;gBAEC,WAAW,EAAE,iBAAiB,EAC9B,YAAY,EAAE,WAAW,CAAC,mBAAmB,CAAC,OAAO,CAAC,EACtD,iBAAiB,EAAE,WAAW,CAAC,mBAAmB,CAAC,OAAO,CAAC,EAC3D,SAAS,EAAE,WAAW,CAAC,mBAAmB,CAAC,MAAM,CAAC,EAClD,QAAQ,EAAE,WAAW,CAAC,mBAAmB,CAAC,KAAK,CAAC;IASpD;;;OAGG;IACa,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;CAO7C;AAED;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,sBAAsB;IACxD;;OAEG;IACH,OAAuB,SAAS,SAAwB;IAExD;;OAEG;IACH,OAAuB,SAAS,SAA+B;IAE/D;;OAEG;IACH,SAAgB,KAAK,mGAA6D;IAElF;;OAEG;IACH,SAAgB,UAAU,mGAAkE;IAE5F;;OAEG;IACH,SAAgB,SAAS,kGAAgE;IAEzF;;OAEG;IACH,SAAgB,QAAQ,uHAA4F;IAEpH;;OAEG;IACH,OAAuB,UAAU,gBAAiB;IAElD;;;;OAIG;gBACS,WAAW,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM;IAIlD;;;OAGG;IACI,gBAAgB,IAAI,wBAAwB;CAQtD"}
@@ -1,121 +0,0 @@
1
- import {} from "../../../../connection/connectionPoint.js";
2
- import { ConnectionPointType } from "../../../../connection/connectionPointType.js";
3
- import { DisableableShaderBlock } from "../../../../blockFoundation/disableableShaderBlock.js";
4
- import { DisableableShaderBinding } from "../../../../runtime/shaderRuntime.js";
5
- import { createStrongRef } from "../../../../runtime/strongRef.js";
6
- import { greenScreenBlockType } from "../../../blockTypes.js";
7
- import { babylonDemoEffectsNamespace } from "../../../blockNamespaces.js";
8
- const shaderProgram = {
9
- fragment: {
10
- uniform: `
11
- uniform sampler2D _input_;
12
- uniform sampler2D _background_;
13
- uniform vec3 _reference_;
14
- uniform float _distance_;
15
- `,
16
- mainFunctionName: "_greenScreen_",
17
- mainInputTexture: "_input_",
18
- functions: [
19
- {
20
- name: "_greenScreen_",
21
- code: `
22
- vec4 _greenScreen_(vec2 vUV)
23
- {
24
- vec4 color = texture2D(_input_, vUV);
25
- vec4 background = texture2D(_background_, vUV);
26
-
27
- if (length(color.rgb - _reference_) < _distance_) {
28
- return background;
29
- }
30
-
31
- return color;
32
- }
33
- `,
34
- },
35
- ],
36
- },
37
- };
38
- /**
39
- * The shader bindings for the Green block.
40
- */
41
- export class GreenShaderBinding extends DisableableShaderBinding {
42
- /**
43
- * Creates a new shader binding instance for the Green block.
44
- * @param parentBlock - The parent block
45
- * @param inputTexture - the input texture
46
- * @param backgroundTexture - the background texture
47
- * @param reference - the reference color
48
- * @param distance - the distance from the reference color
49
- */
50
- constructor(parentBlock, inputTexture, backgroundTexture, reference, distance) {
51
- super(parentBlock);
52
- this._inputTexture = inputTexture;
53
- this._backgroundTexture = backgroundTexture;
54
- this._reference = reference;
55
- this._distance = distance;
56
- }
57
- /**
58
- * Binds all the required data to the shader when rendering.
59
- * @param effect - defines the effect to bind the data to
60
- */
61
- bind(effect) {
62
- super.bind(effect);
63
- effect.setTexture(this.getRemappedName("input"), this._inputTexture.value);
64
- effect.setTexture(this.getRemappedName("background"), this._backgroundTexture.value);
65
- effect.setColor3(this.getRemappedName("reference"), this._reference.value);
66
- effect.setFloat(this.getRemappedName("distance"), this._distance.value);
67
- }
68
- }
69
- /**
70
- * A simple block to insert a background in place of a green screen.
71
- */
72
- export class GreenScreenBlock extends DisableableShaderBlock {
73
- /**
74
- * Instantiates a new Block.
75
- * @param smartFilter - The smart filter this block belongs to
76
- * @param name - The friendly name of the block
77
- */
78
- constructor(smartFilter, name) {
79
- super(smartFilter, name);
80
- /**
81
- * The input texture connection point.
82
- */
83
- this.input = this._registerInput("input", ConnectionPointType.Texture);
84
- /**
85
- * The background texture connection point.
86
- */
87
- this.background = this._registerInput("background", ConnectionPointType.Texture);
88
- /**
89
- * The reference color of the green screen.
90
- */
91
- this.reference = this._registerInput("reference", ConnectionPointType.Color3);
92
- /**
93
- * The "distance" from the color the reference is allowed to have for replacement.
94
- */
95
- this.distance = this._registerOptionalInput("distance", ConnectionPointType.Float, createStrongRef(0.1));
96
- }
97
- /**
98
- * Get the class instance that binds all the required data to the shader (effect) when rendering.
99
- * @returns The class instance that binds the data to the effect
100
- */
101
- getShaderBinding() {
102
- const input = this._confirmRuntimeDataSupplied(this.input);
103
- const background = this._confirmRuntimeDataSupplied(this.background);
104
- const reference = this._confirmRuntimeDataSupplied(this.reference);
105
- const distance = this.distance.runtimeData;
106
- return new GreenShaderBinding(this, input, background, reference, distance);
107
- }
108
- }
109
- /**
110
- * The class name of the block.
111
- */
112
- GreenScreenBlock.ClassName = greenScreenBlockType;
113
- /**
114
- * The namespace of the block.
115
- */
116
- GreenScreenBlock.Namespace = babylonDemoEffectsNamespace;
117
- /**
118
- * The shader program (vertex and fragment code) to use to render the block
119
- */
120
- GreenScreenBlock.ShaderCode = shaderProgram;
121
- //# sourceMappingURL=greenScreenBlock.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"greenScreenBlock.js","sourceRoot":"","sources":["../../../../../src/blocks/babylon/demo/effects/greenScreenBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAoB,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC;AACpF,OAAO,EAA0B,sBAAsB,EAAE,MAAM,uDAAuD,CAAC;AACvH,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAGhF,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,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;;GAEG;AACoB,2BAAU,GAAG,aAAa,AAAhB,CAAiB"}
@@ -1,15 +0,0 @@
1
- export * from "./blackAndWhiteBlock.js";
2
- export * from "./blurBlock.js";
3
- export * from "./compositionBlock.js";
4
- export * from "./contrastBlock.js";
5
- export * from "./desaturateBlock.js";
6
- export * from "./directionalBlurBlock.js";
7
- export * from "./exposureBlock.js";
8
- export * from "./greenScreenBlock.js";
9
- export * from "./kaleidoscopeBlock.js";
10
- export * from "./maskBlock.js";
11
- export * from "./pixelateBlock.js";
12
- export * from "./posterizeBlock.js";
13
- export * from "./spritesheetBlock.js";
14
- export * from "./tintBlock.js";
15
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/blocks/babylon/demo/effects/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC"}
@@ -1,15 +0,0 @@
1
- export * from "./blackAndWhiteBlock.js";
2
- export * from "./blurBlock.js";
3
- export * from "./compositionBlock.js";
4
- export * from "./contrastBlock.js";
5
- export * from "./desaturateBlock.js";
6
- export * from "./directionalBlurBlock.js";
7
- export * from "./exposureBlock.js";
8
- export * from "./greenScreenBlock.js";
9
- export * from "./kaleidoscopeBlock.js";
10
- export * from "./maskBlock.js";
11
- export * from "./pixelateBlock.js";
12
- export * from "./posterizeBlock.js";
13
- export * from "./spritesheetBlock.js";
14
- export * from "./tintBlock.js";
15
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/blocks/babylon/demo/effects/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC"}