@babylonjs/core 7.53.0 → 7.53.1

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 (111) hide show
  1. package/Engines/abstractEngine.js +2 -2
  2. package/Engines/abstractEngine.js.map +1 -1
  3. package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js +1 -1
  4. package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js.map +1 -1
  5. package/FlowGraph/Blocks/Data/Math/flowGraphMatrixMathBlocks.js +7 -2
  6. package/FlowGraph/Blocks/Data/Math/flowGraphMatrixMathBlocks.js.map +1 -1
  7. package/FlowGraph/CustomTypes/flowGraphMatrix.d.ts +1 -0
  8. package/FlowGraph/CustomTypes/flowGraphMatrix.js +18 -17
  9. package/FlowGraph/CustomTypes/flowGraphMatrix.js.map +1 -1
  10. package/FlowGraph/flowGraphDataConnection.d.ts +10 -1
  11. package/FlowGraph/flowGraphDataConnection.js +23 -13
  12. package/FlowGraph/flowGraphDataConnection.js.map +1 -1
  13. package/FlowGraph/flowGraphRichTypes.d.ts +5 -0
  14. package/FlowGraph/flowGraphRichTypes.js +12 -0
  15. package/FlowGraph/flowGraphRichTypes.js.map +1 -1
  16. package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.d.ts +2 -2
  17. package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.js +6 -6
  18. package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.js.map +1 -1
  19. package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.d.ts +2 -2
  20. package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.js +6 -6
  21. package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.js.map +1 -1
  22. package/FrameGraph/Node/Blocks/PostProcesses/anaglyphPostProcessBlock.d.ts +30 -0
  23. package/FrameGraph/Node/Blocks/PostProcesses/anaglyphPostProcessBlock.js +48 -0
  24. package/FrameGraph/Node/Blocks/PostProcesses/anaglyphPostProcessBlock.js.map +1 -0
  25. package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.d.ts +3 -3
  26. package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js +6 -6
  27. package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js.map +1 -1
  28. package/FrameGraph/Node/Blocks/PostProcesses/chromaticAberrationPostProcessBlock.d.ts +38 -0
  29. package/FrameGraph/Node/Blocks/PostProcesses/chromaticAberrationPostProcessBlock.js +88 -0
  30. package/FrameGraph/Node/Blocks/PostProcesses/chromaticAberrationPostProcessBlock.js.map +1 -0
  31. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.d.ts +2 -2
  32. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +6 -6
  33. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
  34. package/FrameGraph/Node/Blocks/Rendering/utilityLayerRendererBlock.d.ts +2 -2
  35. package/FrameGraph/Node/Blocks/Rendering/utilityLayerRendererBlock.js +6 -6
  36. package/FrameGraph/Node/Blocks/Rendering/utilityLayerRendererBlock.js.map +1 -1
  37. package/FrameGraph/Node/Blocks/Textures/clearBlock.d.ts +2 -2
  38. package/FrameGraph/Node/Blocks/Textures/clearBlock.js +7 -7
  39. package/FrameGraph/Node/Blocks/Textures/clearBlock.js.map +1 -1
  40. package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.d.ts +2 -2
  41. package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js +6 -6
  42. package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js.map +1 -1
  43. package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.d.ts +2 -2
  44. package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js +7 -7
  45. package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js.map +1 -1
  46. package/FrameGraph/Node/Blocks/index.d.ts +2 -0
  47. package/FrameGraph/Node/Blocks/index.js +2 -0
  48. package/FrameGraph/Node/Blocks/index.js.map +1 -1
  49. package/FrameGraph/Node/nodeRenderGraph.js +2 -2
  50. package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
  51. package/FrameGraph/Tasks/Layers/baseLayerTask.d.ts +3 -3
  52. package/FrameGraph/Tasks/Layers/baseLayerTask.js +12 -12
  53. package/FrameGraph/Tasks/Layers/baseLayerTask.js.map +1 -1
  54. package/FrameGraph/Tasks/PostProcesses/anaglyphTask.d.ts +21 -0
  55. package/FrameGraph/Tasks/PostProcesses/anaglyphTask.js +27 -0
  56. package/FrameGraph/Tasks/PostProcesses/anaglyphTask.js.map +1 -0
  57. package/FrameGraph/Tasks/PostProcesses/bloomTask.d.ts +2 -2
  58. package/FrameGraph/Tasks/PostProcesses/bloomTask.js +5 -5
  59. package/FrameGraph/Tasks/PostProcesses/bloomTask.js.map +1 -1
  60. package/FrameGraph/Tasks/PostProcesses/chromaticAberrationTask.d.ts +17 -0
  61. package/FrameGraph/Tasks/PostProcesses/chromaticAberrationTask.js +23 -0
  62. package/FrameGraph/Tasks/PostProcesses/chromaticAberrationTask.js.map +1 -0
  63. package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.d.ts +2 -2
  64. package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js +5 -5
  65. package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js.map +1 -1
  66. package/FrameGraph/Tasks/PostProcesses/postProcessTask.d.ts +2 -2
  67. package/FrameGraph/Tasks/PostProcesses/postProcessTask.js +1 -1
  68. package/FrameGraph/Tasks/PostProcesses/postProcessTask.js.map +1 -1
  69. package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.d.ts +2 -2
  70. package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.js +8 -8
  71. package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.js.map +1 -1
  72. package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +3 -3
  73. package/FrameGraph/Tasks/Rendering/objectRendererTask.js +9 -9
  74. package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
  75. package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js +7 -7
  76. package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js.map +1 -1
  77. package/FrameGraph/Tasks/Rendering/utilityLayerRendererTask.d.ts +3 -3
  78. package/FrameGraph/Tasks/Rendering/utilityLayerRendererTask.js +3 -3
  79. package/FrameGraph/Tasks/Rendering/utilityLayerRendererTask.js.map +1 -1
  80. package/FrameGraph/Tasks/Texture/clearTextureTask.d.ts +3 -3
  81. package/FrameGraph/Tasks/Texture/clearTextureTask.js +8 -8
  82. package/FrameGraph/Tasks/Texture/clearTextureTask.js.map +1 -1
  83. package/FrameGraph/Tasks/Texture/copyToTextureTask.d.ts +3 -3
  84. package/FrameGraph/Tasks/Texture/copyToTextureTask.js +3 -3
  85. package/FrameGraph/Tasks/Texture/copyToTextureTask.js.map +1 -1
  86. package/FrameGraph/Tasks/Texture/generateMipMapsTask.d.ts +2 -2
  87. package/FrameGraph/Tasks/Texture/generateMipMapsTask.js +5 -5
  88. package/FrameGraph/Tasks/Texture/generateMipMapsTask.js.map +1 -1
  89. package/FrameGraph/index.d.ts +2 -0
  90. package/FrameGraph/index.js +2 -0
  91. package/FrameGraph/index.js.map +1 -1
  92. package/Materials/materialDefines.js +1 -1
  93. package/Materials/materialDefines.js.map +1 -1
  94. package/Meshes/Builders/shapeBuilder.d.ts +6 -2
  95. package/Meshes/Builders/shapeBuilder.js.map +1 -1
  96. package/PostProcesses/anaglyphPostProcess.d.ts +0 -1
  97. package/PostProcesses/anaglyphPostProcess.js +14 -11
  98. package/PostProcesses/anaglyphPostProcess.js.map +1 -1
  99. package/PostProcesses/chromaticAberrationPostProcess.d.ts +15 -8
  100. package/PostProcesses/chromaticAberrationPostProcess.js +72 -42
  101. package/PostProcesses/chromaticAberrationPostProcess.js.map +1 -1
  102. package/PostProcesses/index.d.ts +2 -0
  103. package/PostProcesses/index.js +2 -0
  104. package/PostProcesses/index.js.map +1 -1
  105. package/PostProcesses/thinAnaglyphPostProcess.d.ts +23 -0
  106. package/PostProcesses/thinAnaglyphPostProcess.js +42 -0
  107. package/PostProcesses/thinAnaglyphPostProcess.js.map +1 -0
  108. package/PostProcesses/thinChromaticAberrationPostProcess.d.ts +45 -0
  109. package/PostProcesses/thinChromaticAberrationPostProcess.js +69 -0
  110. package/PostProcesses/thinChromaticAberrationPostProcess.js.map +1 -0
  111. package/package.json +1 -1
@@ -0,0 +1,23 @@
1
+ import type { Nullable, AbstractEngine, EffectWrapperCreationOptions } from "../index.js";
2
+ import { EffectWrapper } from "../Materials/effectRenderer";
3
+ /**
4
+ * Postprocess used to generate anaglyphic rendering
5
+ */
6
+ export declare class ThinAnaglyphPostProcess extends EffectWrapper {
7
+ /**
8
+ * The fragment shader url
9
+ */
10
+ static readonly FragmentUrl = "anaglyph";
11
+ /**
12
+ * The list of samplers used by the effect
13
+ */
14
+ static readonly Samplers: string[];
15
+ protected _gatherImports(useWebGPU: boolean, list: Promise<any>[]): void;
16
+ /**
17
+ * Constructs a new anaglyph post process
18
+ * @param name Name of the effect
19
+ * @param engine Engine to use to render the effect. If not provided, the last created engine will be used
20
+ * @param options Options to configure the effect
21
+ */
22
+ constructor(name: string, engine?: Nullable<AbstractEngine>, options?: EffectWrapperCreationOptions);
23
+ }
@@ -0,0 +1,42 @@
1
+ import { EffectWrapper } from "../Materials/effectRenderer.js";
2
+ import { Engine } from "../Engines/engine.js";
3
+ /**
4
+ * Postprocess used to generate anaglyphic rendering
5
+ */
6
+ export class ThinAnaglyphPostProcess extends EffectWrapper {
7
+ _gatherImports(useWebGPU, list) {
8
+ if (useWebGPU) {
9
+ this._webGPUReady = true;
10
+ list.push(import("../ShadersWGSL/anaglyph.fragment.js"));
11
+ }
12
+ else {
13
+ list.push(import("../Shaders/anaglyph.fragment.js"));
14
+ }
15
+ }
16
+ /**
17
+ * Constructs a new anaglyph post process
18
+ * @param name Name of the effect
19
+ * @param engine Engine to use to render the effect. If not provided, the last created engine will be used
20
+ * @param options Options to configure the effect
21
+ */
22
+ constructor(name, engine = null, options) {
23
+ super({
24
+ ...options,
25
+ name,
26
+ engine: engine || Engine.LastCreatedEngine,
27
+ useShaderStore: true,
28
+ useAsPostProcess: true,
29
+ fragmentShader: ThinAnaglyphPostProcess.FragmentUrl,
30
+ samplers: ThinAnaglyphPostProcess.Samplers,
31
+ });
32
+ }
33
+ }
34
+ /**
35
+ * The fragment shader url
36
+ */
37
+ ThinAnaglyphPostProcess.FragmentUrl = "anaglyph";
38
+ /**
39
+ * The list of samplers used by the effect
40
+ */
41
+ ThinAnaglyphPostProcess.Samplers = ["leftSampler"];
42
+ //# sourceMappingURL=thinAnaglyphPostProcess.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"thinAnaglyphPostProcess.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/thinAnaglyphPostProcess.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,aAAa;IAWnC,cAAc,CAAC,SAAkB,EAAE,IAAoB;QACtE,IAAI,SAAS,EAAE,CAAC;YACZ,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;YACzB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,kCAAkC,CAAC,CAAC,CAAC;QAC1D,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,8BAA8B,CAAC,CAAC,CAAC;QACtD,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,YAAY,IAAY,EAAE,SAAmC,IAAI,EAAE,OAAsC;QACrG,KAAK,CAAC;YACF,GAAG,OAAO;YACV,IAAI;YACJ,MAAM,EAAE,MAAM,IAAI,MAAM,CAAC,iBAAkB;YAC3C,cAAc,EAAE,IAAI;YACpB,gBAAgB,EAAE,IAAI;YACtB,cAAc,EAAE,uBAAuB,CAAC,WAAW;YACnD,QAAQ,EAAE,uBAAuB,CAAC,QAAQ;SAC7C,CAAC,CAAC;IACP,CAAC;;AAnCD;;GAEG;AACoB,mCAAW,GAAG,UAAU,CAAC;AAEhD;;GAEG;AACoB,gCAAQ,GAAG,CAAC,aAAa,CAAC,CAAC","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { Nullable, AbstractEngine, EffectWrapperCreationOptions } from \"core/index\";\r\nimport { EffectWrapper } from \"../Materials/effectRenderer\";\r\nimport { Engine } from \"../Engines/engine\";\r\n\r\n/**\r\n * Postprocess used to generate anaglyphic rendering\r\n */\r\nexport class ThinAnaglyphPostProcess extends EffectWrapper {\r\n /**\r\n * The fragment shader url\r\n */\r\n public static readonly FragmentUrl = \"anaglyph\";\r\n\r\n /**\r\n * The list of samplers used by the effect\r\n */\r\n public static readonly Samplers = [\"leftSampler\"];\r\n\r\n protected override _gatherImports(useWebGPU: boolean, list: Promise<any>[]) {\r\n if (useWebGPU) {\r\n this._webGPUReady = true;\r\n list.push(import(\"../ShadersWGSL/anaglyph.fragment\"));\r\n } else {\r\n list.push(import(\"../Shaders/anaglyph.fragment\"));\r\n }\r\n }\r\n\r\n /**\r\n * Constructs a new anaglyph post process\r\n * @param name Name of the effect\r\n * @param engine Engine to use to render the effect. If not provided, the last created engine will be used\r\n * @param options Options to configure the effect\r\n */\r\n constructor(name: string, engine: Nullable<AbstractEngine> = null, options?: EffectWrapperCreationOptions) {\r\n super({\r\n ...options,\r\n name,\r\n engine: engine || Engine.LastCreatedEngine!,\r\n useShaderStore: true,\r\n useAsPostProcess: true,\r\n fragmentShader: ThinAnaglyphPostProcess.FragmentUrl,\r\n samplers: ThinAnaglyphPostProcess.Samplers,\r\n });\r\n }\r\n}\r\n"]}
@@ -0,0 +1,45 @@
1
+ import type { Nullable, AbstractEngine, EffectWrapperCreationOptions } from "../index.js";
2
+ import { EffectWrapper } from "../Materials/effectRenderer";
3
+ import { Vector2 } from "../Maths/math.vector";
4
+ /**
5
+ * The ChromaticAberrationPostProcess separates the rgb channels in an image to produce chromatic distortion around the edges of the screen
6
+ */
7
+ export declare class ThinChromaticAberrationPostProcess extends EffectWrapper {
8
+ /**
9
+ * The fragment shader url
10
+ */
11
+ static readonly FragmentUrl = "chromaticAberration";
12
+ /**
13
+ * The list of uniforms used by the effect
14
+ */
15
+ static readonly Uniforms: string[];
16
+ protected _gatherImports(useWebGPU: boolean, list: Promise<any>[]): void;
17
+ /**
18
+ * Constructs a new chromatic aberration post process
19
+ * @param name Name of the effect
20
+ * @param engine Engine to use to render the effect. If not provided, the last created engine will be used
21
+ * @param options Options to configure the effect
22
+ */
23
+ constructor(name: string, engine?: Nullable<AbstractEngine>, options?: EffectWrapperCreationOptions);
24
+ /**
25
+ * The amount of separation of rgb channels (default: 30)
26
+ */
27
+ aberrationAmount: number;
28
+ /**
29
+ * The amount the effect will increase for pixels closer to the edge of the screen. (default: 0)
30
+ */
31
+ radialIntensity: number;
32
+ /**
33
+ * The normalized direction in which the rgb channels should be separated. If set to 0,0 radial direction will be used. (default: Vector2(0.707,0.707))
34
+ */
35
+ direction: Vector2;
36
+ /**
37
+ * The center position where the radialIntensity should be around. [0.5,0.5 is center of screen, 1,1 is top right corner] (default: Vector2(0.5 ,0.5))
38
+ */
39
+ centerPosition: Vector2;
40
+ /** The width of the screen to apply the effect on */
41
+ screenWidth: number;
42
+ /** The height of the screen to apply the effect on */
43
+ screenHeight: number;
44
+ bind(): void;
45
+ }
@@ -0,0 +1,69 @@
1
+ import { EffectWrapper } from "../Materials/effectRenderer.js";
2
+ import { Engine } from "../Engines/engine.js";
3
+ import { Vector2 } from "../Maths/math.vector.js";
4
+ /**
5
+ * The ChromaticAberrationPostProcess separates the rgb channels in an image to produce chromatic distortion around the edges of the screen
6
+ */
7
+ export class ThinChromaticAberrationPostProcess extends EffectWrapper {
8
+ _gatherImports(useWebGPU, list) {
9
+ if (useWebGPU) {
10
+ this._webGPUReady = true;
11
+ list.push(import("../ShadersWGSL/chromaticAberration.fragment.js"));
12
+ }
13
+ else {
14
+ list.push(import("../Shaders/chromaticAberration.fragment.js"));
15
+ }
16
+ }
17
+ /**
18
+ * Constructs a new chromatic aberration post process
19
+ * @param name Name of the effect
20
+ * @param engine Engine to use to render the effect. If not provided, the last created engine will be used
21
+ * @param options Options to configure the effect
22
+ */
23
+ constructor(name, engine = null, options) {
24
+ super({
25
+ ...options,
26
+ name,
27
+ engine: engine || Engine.LastCreatedEngine,
28
+ useShaderStore: true,
29
+ useAsPostProcess: true,
30
+ fragmentShader: ThinChromaticAberrationPostProcess.FragmentUrl,
31
+ uniforms: ThinChromaticAberrationPostProcess.Uniforms,
32
+ });
33
+ /**
34
+ * The amount of separation of rgb channels (default: 30)
35
+ */
36
+ this.aberrationAmount = 30;
37
+ /**
38
+ * The amount the effect will increase for pixels closer to the edge of the screen. (default: 0)
39
+ */
40
+ this.radialIntensity = 0;
41
+ /**
42
+ * The normalized direction in which the rgb channels should be separated. If set to 0,0 radial direction will be used. (default: Vector2(0.707,0.707))
43
+ */
44
+ this.direction = new Vector2(0.707, 0.707);
45
+ /**
46
+ * The center position where the radialIntensity should be around. [0.5,0.5 is center of screen, 1,1 is top right corner] (default: Vector2(0.5 ,0.5))
47
+ */
48
+ this.centerPosition = new Vector2(0.5, 0.5);
49
+ }
50
+ bind() {
51
+ super.bind();
52
+ const effect = this._drawWrapper.effect;
53
+ effect.setFloat("chromatic_aberration", this.aberrationAmount);
54
+ effect.setFloat("screen_width", this.screenWidth);
55
+ effect.setFloat("screen_height", this.screenHeight);
56
+ effect.setFloat("radialIntensity", this.radialIntensity);
57
+ effect.setFloat2("direction", this.direction.x, this.direction.y);
58
+ effect.setFloat2("centerPosition", this.centerPosition.x, this.centerPosition.y);
59
+ }
60
+ }
61
+ /**
62
+ * The fragment shader url
63
+ */
64
+ ThinChromaticAberrationPostProcess.FragmentUrl = "chromaticAberration";
65
+ /**
66
+ * The list of uniforms used by the effect
67
+ */
68
+ ThinChromaticAberrationPostProcess.Uniforms = ["chromatic_aberration", "screen_width", "screen_height", "direction", "radialIntensity", "centerPosition"];
69
+ //# sourceMappingURL=thinChromaticAberrationPostProcess.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"thinChromaticAberrationPostProcess.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/thinChromaticAberrationPostProcess.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C;;GAEG;AACH,MAAM,OAAO,kCAAmC,SAAQ,aAAa;IAW9C,cAAc,CAAC,SAAkB,EAAE,IAAoB;QACtE,IAAI,SAAS,EAAE,CAAC;YACZ,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;YACzB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,6CAA6C,CAAC,CAAC,CAAC;QACrE,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,yCAAyC,CAAC,CAAC,CAAC;QACjE,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,YAAY,IAAY,EAAE,SAAmC,IAAI,EAAE,OAAsC;QACrG,KAAK,CAAC;YACF,GAAG,OAAO;YACV,IAAI;YACJ,MAAM,EAAE,MAAM,IAAI,MAAM,CAAC,iBAAkB;YAC3C,cAAc,EAAE,IAAI;YACpB,gBAAgB,EAAE,IAAI;YACtB,cAAc,EAAE,kCAAkC,CAAC,WAAW;YAC9D,QAAQ,EAAE,kCAAkC,CAAC,QAAQ;SACxD,CAAC,CAAC;QAGP;;WAEG;QACI,qBAAgB,GAAG,EAAE,CAAC;QAE7B;;WAEG;QACI,oBAAe,GAAG,CAAC,CAAC;QAE3B;;WAEG;QACI,cAAS,GAAG,IAAI,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAE7C;;WAEG;QACI,mBAAc,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IApB9C,CAAC;IA4Be,IAAI;QAChB,KAAK,CAAC,IAAI,EAAE,CAAC;QAEb,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,MAAO,CAAC;QAEzC,MAAM,CAAC,QAAQ,CAAC,sBAAsB,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAC/D,MAAM,CAAC,QAAQ,CAAC,cAAc,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QAClD,MAAM,CAAC,QAAQ,CAAC,eAAe,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QACpD,MAAM,CAAC,QAAQ,CAAC,iBAAiB,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;QACzD,MAAM,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAClE,MAAM,CAAC,SAAS,CAAC,gBAAgB,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IACrF,CAAC;;AA1ED;;GAEG;AACoB,8CAAW,GAAG,qBAAqB,AAAxB,CAAyB;AAE3D;;GAEG;AACoB,2CAAQ,GAAG,CAAC,sBAAsB,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,iBAAiB,EAAE,gBAAgB,CAAC,AAA9G,CAA+G","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { Nullable, AbstractEngine, EffectWrapperCreationOptions } from \"core/index\";\r\nimport { EffectWrapper } from \"../Materials/effectRenderer\";\r\nimport { Engine } from \"../Engines/engine\";\r\nimport { Vector2 } from \"../Maths/math.vector\";\r\n\r\n/**\r\n * The ChromaticAberrationPostProcess separates the rgb channels in an image to produce chromatic distortion around the edges of the screen\r\n */\r\nexport class ThinChromaticAberrationPostProcess extends EffectWrapper {\r\n /**\r\n * The fragment shader url\r\n */\r\n public static readonly FragmentUrl = \"chromaticAberration\";\r\n\r\n /**\r\n * The list of uniforms used by the effect\r\n */\r\n public static readonly Uniforms = [\"chromatic_aberration\", \"screen_width\", \"screen_height\", \"direction\", \"radialIntensity\", \"centerPosition\"];\r\n\r\n protected override _gatherImports(useWebGPU: boolean, list: Promise<any>[]) {\r\n if (useWebGPU) {\r\n this._webGPUReady = true;\r\n list.push(import(\"../ShadersWGSL/chromaticAberration.fragment\"));\r\n } else {\r\n list.push(import(\"../Shaders/chromaticAberration.fragment\"));\r\n }\r\n }\r\n\r\n /**\r\n * Constructs a new chromatic aberration post process\r\n * @param name Name of the effect\r\n * @param engine Engine to use to render the effect. If not provided, the last created engine will be used\r\n * @param options Options to configure the effect\r\n */\r\n constructor(name: string, engine: Nullable<AbstractEngine> = null, options?: EffectWrapperCreationOptions) {\r\n super({\r\n ...options,\r\n name,\r\n engine: engine || Engine.LastCreatedEngine!,\r\n useShaderStore: true,\r\n useAsPostProcess: true,\r\n fragmentShader: ThinChromaticAberrationPostProcess.FragmentUrl,\r\n uniforms: ThinChromaticAberrationPostProcess.Uniforms,\r\n });\r\n }\r\n\r\n /**\r\n * The amount of separation of rgb channels (default: 30)\r\n */\r\n public aberrationAmount = 30;\r\n\r\n /**\r\n * The amount the effect will increase for pixels closer to the edge of the screen. (default: 0)\r\n */\r\n public radialIntensity = 0;\r\n\r\n /**\r\n * The normalized direction in which the rgb channels should be separated. If set to 0,0 radial direction will be used. (default: Vector2(0.707,0.707))\r\n */\r\n public direction = new Vector2(0.707, 0.707);\r\n\r\n /**\r\n * The center position where the radialIntensity should be around. [0.5,0.5 is center of screen, 1,1 is top right corner] (default: Vector2(0.5 ,0.5))\r\n */\r\n public centerPosition = new Vector2(0.5, 0.5);\r\n\r\n /** The width of the screen to apply the effect on */\r\n public screenWidth: number;\r\n\r\n /** The height of the screen to apply the effect on */\r\n public screenHeight: number;\r\n\r\n public override bind() {\r\n super.bind();\r\n\r\n const effect = this._drawWrapper.effect!;\r\n\r\n effect.setFloat(\"chromatic_aberration\", this.aberrationAmount);\r\n effect.setFloat(\"screen_width\", this.screenWidth);\r\n effect.setFloat(\"screen_height\", this.screenHeight);\r\n effect.setFloat(\"radialIntensity\", this.radialIntensity);\r\n effect.setFloat2(\"direction\", this.direction.x, this.direction.y);\r\n effect.setFloat2(\"centerPosition\", this.centerPosition.x, this.centerPosition.y);\r\n }\r\n}\r\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babylonjs/core",
3
- "version": "7.53.0",
3
+ "version": "7.53.1",
4
4
  "main": "index.js",
5
5
  "module": "index.js",
6
6
  "types": "index.d.ts",