@babylonjs/core 7.53.0 → 7.53.2

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 (126) hide show
  1. package/Culling/Helper/boundingInfoHelper.d.ts +2 -2
  2. package/Culling/Helper/boundingInfoHelper.js +2 -2
  3. package/Culling/Helper/boundingInfoHelper.js.map +1 -1
  4. package/Engines/abstractEngine.js +2 -2
  5. package/Engines/abstractEngine.js.map +1 -1
  6. package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js +1 -1
  7. package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js.map +1 -1
  8. package/FlowGraph/Blocks/Data/Math/flowGraphMatrixMathBlocks.js +7 -2
  9. package/FlowGraph/Blocks/Data/Math/flowGraphMatrixMathBlocks.js.map +1 -1
  10. package/FlowGraph/CustomTypes/flowGraphMatrix.d.ts +1 -0
  11. package/FlowGraph/CustomTypes/flowGraphMatrix.js +18 -17
  12. package/FlowGraph/CustomTypes/flowGraphMatrix.js.map +1 -1
  13. package/FlowGraph/flowGraphDataConnection.d.ts +10 -1
  14. package/FlowGraph/flowGraphDataConnection.js +23 -13
  15. package/FlowGraph/flowGraphDataConnection.js.map +1 -1
  16. package/FlowGraph/flowGraphRichTypes.d.ts +5 -0
  17. package/FlowGraph/flowGraphRichTypes.js +12 -0
  18. package/FlowGraph/flowGraphRichTypes.js.map +1 -1
  19. package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.d.ts +2 -2
  20. package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.js +6 -6
  21. package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.js.map +1 -1
  22. package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.d.ts +2 -2
  23. package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.js +6 -6
  24. package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.js.map +1 -1
  25. package/FrameGraph/Node/Blocks/PostProcesses/anaglyphPostProcessBlock.d.ts +30 -0
  26. package/FrameGraph/Node/Blocks/PostProcesses/anaglyphPostProcessBlock.js +48 -0
  27. package/FrameGraph/Node/Blocks/PostProcesses/anaglyphPostProcessBlock.js.map +1 -0
  28. package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.d.ts +3 -3
  29. package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js +6 -6
  30. package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js.map +1 -1
  31. package/FrameGraph/Node/Blocks/PostProcesses/chromaticAberrationPostProcessBlock.d.ts +38 -0
  32. package/FrameGraph/Node/Blocks/PostProcesses/chromaticAberrationPostProcessBlock.js +88 -0
  33. package/FrameGraph/Node/Blocks/PostProcesses/chromaticAberrationPostProcessBlock.js.map +1 -0
  34. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.d.ts +2 -2
  35. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +6 -6
  36. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
  37. package/FrameGraph/Node/Blocks/Rendering/utilityLayerRendererBlock.d.ts +2 -2
  38. package/FrameGraph/Node/Blocks/Rendering/utilityLayerRendererBlock.js +6 -6
  39. package/FrameGraph/Node/Blocks/Rendering/utilityLayerRendererBlock.js.map +1 -1
  40. package/FrameGraph/Node/Blocks/Textures/clearBlock.d.ts +2 -2
  41. package/FrameGraph/Node/Blocks/Textures/clearBlock.js +7 -7
  42. package/FrameGraph/Node/Blocks/Textures/clearBlock.js.map +1 -1
  43. package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.d.ts +2 -2
  44. package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js +6 -6
  45. package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js.map +1 -1
  46. package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.d.ts +2 -2
  47. package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js +7 -7
  48. package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js.map +1 -1
  49. package/FrameGraph/Node/Blocks/index.d.ts +2 -0
  50. package/FrameGraph/Node/Blocks/index.js +2 -0
  51. package/FrameGraph/Node/Blocks/index.js.map +1 -1
  52. package/FrameGraph/Node/nodeRenderGraph.js +2 -2
  53. package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
  54. package/FrameGraph/Tasks/Layers/baseLayerTask.d.ts +3 -3
  55. package/FrameGraph/Tasks/Layers/baseLayerTask.js +12 -12
  56. package/FrameGraph/Tasks/Layers/baseLayerTask.js.map +1 -1
  57. package/FrameGraph/Tasks/PostProcesses/anaglyphTask.d.ts +21 -0
  58. package/FrameGraph/Tasks/PostProcesses/anaglyphTask.js +27 -0
  59. package/FrameGraph/Tasks/PostProcesses/anaglyphTask.js.map +1 -0
  60. package/FrameGraph/Tasks/PostProcesses/bloomTask.d.ts +2 -2
  61. package/FrameGraph/Tasks/PostProcesses/bloomTask.js +5 -5
  62. package/FrameGraph/Tasks/PostProcesses/bloomTask.js.map +1 -1
  63. package/FrameGraph/Tasks/PostProcesses/chromaticAberrationTask.d.ts +17 -0
  64. package/FrameGraph/Tasks/PostProcesses/chromaticAberrationTask.js +23 -0
  65. package/FrameGraph/Tasks/PostProcesses/chromaticAberrationTask.js.map +1 -0
  66. package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.d.ts +2 -2
  67. package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js +5 -5
  68. package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js.map +1 -1
  69. package/FrameGraph/Tasks/PostProcesses/postProcessTask.d.ts +2 -2
  70. package/FrameGraph/Tasks/PostProcesses/postProcessTask.js +1 -1
  71. package/FrameGraph/Tasks/PostProcesses/postProcessTask.js.map +1 -1
  72. package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.d.ts +2 -2
  73. package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.js +8 -8
  74. package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.js.map +1 -1
  75. package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +3 -3
  76. package/FrameGraph/Tasks/Rendering/objectRendererTask.js +9 -9
  77. package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
  78. package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js +7 -7
  79. package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js.map +1 -1
  80. package/FrameGraph/Tasks/Rendering/utilityLayerRendererTask.d.ts +3 -3
  81. package/FrameGraph/Tasks/Rendering/utilityLayerRendererTask.js +3 -3
  82. package/FrameGraph/Tasks/Rendering/utilityLayerRendererTask.js.map +1 -1
  83. package/FrameGraph/Tasks/Texture/clearTextureTask.d.ts +3 -3
  84. package/FrameGraph/Tasks/Texture/clearTextureTask.js +8 -8
  85. package/FrameGraph/Tasks/Texture/clearTextureTask.js.map +1 -1
  86. package/FrameGraph/Tasks/Texture/copyToTextureTask.d.ts +3 -3
  87. package/FrameGraph/Tasks/Texture/copyToTextureTask.js +3 -3
  88. package/FrameGraph/Tasks/Texture/copyToTextureTask.js.map +1 -1
  89. package/FrameGraph/Tasks/Texture/generateMipMapsTask.d.ts +2 -2
  90. package/FrameGraph/Tasks/Texture/generateMipMapsTask.js +5 -5
  91. package/FrameGraph/Tasks/Texture/generateMipMapsTask.js.map +1 -1
  92. package/FrameGraph/index.d.ts +2 -0
  93. package/FrameGraph/index.js +2 -0
  94. package/FrameGraph/index.js.map +1 -1
  95. package/Materials/Textures/internalTexture.js +2 -2
  96. package/Materials/Textures/internalTexture.js.map +1 -1
  97. package/Materials/material.js +1 -1
  98. package/Materials/material.js.map +1 -1
  99. package/Materials/materialDefines.js +1 -1
  100. package/Materials/materialDefines.js.map +1 -1
  101. package/Meshes/Builders/shapeBuilder.d.ts +6 -2
  102. package/Meshes/Builders/shapeBuilder.js.map +1 -1
  103. package/Meshes/subMesh.js +1 -1
  104. package/Meshes/subMesh.js.map +1 -1
  105. package/Physics/v2/characterController.d.ts +3 -2
  106. package/Physics/v2/characterController.js +12 -0
  107. package/Physics/v2/characterController.js.map +1 -1
  108. package/PostProcesses/anaglyphPostProcess.d.ts +0 -1
  109. package/PostProcesses/anaglyphPostProcess.js +14 -11
  110. package/PostProcesses/anaglyphPostProcess.js.map +1 -1
  111. package/PostProcesses/chromaticAberrationPostProcess.d.ts +15 -8
  112. package/PostProcesses/chromaticAberrationPostProcess.js +72 -42
  113. package/PostProcesses/chromaticAberrationPostProcess.js.map +1 -1
  114. package/PostProcesses/index.d.ts +2 -0
  115. package/PostProcesses/index.js +2 -0
  116. package/PostProcesses/index.js.map +1 -1
  117. package/PostProcesses/thinAnaglyphPostProcess.d.ts +23 -0
  118. package/PostProcesses/thinAnaglyphPostProcess.js +42 -0
  119. package/PostProcesses/thinAnaglyphPostProcess.js.map +1 -0
  120. package/PostProcesses/thinChromaticAberrationPostProcess.d.ts +45 -0
  121. package/PostProcesses/thinChromaticAberrationPostProcess.js +69 -0
  122. package/PostProcesses/thinChromaticAberrationPostProcess.js.map +1 -0
  123. package/package.json +1 -1
  124. package/scene.d.ts +3 -0
  125. package/scene.js +5 -0
  126. package/scene.js.map +1 -1
@@ -1,5 +1,6 @@
1
1
  import { PostProcess } from "./postProcess.js";
2
2
  import { RegisterClass } from "../Misc/typeStore.js";
3
+ import { ThinAnaglyphPostProcess } from "./thinAnaglyphPostProcess.js";
3
4
  /**
4
5
  * Postprocess used to generate anaglyphic rendering
5
6
  */
@@ -21,22 +22,24 @@ export class AnaglyphPostProcess extends PostProcess {
21
22
  * @param reusable defines if the postprocess will be reused multiple times per frame
22
23
  */
23
24
  constructor(name, options, rigCameras, samplingMode, engine, reusable) {
24
- super(name, "anaglyph", null, ["leftSampler"], options, rigCameras[1], samplingMode, engine, reusable);
25
+ const localOptions = {
26
+ samplers: ThinAnaglyphPostProcess.Samplers,
27
+ size: typeof options === "number" ? options : undefined,
28
+ camera: rigCameras[1],
29
+ samplingMode,
30
+ engine,
31
+ reusable,
32
+ ...options,
33
+ };
34
+ super(name, ThinAnaglyphPostProcess.FragmentUrl, {
35
+ effectWrapper: typeof options === "number" || !options.effectWrapper ? new ThinAnaglyphPostProcess(name, engine, localOptions) : undefined,
36
+ ...localOptions,
37
+ });
25
38
  this._passedProcess = rigCameras[0]._rigPostProcess;
26
39
  this.onApplyObservable.add((effect) => {
27
40
  effect.setTextureFromPostProcess("leftSampler", this._passedProcess);
28
41
  });
29
42
  }
30
- _gatherImports(useWebGPU, list) {
31
- if (useWebGPU) {
32
- this._webGPUReady = true;
33
- list.push(import("../ShadersWGSL/anaglyph.fragment.js"));
34
- }
35
- else {
36
- list.push(import("../Shaders/anaglyph.fragment.js"));
37
- }
38
- super._gatherImports(useWebGPU, list);
39
- }
40
43
  }
41
44
  RegisterClass("BABYLON.AnaglyphPostProcess", AnaglyphPostProcess);
42
45
  //# sourceMappingURL=anaglyphPostProcess.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"anaglyphPostProcess.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/anaglyphPostProcess.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGlD;;GAEG;AACH,MAAM,OAAO,mBAAoB,SAAQ,WAAW;IAGhD;;;OAGG;IACa,YAAY;QACxB,OAAO,qBAAqB,CAAC;IACjC,CAAC;IAED;;;;;;;;OAQG;IACH,YAAY,IAAY,EAAE,OAAoC,EAAE,UAAoB,EAAE,YAAqB,EAAE,MAAuB,EAAE,QAAkB;QACpJ,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;QACvG,IAAI,CAAC,cAAc,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC;QAEpD,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,MAAc,EAAE,EAAE;YAC1C,MAAM,CAAC,yBAAyB,CAAC,aAAa,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QACzE,CAAC,CAAC,CAAC;IACP,CAAC;IAEkB,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;QAED,KAAK,CAAC,cAAc,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAC1C,CAAC;CACJ;AAED,aAAa,CAAC,6BAA6B,EAAE,mBAAmB,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"../types\";\r\nimport type { PostProcessOptions } from \"./postProcess\";\r\nimport { PostProcess } from \"./postProcess\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\nimport type { AbstractEngine } from \"core/Engines/abstractEngine\";\r\n\r\n/**\r\n * Postprocess used to generate anaglyphic rendering\r\n */\r\nexport class AnaglyphPostProcess extends PostProcess {\r\n private _passedProcess: Nullable<PostProcess>;\r\n\r\n /**\r\n * Gets a string identifying the name of the class\r\n * @returns \"AnaglyphPostProcess\" string\r\n */\r\n public override getClassName(): string {\r\n return \"AnaglyphPostProcess\";\r\n }\r\n\r\n /**\r\n * Creates a new AnaglyphPostProcess\r\n * @param name defines postprocess name\r\n * @param options defines creation options or target ratio scale\r\n * @param rigCameras defines cameras using this postprocess\r\n * @param samplingMode defines required sampling mode (BABYLON.Texture.NEAREST_SAMPLINGMODE by default)\r\n * @param engine defines hosting engine\r\n * @param reusable defines if the postprocess will be reused multiple times per frame\r\n */\r\n constructor(name: string, options: number | PostProcessOptions, rigCameras: Camera[], samplingMode?: number, engine?: AbstractEngine, reusable?: boolean) {\r\n super(name, \"anaglyph\", null, [\"leftSampler\"], options, rigCameras[1], samplingMode, engine, reusable);\r\n this._passedProcess = rigCameras[0]._rigPostProcess;\r\n\r\n this.onApplyObservable.add((effect: Effect) => {\r\n effect.setTextureFromPostProcess(\"leftSampler\", this._passedProcess);\r\n });\r\n }\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 super._gatherImports(useWebGPU, list);\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.AnaglyphPostProcess\", AnaglyphPostProcess);\r\n"]}
1
+ {"version":3,"file":"anaglyphPostProcess.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/anaglyphPostProcess.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE;;GAEG;AACH,MAAM,OAAO,mBAAoB,SAAQ,WAAW;IAGhD;;;OAGG;IACa,YAAY;QACxB,OAAO,qBAAqB,CAAC;IACjC,CAAC;IAED;;;;;;;;OAQG;IACH,YAAY,IAAY,EAAE,OAAoC,EAAE,UAAoB,EAAE,YAAqB,EAAE,MAAuB,EAAE,QAAkB;QACpJ,MAAM,YAAY,GAAG;YACjB,QAAQ,EAAE,uBAAuB,CAAC,QAAQ;YAC1C,IAAI,EAAE,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;YACvD,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;YACrB,YAAY;YACZ,MAAM;YACN,QAAQ;YACR,GAAI,OAA8B;SACrC,CAAC;QAEF,KAAK,CAAC,IAAI,EAAE,uBAAuB,CAAC,WAAW,EAAE;YAC7C,aAAa,EAAE,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,SAAS;YAC1I,GAAG,YAAY;SAClB,CAAC,CAAC;QAEH,IAAI,CAAC,cAAc,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC;QAEpD,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,MAAc,EAAE,EAAE;YAC1C,MAAM,CAAC,yBAAyB,CAAC,aAAa,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QACzE,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AAED,aAAa,CAAC,6BAA6B,EAAE,mBAAmB,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"../types\";\r\nimport type { PostProcessOptions } from \"./postProcess\";\r\nimport { PostProcess } from \"./postProcess\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\nimport type { AbstractEngine } from \"core/Engines/abstractEngine\";\r\nimport { ThinAnaglyphPostProcess } from \"./thinAnaglyphPostProcess\";\r\n\r\n/**\r\n * Postprocess used to generate anaglyphic rendering\r\n */\r\nexport class AnaglyphPostProcess extends PostProcess {\r\n private _passedProcess: Nullable<PostProcess>;\r\n\r\n /**\r\n * Gets a string identifying the name of the class\r\n * @returns \"AnaglyphPostProcess\" string\r\n */\r\n public override getClassName(): string {\r\n return \"AnaglyphPostProcess\";\r\n }\r\n\r\n /**\r\n * Creates a new AnaglyphPostProcess\r\n * @param name defines postprocess name\r\n * @param options defines creation options or target ratio scale\r\n * @param rigCameras defines cameras using this postprocess\r\n * @param samplingMode defines required sampling mode (BABYLON.Texture.NEAREST_SAMPLINGMODE by default)\r\n * @param engine defines hosting engine\r\n * @param reusable defines if the postprocess will be reused multiple times per frame\r\n */\r\n constructor(name: string, options: number | PostProcessOptions, rigCameras: Camera[], samplingMode?: number, engine?: AbstractEngine, reusable?: boolean) {\r\n const localOptions = {\r\n samplers: ThinAnaglyphPostProcess.Samplers,\r\n size: typeof options === \"number\" ? options : undefined,\r\n camera: rigCameras[1],\r\n samplingMode,\r\n engine,\r\n reusable,\r\n ...(options as PostProcessOptions),\r\n };\r\n\r\n super(name, ThinAnaglyphPostProcess.FragmentUrl, {\r\n effectWrapper: typeof options === \"number\" || !options.effectWrapper ? new ThinAnaglyphPostProcess(name, engine, localOptions) : undefined,\r\n ...localOptions,\r\n });\r\n\r\n this._passedProcess = rigCameras[0]._rigPostProcess;\r\n\r\n this.onApplyObservable.add((effect: Effect) => {\r\n effect.setTextureFromPostProcess(\"leftSampler\", this._passedProcess);\r\n });\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.AnaglyphPostProcess\", AnaglyphPostProcess);\r\n"]}
@@ -1,10 +1,11 @@
1
- import { Vector2 } from "../Maths/math.vector";
1
+ import type { Vector2 } from "../Maths/math.vector";
2
2
  import type { Nullable } from "../types";
3
3
  import type { PostProcessOptions } from "./postProcess";
4
4
  import { PostProcess } from "./postProcess";
5
5
  import type { Camera } from "../Cameras/camera";
6
6
  import type { AbstractEngine } from "../Engines/abstractEngine";
7
7
  import type { Scene } from "../scene";
8
+ import { ThinChromaticAberrationPostProcess } from "./thinChromaticAberrationPostProcess";
8
9
  /**
9
10
  * The ChromaticAberrationPostProcess separates the rgb channels in an image to produce chromatic distortion around the edges of the screen
10
11
  */
@@ -12,28 +13,35 @@ export declare class ChromaticAberrationPostProcess extends PostProcess {
12
13
  /**
13
14
  * The amount of separation of rgb channels (default: 30)
14
15
  */
15
- aberrationAmount: number;
16
+ get aberrationAmount(): number;
17
+ set aberrationAmount(value: number);
16
18
  /**
17
19
  * The amount the effect will increase for pixels closer to the edge of the screen. (default: 0)
18
20
  */
19
- radialIntensity: number;
21
+ get radialIntensity(): number;
22
+ set radialIntensity(value: number);
20
23
  /**
21
24
  * 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))
22
25
  */
23
- direction: Vector2;
26
+ get direction(): Vector2;
27
+ set direction(value: Vector2);
24
28
  /**
25
29
  * 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))
26
30
  */
27
- centerPosition: Vector2;
31
+ get centerPosition(): Vector2;
32
+ set centerPosition(value: Vector2);
28
33
  /** The width of the screen to apply the effect on */
29
- screenWidth: number;
34
+ get screenWidth(): number;
35
+ set screenWidth(value: number);
30
36
  /** The height of the screen to apply the effect on */
31
- screenHeight: number;
37
+ get screenHeight(): number;
38
+ set screenHeight(value: number);
32
39
  /**
33
40
  * Gets a string identifying the name of the class
34
41
  * @returns "ChromaticAberrationPostProcess" string
35
42
  */
36
43
  getClassName(): string;
44
+ protected _effectWrapper: ThinChromaticAberrationPostProcess;
37
45
  /**
38
46
  * Creates a new instance ChromaticAberrationPostProcess
39
47
  * @param name The name of the effect.
@@ -48,7 +56,6 @@ export declare class ChromaticAberrationPostProcess extends PostProcess {
48
56
  * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
49
57
  */
50
58
  constructor(name: string, screenWidth: number, screenHeight: number, options: number | PostProcessOptions, camera: Nullable<Camera>, samplingMode?: number, engine?: AbstractEngine, reusable?: boolean, textureType?: number, blockCompilation?: boolean);
51
- protected _gatherImports(useWebGPU: boolean, list: Promise<any>[]): void;
52
59
  /**
53
60
  * @internal
54
61
  */
@@ -1,14 +1,64 @@
1
1
  import { __decorate } from "../tslib.es6.js";
2
- import { Vector2 } from "../Maths/math.vector.js";
3
2
  import { PostProcess } from "./postProcess.js";
4
3
 
5
4
  import { RegisterClass } from "../Misc/typeStore.js";
6
5
  import { serialize } from "../Misc/decorators.js";
7
6
  import { SerializationHelper } from "../Misc/decorators.serialization.js";
7
+ import { ThinChromaticAberrationPostProcess } from "./thinChromaticAberrationPostProcess.js";
8
8
  /**
9
9
  * The ChromaticAberrationPostProcess separates the rgb channels in an image to produce chromatic distortion around the edges of the screen
10
10
  */
11
11
  export class ChromaticAberrationPostProcess extends PostProcess {
12
+ /**
13
+ * The amount of separation of rgb channels (default: 30)
14
+ */
15
+ get aberrationAmount() {
16
+ return this._effectWrapper.aberrationAmount;
17
+ }
18
+ set aberrationAmount(value) {
19
+ this._effectWrapper.aberrationAmount = value;
20
+ }
21
+ /**
22
+ * The amount the effect will increase for pixels closer to the edge of the screen. (default: 0)
23
+ */
24
+ get radialIntensity() {
25
+ return this._effectWrapper.radialIntensity;
26
+ }
27
+ set radialIntensity(value) {
28
+ this._effectWrapper.radialIntensity = value;
29
+ }
30
+ /**
31
+ * 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))
32
+ */
33
+ get direction() {
34
+ return this._effectWrapper.direction;
35
+ }
36
+ set direction(value) {
37
+ this._effectWrapper.direction = value;
38
+ }
39
+ /**
40
+ * 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))
41
+ */
42
+ get centerPosition() {
43
+ return this._effectWrapper.centerPosition;
44
+ }
45
+ set centerPosition(value) {
46
+ this._effectWrapper.centerPosition = value;
47
+ }
48
+ /** The width of the screen to apply the effect on */
49
+ get screenWidth() {
50
+ return this._effectWrapper.screenWidth;
51
+ }
52
+ set screenWidth(value) {
53
+ this._effectWrapper.screenWidth = value;
54
+ }
55
+ /** The height of the screen to apply the effect on */
56
+ get screenHeight() {
57
+ return this._effectWrapper.screenHeight;
58
+ }
59
+ set screenHeight(value) {
60
+ this._effectWrapper.screenHeight = value;
61
+ }
12
62
  /**
13
63
  * Gets a string identifying the name of the class
14
64
  * @returns "ChromaticAberrationPostProcess" string
@@ -30,43 +80,23 @@ export class ChromaticAberrationPostProcess extends PostProcess {
30
80
  * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
31
81
  */
32
82
  constructor(name, screenWidth, screenHeight, options, camera, samplingMode, engine, reusable, textureType = 0, blockCompilation = false) {
33
- super(name, "chromaticAberration", ["chromatic_aberration", "screen_width", "screen_height", "direction", "radialIntensity", "centerPosition"], [], options, camera, samplingMode, engine, reusable, null, textureType, undefined, null, blockCompilation);
34
- /**
35
- * The amount of separation of rgb channels (default: 30)
36
- */
37
- this.aberrationAmount = 30;
38
- /**
39
- * The amount the effect will increase for pixels closer to the edge of the screen. (default: 0)
40
- */
41
- this.radialIntensity = 0;
42
- /**
43
- * 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))
44
- */
45
- this.direction = new Vector2(0.707, 0.707);
46
- /**
47
- * 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))
48
- */
49
- this.centerPosition = new Vector2(0.5, 0.5);
83
+ const localOptions = {
84
+ uniforms: ThinChromaticAberrationPostProcess.Uniforms,
85
+ size: typeof options === "number" ? options : undefined,
86
+ camera,
87
+ samplingMode,
88
+ engine,
89
+ reusable,
90
+ textureType,
91
+ blockCompilation,
92
+ ...options,
93
+ };
94
+ super(name, ThinChromaticAberrationPostProcess.FragmentUrl, {
95
+ effectWrapper: typeof options === "number" || !options.effectWrapper ? new ThinChromaticAberrationPostProcess(name, engine, localOptions) : undefined,
96
+ ...localOptions,
97
+ });
50
98
  this.screenWidth = screenWidth;
51
99
  this.screenHeight = screenHeight;
52
- this.onApplyObservable.add((effect) => {
53
- effect.setFloat("chromatic_aberration", this.aberrationAmount);
54
- effect.setFloat("screen_width", screenWidth);
55
- effect.setFloat("screen_height", 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
- _gatherImports(useWebGPU, list) {
62
- if (useWebGPU) {
63
- this._webGPUReady = true;
64
- list.push(Promise.all([import("../ShadersWGSL/chromaticAberration.fragment.js")]));
65
- }
66
- else {
67
- list.push(Promise.all([import("../Shaders/chromaticAberration.fragment.js")]));
68
- }
69
- super._gatherImports(useWebGPU, list);
70
100
  }
71
101
  /**
72
102
  * @internal
@@ -79,21 +109,21 @@ export class ChromaticAberrationPostProcess extends PostProcess {
79
109
  }
80
110
  __decorate([
81
111
  serialize()
82
- ], ChromaticAberrationPostProcess.prototype, "aberrationAmount", void 0);
112
+ ], ChromaticAberrationPostProcess.prototype, "aberrationAmount", null);
83
113
  __decorate([
84
114
  serialize()
85
- ], ChromaticAberrationPostProcess.prototype, "radialIntensity", void 0);
115
+ ], ChromaticAberrationPostProcess.prototype, "radialIntensity", null);
86
116
  __decorate([
87
117
  serialize()
88
- ], ChromaticAberrationPostProcess.prototype, "direction", void 0);
118
+ ], ChromaticAberrationPostProcess.prototype, "direction", null);
89
119
  __decorate([
90
120
  serialize()
91
- ], ChromaticAberrationPostProcess.prototype, "centerPosition", void 0);
121
+ ], ChromaticAberrationPostProcess.prototype, "centerPosition", null);
92
122
  __decorate([
93
123
  serialize()
94
- ], ChromaticAberrationPostProcess.prototype, "screenWidth", void 0);
124
+ ], ChromaticAberrationPostProcess.prototype, "screenWidth", null);
95
125
  __decorate([
96
126
  serialize()
97
- ], ChromaticAberrationPostProcess.prototype, "screenHeight", void 0);
127
+ ], ChromaticAberrationPostProcess.prototype, "screenHeight", null);
98
128
  RegisterClass("BABYLON.ChromaticAberrationPostProcess", ChromaticAberrationPostProcess);
99
129
  //# sourceMappingURL=chromaticAberrationPostProcess.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"chromaticAberrationPost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OAAe;QACrG,OAAO,mBAAmB,CAAC,KAAK,CAC5B,GAAG,EAAE;YACD,OAAO,IAAI,8BAA8B,CACrC,iBAAiB,CAAC,IAAI,EACtB,iBAAiB,CAAC,WAAW,EAC7B,iBAAiB,CAAC,YAAY,EAC9B,iBAAiB,CAAC,OAAO,EACzB,YAAY,EACZ,iBAAiB,CAAC,wBAAwB,EAC1C,KAAK,CAAC,SAAS,EAAE,EACjB,iBAAiB,CAAC,QAAQ,EAC1B,iBAAiB,CAAC,WAAW,EAC7B,KAAK,CACR,CAAC;QACN,CAAC,EACD,iBAAiB,EACjB,KAAK,EACL,OAAO,CACV,CAAC;IACN,CAAC;CACJ;AA9HG;IADC,SAAS,EAAE;wEACU;AAMtB;IADC,SAAS,EAAE;uEACQ;AAMpB;IADC,SAAS,EAAE;iEAC0B;AAMtC;IADC,SAAS,EAAE;sEAC2B;AAIvC;IADC,SAAS,EAAE;mEACQ;AAIpB;IADC,SAAS,EAAE;oEACS;AAsGzB,aAAa,CAAC,wCAAwC,EAAE,8BAA8B,CAAC,CAAC","sourcesContent":["import { Vector2 } from \"../Maths/math.vector\";\r\nimport type { Nullable } from \"../types\";\r\nimport type { PostProcessOptions } from \"./postProcess\";\r\nimport { PostProcess } from \"./postProcess\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\nimport type { AbstractEngine } from \"../Engines/abstractEngine\";\r\nimport { Constants } from \"../Engines/constants\";\r\n\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\nimport { serialize } from \"../Misc/decorators\";\r\nimport { SerializationHelper } from \"../Misc/decorators.serialization\";\r\n\r\nimport type { Scene } from \"../scene\";\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 ChromaticAberrationPostProcess extends PostProcess {\r\n /**\r\n * The amount of separation of rgb channels (default: 30)\r\n */\r\n @serialize()\r\n 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 @serialize()\r\n 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 @serialize()\r\n 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 @serialize()\r\n centerPosition = new Vector2(0.5, 0.5);\r\n\r\n /** The width of the screen to apply the effect on */\r\n @serialize()\r\n screenWidth: number;\r\n\r\n /** The height of the screen to apply the effect on */\r\n @serialize()\r\n screenHeight: number;\r\n\r\n /**\r\n * Gets a string identifying the name of the class\r\n * @returns \"ChromaticAberrationPostProcess\" string\r\n */\r\n public override getClassName(): string {\r\n return \"ChromaticAberrationPostProcess\";\r\n }\r\n\r\n /**\r\n * Creates a new instance ChromaticAberrationPostProcess\r\n * @param name The name of the effect.\r\n * @param screenWidth The width of the screen to apply the effect on.\r\n * @param screenHeight The height of the screen to apply the effect on.\r\n * @param options The required width/height ratio to downsize to before computing the render pass.\r\n * @param camera The camera to apply the render pass to.\r\n * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)\r\n * @param engine The engine which the post process will be applied. (default: current engine)\r\n * @param reusable If the post process can be reused on the same frame. (default: false)\r\n * @param textureType Type of textures used when performing the post process. (default: 0)\r\n * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)\r\n */\r\n constructor(\r\n name: string,\r\n screenWidth: number,\r\n screenHeight: number,\r\n options: number | PostProcessOptions,\r\n camera: Nullable<Camera>,\r\n samplingMode?: number,\r\n engine?: AbstractEngine,\r\n reusable?: boolean,\r\n textureType: number = Constants.TEXTURETYPE_UNSIGNED_BYTE,\r\n blockCompilation = false\r\n ) {\r\n super(\r\n name,\r\n \"chromaticAberration\",\r\n [\"chromatic_aberration\", \"screen_width\", \"screen_height\", \"direction\", \"radialIntensity\", \"centerPosition\"],\r\n [],\r\n options,\r\n camera,\r\n samplingMode,\r\n engine,\r\n reusable,\r\n null,\r\n textureType,\r\n undefined,\r\n null,\r\n blockCompilation\r\n );\r\n\r\n this.screenWidth = screenWidth;\r\n this.screenHeight = screenHeight;\r\n\r\n this.onApplyObservable.add((effect: Effect) => {\r\n effect.setFloat(\"chromatic_aberration\", this.aberrationAmount);\r\n effect.setFloat(\"screen_width\", screenWidth);\r\n effect.setFloat(\"screen_height\", 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\r\n protected override _gatherImports(useWebGPU: boolean, list: Promise<any>[]) {\r\n if (useWebGPU) {\r\n this._webGPUReady = true;\r\n list.push(Promise.all([import(\"../ShadersWGSL/chromaticAberration.fragment\")]));\r\n } else {\r\n list.push(Promise.all([import(\"../Shaders/chromaticAberration.fragment\")]));\r\n }\r\n\r\n super._gatherImports(useWebGPU, list);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public static override _Parse(parsedPostProcess: any, targetCamera: Camera, scene: Scene, rootUrl: string): Nullable<ChromaticAberrationPostProcess> {\r\n return SerializationHelper.Parse(\r\n () => {\r\n return new ChromaticAberrationPostProcess(\r\n parsedPostProcess.name,\r\n parsedPostProcess.screenWidth,\r\n parsedPostProcess.screenHeight,\r\n parsedPostProcess.options,\r\n targetCamera,\r\n parsedPostProcess.renderTargetSamplingMode,\r\n scene.getEngine(),\r\n parsedPostProcess.reusable,\r\n parsedPostProcess.textureType,\r\n false\r\n );\r\n },\r\n parsedPostProcess,\r\n scene,\r\n rootUrl\r\n );\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.ChromaticAberrationPostProcess\", ChromaticAberrationPostProcess);\r\n"]}
1
+ {"version":3,"file":"chromaticAberrationP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;;OAEG;IACI,MAAM,CAAU,MAAM,CAAC,iBAAsB,EAAE,YAAoB,EAAE,KAAY,EAAE,OAAe;QACrG,OAAO,mBAAmB,CAAC,KAAK,CAC5B,GAAG,EAAE;YACD,OAAO,IAAI,8BAA8B,CACrC,iBAAiB,CAAC,IAAI,EACtB,iBAAiB,CAAC,WAAW,EAC7B,iBAAiB,CAAC,YAAY,EAC9B,iBAAiB,CAAC,OAAO,EACzB,YAAY,EACZ,iBAAiB,CAAC,wBAAwB,EAC1C,KAAK,CAAC,SAAS,EAAE,EACjB,iBAAiB,CAAC,QAAQ,EAC1B,iBAAiB,CAAC,WAAW,EAC7B,KAAK,CACR,CAAC;QACN,CAAC,EACD,iBAAiB,EACjB,KAAK,EACL,OAAO,CACV,CAAC;IACN,CAAC;CACJ;AAhJG;IADC,SAAS,EAAE;sEAGX;AAUD;IADC,SAAS,EAAE;qEAGX;AAUD;IADC,SAAS,EAAE;+DAGX;AAUD;IADC,SAAS,EAAE;oEAGX;AAQD;IADC,SAAS,EAAE;iEAGX;AAQD;IADC,SAAS,EAAE;kEAGX;AAwFL,aAAa,CAAC,wCAAwC,EAAE,8BAA8B,CAAC,CAAC","sourcesContent":["import type { Vector2 } from \"../Maths/math.vector\";\r\nimport type { Nullable } from \"../types\";\r\nimport type { PostProcessOptions } from \"./postProcess\";\r\nimport { PostProcess } from \"./postProcess\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\nimport type { AbstractEngine } from \"../Engines/abstractEngine\";\r\nimport { Constants } from \"../Engines/constants\";\r\n\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\nimport { serialize } from \"../Misc/decorators\";\r\nimport { SerializationHelper } from \"../Misc/decorators.serialization\";\r\n\r\nimport type { Scene } from \"../scene\";\r\nimport { ThinChromaticAberrationPostProcess } from \"./thinChromaticAberrationPostProcess\";\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 ChromaticAberrationPostProcess extends PostProcess {\r\n /**\r\n * The amount of separation of rgb channels (default: 30)\r\n */\r\n @serialize()\r\n public get aberrationAmount() {\r\n return this._effectWrapper.aberrationAmount;\r\n }\r\n\r\n public set aberrationAmount(value: number) {\r\n this._effectWrapper.aberrationAmount = value;\r\n }\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 @serialize()\r\n public get radialIntensity() {\r\n return this._effectWrapper.radialIntensity;\r\n }\r\n\r\n public set radialIntensity(value: number) {\r\n this._effectWrapper.radialIntensity = value;\r\n }\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 @serialize()\r\n public get direction() {\r\n return this._effectWrapper.direction;\r\n }\r\n\r\n public set direction(value: Vector2) {\r\n this._effectWrapper.direction = value;\r\n }\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 @serialize()\r\n public get centerPosition() {\r\n return this._effectWrapper.centerPosition;\r\n }\r\n\r\n public set centerPosition(value: Vector2) {\r\n this._effectWrapper.centerPosition = value;\r\n }\r\n\r\n /** The width of the screen to apply the effect on */\r\n @serialize()\r\n public get screenWidth() {\r\n return this._effectWrapper.screenWidth;\r\n }\r\n\r\n public set screenWidth(value: number) {\r\n this._effectWrapper.screenWidth = value;\r\n }\r\n\r\n /** The height of the screen to apply the effect on */\r\n @serialize()\r\n public get screenHeight() {\r\n return this._effectWrapper.screenHeight;\r\n }\r\n\r\n public set screenHeight(value: number) {\r\n this._effectWrapper.screenHeight = value;\r\n }\r\n\r\n /**\r\n * Gets a string identifying the name of the class\r\n * @returns \"ChromaticAberrationPostProcess\" string\r\n */\r\n public override getClassName(): string {\r\n return \"ChromaticAberrationPostProcess\";\r\n }\r\n\r\n protected override _effectWrapper: ThinChromaticAberrationPostProcess;\r\n\r\n /**\r\n * Creates a new instance ChromaticAberrationPostProcess\r\n * @param name The name of the effect.\r\n * @param screenWidth The width of the screen to apply the effect on.\r\n * @param screenHeight The height of the screen to apply the effect on.\r\n * @param options The required width/height ratio to downsize to before computing the render pass.\r\n * @param camera The camera to apply the render pass to.\r\n * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)\r\n * @param engine The engine which the post process will be applied. (default: current engine)\r\n * @param reusable If the post process can be reused on the same frame. (default: false)\r\n * @param textureType Type of textures used when performing the post process. (default: 0)\r\n * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)\r\n */\r\n constructor(\r\n name: string,\r\n screenWidth: number,\r\n screenHeight: number,\r\n options: number | PostProcessOptions,\r\n camera: Nullable<Camera>,\r\n samplingMode?: number,\r\n engine?: AbstractEngine,\r\n reusable?: boolean,\r\n textureType: number = Constants.TEXTURETYPE_UNSIGNED_BYTE,\r\n blockCompilation = false\r\n ) {\r\n const localOptions = {\r\n uniforms: ThinChromaticAberrationPostProcess.Uniforms,\r\n size: typeof options === \"number\" ? options : undefined,\r\n camera,\r\n samplingMode,\r\n engine,\r\n reusable,\r\n textureType,\r\n blockCompilation,\r\n ...(options as PostProcessOptions),\r\n };\r\n\r\n super(name, ThinChromaticAberrationPostProcess.FragmentUrl, {\r\n effectWrapper: typeof options === \"number\" || !options.effectWrapper ? new ThinChromaticAberrationPostProcess(name, engine, localOptions) : undefined,\r\n ...localOptions,\r\n });\r\n\r\n this.screenWidth = screenWidth;\r\n this.screenHeight = screenHeight;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public static override _Parse(parsedPostProcess: any, targetCamera: Camera, scene: Scene, rootUrl: string): Nullable<ChromaticAberrationPostProcess> {\r\n return SerializationHelper.Parse(\r\n () => {\r\n return new ChromaticAberrationPostProcess(\r\n parsedPostProcess.name,\r\n parsedPostProcess.screenWidth,\r\n parsedPostProcess.screenHeight,\r\n parsedPostProcess.options,\r\n targetCamera,\r\n parsedPostProcess.renderTargetSamplingMode,\r\n scene.getEngine(),\r\n parsedPostProcess.reusable,\r\n parsedPostProcess.textureType,\r\n false\r\n );\r\n },\r\n parsedPostProcess,\r\n scene,\r\n rootUrl\r\n );\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.ChromaticAberrationPostProcess\", ChromaticAberrationPostProcess);\r\n"]}
@@ -31,9 +31,11 @@ export * from "./vrDistortionCorrectionPostProcess";
31
31
  export * from "./vrMultiviewToSingleviewPostProcess";
32
32
  export * from "./screenSpaceReflectionPostProcess";
33
33
  export * from "./screenSpaceCurvaturePostProcess";
34
+ export * from "./thinAnaglyphPostProcess";
34
35
  export * from "./thinBlackAndWhitePostProcess";
35
36
  export * from "./thinBloomEffect";
36
37
  export * from "./thinBlurPostProcess";
38
+ export * from "./thinChromaticAberrationPostProcess";
37
39
  export * from "./thinCircleOfConfusionPostProcess";
38
40
  export * from "./thinDepthOfFieldEffect";
39
41
  export * from "./thinExtractHighlightsPostProcess";
@@ -32,9 +32,11 @@ export * from "./vrDistortionCorrectionPostProcess.js";
32
32
  export * from "./vrMultiviewToSingleviewPostProcess.js";
33
33
  export * from "./screenSpaceReflectionPostProcess.js";
34
34
  export * from "./screenSpaceCurvaturePostProcess.js";
35
+ export * from "./thinAnaglyphPostProcess.js";
35
36
  export * from "./thinBlackAndWhitePostProcess.js";
36
37
  export * from "./thinBloomEffect.js";
37
38
  export * from "./thinBlurPostProcess.js";
39
+ export * from "./thinChromaticAberrationPostProcess.js";
38
40
  export * from "./thinCircleOfConfusionPostProcess.js";
39
41
  export * from "./thinDepthOfFieldEffect.js";
40
42
  export * from "./thinExtractHighlightsPostProcess.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC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CAAC;AAEnD,UAAU;AACV,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AAEpD,UAAU;AACV,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nexport * from \"./anaglyphPostProcess\";\r\nexport * from \"./blackAndWhitePostProcess\";\r\nexport * from \"./bloomEffect\";\r\nexport * from \"./bloomMergePostProcess\";\r\nexport * from \"./blurPostProcess\";\r\nexport * from \"./chromaticAberrationPostProcess\";\r\nexport * from \"./circleOfConfusionPostProcess\";\r\nexport * from \"./colorCorrectionPostProcess\";\r\nexport * from \"./convolutionPostProcess\";\r\nexport * from \"./depthOfFieldBlurPostProcess\";\r\nexport * from \"./depthOfFieldEffect\";\r\nexport * from \"./depthOfFieldMergePostProcess\";\r\nexport * from \"./displayPassPostProcess\";\r\nexport * from \"./extractHighlightsPostProcess\";\r\nexport * from \"./filterPostProcess\";\r\nexport * from \"./fxaaPostProcess\";\r\nexport * from \"./grainPostProcess\";\r\nexport * from \"./highlightsPostProcess\";\r\nexport * from \"./imageProcessingPostProcess\";\r\nexport * from \"./motionBlurPostProcess\";\r\nexport * from \"./passPostProcess\";\r\nexport * from \"./postProcess\";\r\nexport * from \"./postProcessManager\";\r\nexport * from \"./refractionPostProcess\";\r\nexport * from \"./RenderPipeline/index\";\r\nexport * from \"./sharpenPostProcess\";\r\nexport * from \"./stereoscopicInterlacePostProcess\";\r\nexport * from \"./tonemapPostProcess\";\r\nexport * from \"./volumetricLightScatteringPostProcess\";\r\nexport * from \"./vrDistortionCorrectionPostProcess\";\r\nexport * from \"./vrMultiviewToSingleviewPostProcess\";\r\nexport * from \"./screenSpaceReflectionPostProcess\";\r\nexport * from \"./screenSpaceCurvaturePostProcess\";\r\n\r\nexport * from \"./thinBlackAndWhitePostProcess\";\r\nexport * from \"./thinBloomEffect\";\r\nexport * from \"./thinBlurPostProcess\";\r\nexport * from \"./thinCircleOfConfusionPostProcess\";\r\nexport * from \"./thinDepthOfFieldEffect\";\r\nexport * from \"./thinExtractHighlightsPostProcess\";\r\nexport * from \"./thinPassPostProcess\";\r\n\r\n// Postprocess\r\nexport * from \"../Shaders/postprocess.vertex\";\r\nexport * from \"../ShadersWGSL/postprocess.vertex\";\r\n\r\n// Blur postprocess\r\nexport * from \"../Shaders/kernelBlur.fragment\";\r\nexport * from \"../Shaders/kernelBlur.vertex\";\r\nexport * from \"../ShadersWGSL/kernelBlur.fragment\";\r\nexport * from \"../ShadersWGSL/kernelBlur.vertex\";\r\n\r\n// Pass postprocess\r\nexport * from \"../Shaders/pass.fragment\";\r\nexport * from \"../Shaders/passCube.fragment\";\r\nexport * from \"../ShadersWGSL/pass.fragment\";\r\nexport * from \"../ShadersWGSL/passCube.fragment\";\r\n\r\n// vrDFistortionCorrection postprocess\r\nexport * from \"../Shaders/vrDistortionCorrection.fragment\";\r\nexport * from \"../ShadersWGSL/vrDistortionCorrection.fragment\";\r\n\r\n// Image processing postprocess\r\nexport * from \"../ShadersWGSL/imageProcessing.fragment\";\r\nexport * from \"../Shaders/imageProcessing.fragment\";\r\n\r\n// Sharpen\r\nexport * from \"../Shaders/sharpen.fragment\";\r\nexport * from \"../ShadersWGSL/sharpen.fragment\";\r\n\r\n// Grain\r\nexport * from \"../Shaders/grain.fragment\";\r\nexport * from \"../ShadersWGSL/grain.fragment\";\r\n\r\n// Chromatic Aberration\r\nexport * from \"../Shaders/chromaticAberration.fragment\";\r\nexport * from \"../ShadersWGSL/chromaticAberration.fragment\";\r\n\r\n// Depth of field merge\r\nexport * from \"../Shaders/depthOfFieldMerge.fragment\";\r\nexport * from \"../ShadersWGSL/depthOfFieldMerge.fragment\";\r\n\r\n// Circle of confusion\r\nexport * from \"../Shaders/circleOfConfusion.fragment\";\r\nexport * from \"../ShadersWGSL/circleOfConfusion.fragment\";\r\n\r\n// Bloom\r\nexport * from \"../Shaders/bloomMerge.fragment\";\r\nexport * from \"../ShadersWGSL/bloomMerge.fragment\";\r\n\r\n// Extract highlights\r\nexport * from \"../Shaders/extractHighlights.fragment\";\r\nexport * from \"../ShadersWGSL/extractHighlights.fragment\";\r\n\r\n// FXAA\r\nexport * from \"../Shaders/fxaa.fragment\";\r\nexport * from \"../Shaders/fxaa.vertex\";\r\nexport * from \"../ShadersWGSL/fxaa.fragment\";\r\nexport * from \"../ShadersWGSL/fxaa.vertex\";\r\n\r\n// B&W\r\nexport * from \"../Shaders/blackAndWhite.fragment\";\r\nexport * from \"../ShadersWGSL/blackAndWhite.fragment\";\r\n\r\n// Anaglyph\r\nexport * from \"../Shaders/anaglyph.fragment\";\r\nexport * from \"../ShadersWGSL/anaglyph.fragment\";\r\n\r\n// Convolution\r\nexport * from \"../Shaders/convolution.fragment\";\r\nexport * from \"../ShadersWGSL/convolution.fragment\";\r\n\r\n// Color correction\r\nexport * from \"../Shaders/colorCorrection.fragment\";\r\nexport * from \"../ShadersWGSL/colorCorrection.fragment\";\r\n\r\n// Motion blur\r\nexport * from \"../Shaders/motionBlur.fragment\";\r\nexport * from \"../ShadersWGSL/motionBlur.fragment\";\r\n\r\n// Filter\r\nexport * from \"../Shaders/filter.fragment\";\r\nexport * from \"../ShadersWGSL/filter.fragment\";\r\n\r\n// Highlights\r\nexport * from \"../Shaders/highlights.fragment\";\r\nexport * from \"../ShadersWGSL/highlights.fragment\";\r\n\r\n// Display\r\nexport * from \"../Shaders/displayPass.fragment\";\r\nexport * from \"../ShadersWGSL/displayPass.fragment\";\r\n\r\n// Tonemap\r\nexport * from \"../Shaders/tonemap.fragment\";\r\nexport * from \"../ShadersWGSL/tonemap.fragment\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC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CAAC;AAC/C,cAAc,oCAAoC,CAAC;AAEnD,UAAU;AACV,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AAEpD,UAAU;AACV,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nexport * from \"./anaglyphPostProcess\";\r\nexport * from \"./blackAndWhitePostProcess\";\r\nexport * from \"./bloomEffect\";\r\nexport * from \"./bloomMergePostProcess\";\r\nexport * from \"./blurPostProcess\";\r\nexport * from \"./chromaticAberrationPostProcess\";\r\nexport * from \"./circleOfConfusionPostProcess\";\r\nexport * from \"./colorCorrectionPostProcess\";\r\nexport * from \"./convolutionPostProcess\";\r\nexport * from \"./depthOfFieldBlurPostProcess\";\r\nexport * from \"./depthOfFieldEffect\";\r\nexport * from \"./depthOfFieldMergePostProcess\";\r\nexport * from \"./displayPassPostProcess\";\r\nexport * from \"./extractHighlightsPostProcess\";\r\nexport * from \"./filterPostProcess\";\r\nexport * from \"./fxaaPostProcess\";\r\nexport * from \"./grainPostProcess\";\r\nexport * from \"./highlightsPostProcess\";\r\nexport * from \"./imageProcessingPostProcess\";\r\nexport * from \"./motionBlurPostProcess\";\r\nexport * from \"./passPostProcess\";\r\nexport * from \"./postProcess\";\r\nexport * from \"./postProcessManager\";\r\nexport * from \"./refractionPostProcess\";\r\nexport * from \"./RenderPipeline/index\";\r\nexport * from \"./sharpenPostProcess\";\r\nexport * from \"./stereoscopicInterlacePostProcess\";\r\nexport * from \"./tonemapPostProcess\";\r\nexport * from \"./volumetricLightScatteringPostProcess\";\r\nexport * from \"./vrDistortionCorrectionPostProcess\";\r\nexport * from \"./vrMultiviewToSingleviewPostProcess\";\r\nexport * from \"./screenSpaceReflectionPostProcess\";\r\nexport * from \"./screenSpaceCurvaturePostProcess\";\r\n\r\nexport * from \"./thinAnaglyphPostProcess\";\r\nexport * from \"./thinBlackAndWhitePostProcess\";\r\nexport * from \"./thinBloomEffect\";\r\nexport * from \"./thinBlurPostProcess\";\r\nexport * from \"./thinChromaticAberrationPostProcess\";\r\nexport * from \"./thinCircleOfConfusionPostProcess\";\r\nexport * from \"./thinDepthOfFieldEffect\";\r\nexport * from \"./thinExtractHighlightsPostProcess\";\r\nexport * from \"./thinPassPostProcess\";\r\n\r\n// Postprocess\r\nexport * from \"../Shaders/postprocess.vertex\";\r\nexport * from \"../ShadersWGSL/postprocess.vertex\";\r\n\r\n// Blur postprocess\r\nexport * from \"../Shaders/kernelBlur.fragment\";\r\nexport * from \"../Shaders/kernelBlur.vertex\";\r\nexport * from \"../ShadersWGSL/kernelBlur.fragment\";\r\nexport * from \"../ShadersWGSL/kernelBlur.vertex\";\r\n\r\n// Pass postprocess\r\nexport * from \"../Shaders/pass.fragment\";\r\nexport * from \"../Shaders/passCube.fragment\";\r\nexport * from \"../ShadersWGSL/pass.fragment\";\r\nexport * from \"../ShadersWGSL/passCube.fragment\";\r\n\r\n// vrDFistortionCorrection postprocess\r\nexport * from \"../Shaders/vrDistortionCorrection.fragment\";\r\nexport * from \"../ShadersWGSL/vrDistortionCorrection.fragment\";\r\n\r\n// Image processing postprocess\r\nexport * from \"../ShadersWGSL/imageProcessing.fragment\";\r\nexport * from \"../Shaders/imageProcessing.fragment\";\r\n\r\n// Sharpen\r\nexport * from \"../Shaders/sharpen.fragment\";\r\nexport * from \"../ShadersWGSL/sharpen.fragment\";\r\n\r\n// Grain\r\nexport * from \"../Shaders/grain.fragment\";\r\nexport * from \"../ShadersWGSL/grain.fragment\";\r\n\r\n// Chromatic Aberration\r\nexport * from \"../Shaders/chromaticAberration.fragment\";\r\nexport * from \"../ShadersWGSL/chromaticAberration.fragment\";\r\n\r\n// Depth of field merge\r\nexport * from \"../Shaders/depthOfFieldMerge.fragment\";\r\nexport * from \"../ShadersWGSL/depthOfFieldMerge.fragment\";\r\n\r\n// Circle of confusion\r\nexport * from \"../Shaders/circleOfConfusion.fragment\";\r\nexport * from \"../ShadersWGSL/circleOfConfusion.fragment\";\r\n\r\n// Bloom\r\nexport * from \"../Shaders/bloomMerge.fragment\";\r\nexport * from \"../ShadersWGSL/bloomMerge.fragment\";\r\n\r\n// Extract highlights\r\nexport * from \"../Shaders/extractHighlights.fragment\";\r\nexport * from \"../ShadersWGSL/extractHighlights.fragment\";\r\n\r\n// FXAA\r\nexport * from \"../Shaders/fxaa.fragment\";\r\nexport * from \"../Shaders/fxaa.vertex\";\r\nexport * from \"../ShadersWGSL/fxaa.fragment\";\r\nexport * from \"../ShadersWGSL/fxaa.vertex\";\r\n\r\n// B&W\r\nexport * from \"../Shaders/blackAndWhite.fragment\";\r\nexport * from \"../ShadersWGSL/blackAndWhite.fragment\";\r\n\r\n// Anaglyph\r\nexport * from \"../Shaders/anaglyph.fragment\";\r\nexport * from \"../ShadersWGSL/anaglyph.fragment\";\r\n\r\n// Convolution\r\nexport * from \"../Shaders/convolution.fragment\";\r\nexport * from \"../ShadersWGSL/convolution.fragment\";\r\n\r\n// Color correction\r\nexport * from \"../Shaders/colorCorrection.fragment\";\r\nexport * from \"../ShadersWGSL/colorCorrection.fragment\";\r\n\r\n// Motion blur\r\nexport * from \"../Shaders/motionBlur.fragment\";\r\nexport * from \"../ShadersWGSL/motionBlur.fragment\";\r\n\r\n// Filter\r\nexport * from \"../Shaders/filter.fragment\";\r\nexport * from \"../ShadersWGSL/filter.fragment\";\r\n\r\n// Highlights\r\nexport * from \"../Shaders/highlights.fragment\";\r\nexport * from \"../ShadersWGSL/highlights.fragment\";\r\n\r\n// Display\r\nexport * from \"../Shaders/displayPass.fragment\";\r\nexport * from \"../ShadersWGSL/displayPass.fragment\";\r\n\r\n// Tonemap\r\nexport * from \"../Shaders/tonemap.fragment\";\r\nexport * from \"../ShadersWGSL/tonemap.fragment\";\r\n"]}
@@ -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,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AE,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"]}