@babylonjs/core 8.1.0 → 8.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/AudioV2/abstractAudio/abstractSound.js +1 -1
  2. package/AudioV2/abstractAudio/abstractSound.js.map +1 -1
  3. package/Culling/Helper/boundingInfoHelper.js +9 -1
  4. package/Culling/Helper/boundingInfoHelper.js.map +1 -1
  5. package/Culling/ray.core.d.ts +1 -1
  6. package/Culling/ray.core.js +1 -1
  7. package/Culling/ray.core.js.map +1 -1
  8. package/Debug/debugLayer.js +8 -1
  9. package/Debug/debugLayer.js.map +1 -1
  10. package/Debug/physicsViewer.d.ts +4 -1
  11. package/Debug/physicsViewer.js +13 -5
  12. package/Debug/physicsViewer.js.map +1 -1
  13. package/Engines/abstractEngine.js +2 -2
  14. package/Engines/abstractEngine.js.map +1 -1
  15. package/FrameGraph/Node/Blocks/PostProcesses/imageProcessingPostProcessBlock.d.ts +71 -0
  16. package/FrameGraph/Node/Blocks/PostProcesses/imageProcessingPostProcessBlock.js +246 -0
  17. package/FrameGraph/Node/Blocks/PostProcesses/imageProcessingPostProcessBlock.js.map +1 -0
  18. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.d.ts +1 -1
  19. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +4 -4
  20. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
  21. package/FrameGraph/Node/Blocks/index.d.ts +1 -0
  22. package/FrameGraph/Node/Blocks/index.js +1 -0
  23. package/FrameGraph/Node/Blocks/index.js.map +1 -1
  24. package/FrameGraph/Tasks/PostProcesses/imageProcessingTask.d.ts +17 -0
  25. package/FrameGraph/Tasks/PostProcesses/imageProcessingTask.js +23 -0
  26. package/FrameGraph/Tasks/PostProcesses/imageProcessingTask.js.map +1 -0
  27. package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +3 -2
  28. package/FrameGraph/Tasks/Rendering/objectRendererTask.js +5 -4
  29. package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
  30. package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js +1 -1
  31. package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js.map +1 -1
  32. package/FrameGraph/index.d.ts +1 -0
  33. package/FrameGraph/index.js +1 -0
  34. package/FrameGraph/index.js.map +1 -1
  35. package/Materials/Node/Blocks/Dual/lightBlock.js +6 -3
  36. package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
  37. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +4 -2
  38. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
  39. package/Materials/PBR/pbrBaseMaterial.js +2 -1
  40. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  41. package/Materials/PBR/pbrSubSurfaceConfiguration.d.ts +13 -0
  42. package/Materials/PBR/pbrSubSurfaceConfiguration.js +17 -0
  43. package/Materials/PBR/pbrSubSurfaceConfiguration.js.map +1 -1
  44. package/Materials/Textures/renderTargetTexture.d.ts +4 -3
  45. package/Materials/Textures/renderTargetTexture.js +6 -5
  46. package/Materials/Textures/renderTargetTexture.js.map +1 -1
  47. package/Materials/Textures/texture.js +3 -2
  48. package/Materials/Textures/texture.js.map +1 -1
  49. package/Materials/effectRenderer.d.ts +2 -1
  50. package/Materials/effectRenderer.js +3 -2
  51. package/Materials/effectRenderer.js.map +1 -1
  52. package/Materials/imageProcessingConfiguration.d.ts +8 -0
  53. package/Materials/imageProcessingConfiguration.js +16 -2
  54. package/Materials/imageProcessingConfiguration.js.map +1 -1
  55. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +15 -6
  56. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
  57. package/Misc/fileTools.d.ts +6 -0
  58. package/Misc/fileTools.js +30 -0
  59. package/Misc/fileTools.js.map +1 -1
  60. package/Physics/v2/characterController.d.ts +5 -0
  61. package/Physics/v2/characterController.js +7 -0
  62. package/Physics/v2/characterController.js.map +1 -1
  63. package/PostProcesses/imageProcessingPostProcess.d.ts +4 -21
  64. package/PostProcesses/imageProcessingPostProcess.js +27 -138
  65. package/PostProcesses/imageProcessingPostProcess.js.map +1 -1
  66. package/PostProcesses/index.d.ts +1 -0
  67. package/PostProcesses/index.js +1 -0
  68. package/PostProcesses/index.js.map +1 -1
  69. package/PostProcesses/postProcess.js +2 -1
  70. package/PostProcesses/postProcess.js.map +1 -1
  71. package/PostProcesses/thinBlackAndWhitePostProcess.d.ts +1 -1
  72. package/PostProcesses/thinBlackAndWhitePostProcess.js +2 -2
  73. package/PostProcesses/thinBlackAndWhitePostProcess.js.map +1 -1
  74. package/PostProcesses/thinBloomMergePostProcess.d.ts +1 -1
  75. package/PostProcesses/thinBloomMergePostProcess.js +2 -2
  76. package/PostProcesses/thinBloomMergePostProcess.js.map +1 -1
  77. package/PostProcesses/thinBlurPostProcess.d.ts +1 -1
  78. package/PostProcesses/thinBlurPostProcess.js +2 -2
  79. package/PostProcesses/thinBlurPostProcess.js.map +1 -1
  80. package/PostProcesses/thinChromaticAberrationPostProcess.d.ts +3 -3
  81. package/PostProcesses/thinChromaticAberrationPostProcess.js +2 -2
  82. package/PostProcesses/thinChromaticAberrationPostProcess.js.map +1 -1
  83. package/PostProcesses/thinCircleOfConfusionPostProcess.d.ts +1 -1
  84. package/PostProcesses/thinCircleOfConfusionPostProcess.js +2 -2
  85. package/PostProcesses/thinCircleOfConfusionPostProcess.js.map +1 -1
  86. package/PostProcesses/thinExtractHighlightsPostProcess.d.ts +1 -1
  87. package/PostProcesses/thinExtractHighlightsPostProcess.js +2 -2
  88. package/PostProcesses/thinExtractHighlightsPostProcess.js.map +1 -1
  89. package/PostProcesses/thinImageProcessingPostProcess.d.ts +258 -0
  90. package/PostProcesses/thinImageProcessingPostProcess.js +462 -0
  91. package/PostProcesses/thinImageProcessingPostProcess.js.map +1 -0
  92. package/PostProcesses/thinSSRBlurCombinerPostProcess.d.ts +1 -1
  93. package/PostProcesses/thinSSRBlurCombinerPostProcess.js +2 -2
  94. package/PostProcesses/thinSSRBlurCombinerPostProcess.js.map +1 -1
  95. package/PostProcesses/thinSSRBlurPostProcess.d.ts +1 -1
  96. package/PostProcesses/thinSSRBlurPostProcess.js +2 -2
  97. package/PostProcesses/thinSSRBlurPostProcess.js.map +1 -1
  98. package/PostProcesses/thinSSRPostProcess.d.ts +1 -1
  99. package/PostProcesses/thinSSRPostProcess.js +2 -2
  100. package/PostProcesses/thinSSRPostProcess.js.map +1 -1
  101. package/PostProcesses/thinTAAPostProcess.d.ts +1 -1
  102. package/PostProcesses/thinTAAPostProcess.js +2 -2
  103. package/PostProcesses/thinTAAPostProcess.js.map +1 -1
  104. package/Rendering/objectRenderer.d.ts +5 -5
  105. package/Rendering/objectRenderer.js +11 -11
  106. package/Rendering/objectRenderer.js.map +1 -1
  107. package/Shaders/ShadersInclude/lightFragment.js +10 -7
  108. package/Shaders/ShadersInclude/lightFragment.js.map +1 -1
  109. package/Shaders/ShadersInclude/pbrBRDFFunctions.js +5 -1
  110. package/Shaders/ShadersInclude/pbrBRDFFunctions.js.map +1 -1
  111. package/Shaders/ShadersInclude/pbrBlockDirectLighting.js +1 -1
  112. package/Shaders/ShadersInclude/pbrBlockDirectLighting.js.map +1 -1
  113. package/Shaders/ShadersInclude/pbrBlockFinalUnlitComponents.js +1 -1
  114. package/Shaders/ShadersInclude/pbrBlockFinalUnlitComponents.js.map +1 -1
  115. package/Shaders/ShadersInclude/pbrBlockReflectance.js +1 -1
  116. package/Shaders/ShadersInclude/pbrBlockReflectance.js.map +1 -1
  117. package/Shaders/ShadersInclude/pbrBlockReflectivity.js +2 -2
  118. package/Shaders/ShadersInclude/pbrBlockReflectivity.js.map +1 -1
  119. package/Shaders/ShadersInclude/pbrDirectLightingFunctions.js +16 -4
  120. package/Shaders/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
  121. package/Shaders/gaussianSplatting.vertex.js +1 -1
  122. package/Shaders/gaussianSplatting.vertex.js.map +1 -1
  123. package/ShadersWGSL/ShadersInclude/lightFragment.js +10 -7
  124. package/ShadersWGSL/ShadersInclude/lightFragment.js.map +1 -1
  125. package/ShadersWGSL/ShadersInclude/pbrBRDFFunctions.js +5 -1
  126. package/ShadersWGSL/ShadersInclude/pbrBRDFFunctions.js.map +1 -1
  127. package/ShadersWGSL/ShadersInclude/pbrBlockDirectLighting.js +1 -1
  128. package/ShadersWGSL/ShadersInclude/pbrBlockDirectLighting.js.map +1 -1
  129. package/ShadersWGSL/ShadersInclude/pbrBlockFinalUnlitComponents.js +1 -1
  130. package/ShadersWGSL/ShadersInclude/pbrBlockFinalUnlitComponents.js.map +1 -1
  131. package/ShadersWGSL/ShadersInclude/pbrBlockReflectance.js +1 -1
  132. package/ShadersWGSL/ShadersInclude/pbrBlockReflectance.js.map +1 -1
  133. package/ShadersWGSL/ShadersInclude/pbrBlockReflectivity.js +2 -2
  134. package/ShadersWGSL/ShadersInclude/pbrBlockReflectivity.js.map +1 -1
  135. package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js +24 -8
  136. package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
  137. package/ShadersWGSL/gaussianSplatting.vertex.d.ts +1 -0
  138. package/ShadersWGSL/gaussianSplatting.vertex.js +4 -1
  139. package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
  140. package/package.json +1 -1
@@ -47,8 +47,8 @@ export class ThinChromaticAberrationPostProcess extends EffectWrapper {
47
47
  */
48
48
  this.centerPosition = new Vector2(0.5, 0.5);
49
49
  }
50
- bind() {
51
- super.bind();
50
+ bind(noDefaultBindings = false) {
51
+ super.bind(noDefaultBindings);
52
52
  const effect = this._drawWrapper.effect;
53
53
  effect.setFloat("chromatic_aberration", this.aberrationAmount);
54
54
  effect.setFloat("screen_width", this.screenWidth);
@@ -1 +1 @@
1
- {"version":3,"file":"thinChromaticAberrationPostProcess.js","s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AC,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"]}
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,CAAC,iBAAiB,GAAG,KAAK;QAC1C,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAE9B,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 source texture to which the effect is applied */\r\n public screenWidth: number;\r\n\r\n /** The height of the source texture to which the effect is applied */\r\n public screenHeight: number;\r\n\r\n public override bind(noDefaultBindings = false) {\r\n super.bind(noDefaultBindings);\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"]}
@@ -58,5 +58,5 @@ export declare class ThinCircleOfConfusionPostProcess extends EffectWrapper {
58
58
  * Focal length of the effect's camera in scene units/1000 (eg. millimeter). (default: 50)
59
59
  */
60
60
  focalLength: number;
61
- bind(): void;
61
+ bind(noDefaultBindings?: boolean): void;
62
62
  }
@@ -48,8 +48,8 @@ export class ThinCircleOfConfusionPostProcess extends EffectWrapper {
48
48
  */
49
49
  this.focalLength = 50;
50
50
  }
51
- bind() {
52
- super.bind();
51
+ bind(noDefaultBindings = false) {
52
+ super.bind(noDefaultBindings);
53
53
  const options = this.options;
54
54
  const effect = this._drawWrapper.effect;
55
55
  if (!options.depthNotNormalized) {
@@ -1 +1 @@
1
- {"version":3,"file":"thinCircleOfConfusionPostProcess.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/thinCircleOfConfusionPostProcess.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAY3C;;GAEG;AACH,MAAM,OAAO,gCAAiC,SAAQ,aAAa;IAqB5C,cAAc,CAAC,SAAkB,EAAE,IAAoB;QACtE,IAAI,SAAS,EAAE,CAAC;YACZ,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;YACzB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,2CAA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I,CAAC,KAAK,CAAC;QAC5C,MAAM,iBAAiB,GAAG,CAAC,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,uFAAuF;QAE1L,MAAM,CAAC,QAAQ,CAAC,eAAe,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QACrD,MAAM,CAAC,QAAQ,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,CAAC;IAC5D,CAAC;;AA3FD;;GAEG;AACoB,4CAAW,GAAG,mBAAmB,AAAtB,CAAuB;AAEzD;;GAEG;AACoB,yCAAQ,GAAG,CAAC,eAAe,EAAE,eAAe,EAAE,mBAAmB,CAAC,AAA1D,CAA2D;AAE1F;;GAEG;AACoB,yCAAQ,GAAG,CAAC,cAAc,CAAC,AAAnB,CAAoB;AAEnD;;GAEG;AACoB,0DAAyB,GAAG,kCAAkC,AAArC,CAAsC","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 type { Camera } from \"core/Cameras/camera\";\r\nimport { Engine } from \"../Engines/engine\";\r\n\r\n/**\r\n * Options used to create a ThinCircleOfConfusionPostProcess.\r\n */\r\nexport interface ThinCircleOfConfusionPostProcessOptions extends EffectWrapperCreationOptions {\r\n /**\r\n * If the (view) depth is normalized (0.0 to 1.0 from near to far) or not (0 to camera max distance)\r\n */\r\n depthNotNormalized?: boolean;\r\n}\r\n\r\n/**\r\n * Post process used to calculate the circle of confusion (used for depth of field, for example)\r\n */\r\nexport class ThinCircleOfConfusionPostProcess extends EffectWrapper {\r\n /**\r\n * The fragment shader url\r\n */\r\n public static readonly FragmentUrl = \"circleOfConfusion\";\r\n\r\n /**\r\n * The list of uniforms used by the effect\r\n */\r\n public static readonly Uniforms = [\"cameraMinMaxZ\", \"focusDistance\", \"cocPrecalculation\"];\r\n\r\n /**\r\n * The list of samplers used by the effect\r\n */\r\n public static readonly Samplers = [\"depthSampler\"];\r\n\r\n /**\r\n * Defines if the depth is normalized or not\r\n */\r\n public static readonly DefinesDepthNotNormalized = \"#define COC_DEPTH_NOT_NORMALIZED\";\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/circleOfConfusion.fragment\"));\r\n } else {\r\n list.push(import(\"../Shaders/circleOfConfusion.fragment\"));\r\n }\r\n }\r\n\r\n /**\r\n * Constructs a new circle of confusion 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?: ThinCircleOfConfusionPostProcessOptions) {\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: ThinCircleOfConfusionPostProcess.FragmentUrl,\r\n uniforms: ThinCircleOfConfusionPostProcess.Uniforms,\r\n samplers: ThinCircleOfConfusionPostProcess.Samplers,\r\n defines: options?.depthNotNormalized ? ThinCircleOfConfusionPostProcess.DefinesDepthNotNormalized : undefined,\r\n });\r\n }\r\n\r\n /**\r\n * The camera to use to calculate the circle of confusion\r\n */\r\n public camera: Camera;\r\n\r\n /**\r\n * Max lens size in scene units/1000 (eg. millimeter). Standard cameras are 50mm. (default: 50) The diameter of the resulting aperture can be computed by lensSize/fStop.\r\n */\r\n public lensSize = 50;\r\n\r\n /**\r\n * F-Stop of the effect's camera. The diameter of the resulting aperture can be computed by lensSize/fStop. (default: 1.4)\r\n */\r\n public fStop = 1.4;\r\n\r\n /**\r\n * Distance away from the camera to focus on in scene units/1000 (eg. millimeter). (default: 2000)\r\n */\r\n public focusDistance = 2000;\r\n\r\n /**\r\n * Focal length of the effect's camera in scene units/1000 (eg. millimeter). (default: 50)\r\n */\r\n public focalLength = 50;\r\n\r\n public override bind() {\r\n super.bind();\r\n\r\n const options = this.options as ThinCircleOfConfusionPostProcessOptions;\r\n\r\n const effect = this._drawWrapper.effect!;\r\n\r\n if (!options.depthNotNormalized) {\r\n effect.setFloat2(\"cameraMinMaxZ\", this.camera.minZ, this.camera.maxZ - this.camera.minZ);\r\n }\r\n\r\n // Circle of confusion calculation, See https://developer.nvidia.com/gpugems/GPUGems/gpugems_ch23.html\r\n const aperture = this.lensSize / this.fStop;\r\n const cocPrecalculation = (aperture * this.focalLength) / (this.focusDistance - this.focalLength); // * ((this.focusDistance - pixelDistance)/pixelDistance) [This part is done in shader]\r\n\r\n effect.setFloat(\"focusDistance\", this.focusDistance);\r\n effect.setFloat(\"cocPrecalculation\", cocPrecalculation);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"thinCircleOfConfusionPostProcess.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/thinCircleOfConfusionPostProcess.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAY3C;;GAEG;AACH,MAAM,OAAO,gCAAiC,SAAQ,aAAa;IAqB5C,cAAc,CAAC,SAAkB,EAAE,IAAoB;QACtE,IAAI,SAAS,EAAE,CAAC;YACZ,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;YACzB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,2CAA2C,CAAC,CAAC,CAAC;QACnE,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,uCAAuC,CAAC,CAAC,CAAC;QAC/D,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,YAAY,IAAY,EAAE,SAAmC,IAAI,EAAE,OAAiD;QAChH,KAAK,CAAC;YACF,GAAG,OAAO;YACV,IAAI;YACJ,MAAM,EAAE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CAAC,aAAa,CAAC,CAAC;QACrD,MAAM,CAAC,QAAQ,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,CAAC;IAC5D,CAAC;;AA3FD;;GAEG;AACoB,4CAAW,GAAG,mBAAmB,AAAtB,CAAuB;AAEzD;;GAEG;AACoB,yCAAQ,GAAG,CAAC,eAAe,EAAE,eAAe,EAAE,mBAAmB,CAAC,AAA1D,CAA2D;AAE1F;;GAEG;AACoB,yCAAQ,GAAG,CAAC,cAAc,CAAC,AAAnB,CAAoB;AAEnD;;GAEG;AACoB,0DAAyB,GAAG,kCAAkC,AAArC,CAAsC","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 type { Camera } from \"core/Cameras/camera\";\r\nimport { Engine } from \"../Engines/engine\";\r\n\r\n/**\r\n * Options used to create a ThinCircleOfConfusionPostProcess.\r\n */\r\nexport interface ThinCircleOfConfusionPostProcessOptions extends EffectWrapperCreationOptions {\r\n /**\r\n * If the (view) depth is normalized (0.0 to 1.0 from near to far) or not (0 to camera max distance)\r\n */\r\n depthNotNormalized?: boolean;\r\n}\r\n\r\n/**\r\n * Post process used to calculate the circle of confusion (used for depth of field, for example)\r\n */\r\nexport class ThinCircleOfConfusionPostProcess extends EffectWrapper {\r\n /**\r\n * The fragment shader url\r\n */\r\n public static readonly FragmentUrl = \"circleOfConfusion\";\r\n\r\n /**\r\n * The list of uniforms used by the effect\r\n */\r\n public static readonly Uniforms = [\"cameraMinMaxZ\", \"focusDistance\", \"cocPrecalculation\"];\r\n\r\n /**\r\n * The list of samplers used by the effect\r\n */\r\n public static readonly Samplers = [\"depthSampler\"];\r\n\r\n /**\r\n * Defines if the depth is normalized or not\r\n */\r\n public static readonly DefinesDepthNotNormalized = \"#define COC_DEPTH_NOT_NORMALIZED\";\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/circleOfConfusion.fragment\"));\r\n } else {\r\n list.push(import(\"../Shaders/circleOfConfusion.fragment\"));\r\n }\r\n }\r\n\r\n /**\r\n * Constructs a new circle of confusion 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?: ThinCircleOfConfusionPostProcessOptions) {\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: ThinCircleOfConfusionPostProcess.FragmentUrl,\r\n uniforms: ThinCircleOfConfusionPostProcess.Uniforms,\r\n samplers: ThinCircleOfConfusionPostProcess.Samplers,\r\n defines: options?.depthNotNormalized ? ThinCircleOfConfusionPostProcess.DefinesDepthNotNormalized : undefined,\r\n });\r\n }\r\n\r\n /**\r\n * The camera to use to calculate the circle of confusion\r\n */\r\n public camera: Camera;\r\n\r\n /**\r\n * Max lens size in scene units/1000 (eg. millimeter). Standard cameras are 50mm. (default: 50) The diameter of the resulting aperture can be computed by lensSize/fStop.\r\n */\r\n public lensSize = 50;\r\n\r\n /**\r\n * F-Stop of the effect's camera. The diameter of the resulting aperture can be computed by lensSize/fStop. (default: 1.4)\r\n */\r\n public fStop = 1.4;\r\n\r\n /**\r\n * Distance away from the camera to focus on in scene units/1000 (eg. millimeter). (default: 2000)\r\n */\r\n public focusDistance = 2000;\r\n\r\n /**\r\n * Focal length of the effect's camera in scene units/1000 (eg. millimeter). (default: 50)\r\n */\r\n public focalLength = 50;\r\n\r\n public override bind(noDefaultBindings = false) {\r\n super.bind(noDefaultBindings);\r\n\r\n const options = this.options as ThinCircleOfConfusionPostProcessOptions;\r\n\r\n const effect = this._drawWrapper.effect!;\r\n\r\n if (!options.depthNotNormalized) {\r\n effect.setFloat2(\"cameraMinMaxZ\", this.camera.minZ, this.camera.maxZ - this.camera.minZ);\r\n }\r\n\r\n // Circle of confusion calculation, See https://developer.nvidia.com/gpugems/GPUGems/gpugems_ch23.html\r\n const aperture = this.lensSize / this.fStop;\r\n const cocPrecalculation = (aperture * this.focalLength) / (this.focusDistance - this.focalLength); // * ((this.focusDistance - pixelDistance)/pixelDistance) [This part is done in shader]\r\n\r\n effect.setFloat(\"focusDistance\", this.focusDistance);\r\n effect.setFloat(\"cocPrecalculation\", cocPrecalculation);\r\n }\r\n}\r\n"]}
@@ -26,5 +26,5 @@ export declare class ThinExtractHighlightsPostProcess extends EffectWrapper {
26
26
  threshold: number;
27
27
  /** @internal */
28
28
  _exposure: number;
29
- bind(): void;
29
+ bind(noDefaultBindings?: boolean): void;
30
30
  }
@@ -37,8 +37,8 @@ export class ThinExtractHighlightsPostProcess extends EffectWrapper {
37
37
  /** @internal */
38
38
  this._exposure = 1;
39
39
  }
40
- bind() {
41
- super.bind();
40
+ bind(noDefaultBindings = false) {
41
+ super.bind(noDefaultBindings);
42
42
  const effect = this._drawWrapper.effect;
43
43
  effect.setFloat("threshold", Math.pow(this.threshold, ToGammaSpace));
44
44
  effect.setFloat("exposure", this._exposure);
@@ -1 +1 @@
1
- {"version":3,"file":"thinExtractHighlightsPostProcess.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/thinExtractHighlightsPostProcess.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C;;GAEG;AACH,MAAM,OAAO,gCAAiC,SAAQ,aAAa;IAW5C,cAAc,CAAC,SAAkB,EAAE,IAAoB;QACtE,IAAI,SAAS,EAAE,CAAC;YACZ,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;YACzB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,2CAA2C,CAAC,CAAC,CAAC;QACnE,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,uCAAuC,CAAC,CAAC,CAAC;QAC/D,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,gCAAgC,CAAC,WAAW;YAC5D,QAAQ,EAAE,gCAAgC,CAAC,QAAQ;SACtD,CAAC,CAAC;QAGP;;WAEG;QACI,cAAS,GAAG,GAAG,CAAC;QAEvB,gBAAgB;QACT,cAAS,GAAG,CAAC,CAAC;IARrB,CAAC;IAUe,IAAI;QAChB,KAAK,CAAC,IAAI,EAAE,CAAC;QAEb,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,MAAO,CAAC;QAEzC,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC;QACrE,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IAChD,CAAC;;AApDD;;GAEG;AACoB,4CAAW,GAAG,mBAAmB,AAAtB,CAAuB;AAEzD;;GAEG;AACoB,yCAAQ,GAAG,CAAC,WAAW,EAAE,UAAU,CAAC,AAA5B,CAA6B","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 { ToGammaSpace } from \"../Maths/math.constants\";\r\nimport { Engine } from \"../Engines/engine\";\r\n\r\n/**\r\n * Post process used to extract highlights.\r\n */\r\nexport class ThinExtractHighlightsPostProcess extends EffectWrapper {\r\n /**\r\n * The fragment shader url\r\n */\r\n public static readonly FragmentUrl = \"extractHighlights\";\r\n\r\n /**\r\n * The list of uniforms used by the effect\r\n */\r\n public static readonly Uniforms = [\"threshold\", \"exposure\"];\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/extractHighlights.fragment\"));\r\n } else {\r\n list.push(import(\"../Shaders/extractHighlights.fragment\"));\r\n }\r\n }\r\n\r\n /**\r\n * Constructs a new extract highlights 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: ThinExtractHighlightsPostProcess.FragmentUrl,\r\n uniforms: ThinExtractHighlightsPostProcess.Uniforms,\r\n });\r\n }\r\n\r\n /**\r\n * The luminance threshold, pixels below this value will be set to black.\r\n */\r\n public threshold = 0.9;\r\n\r\n /** @internal */\r\n public _exposure = 1;\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(\"threshold\", Math.pow(this.threshold, ToGammaSpace));\r\n effect.setFloat(\"exposure\", this._exposure);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"thinExtractHighlightsPostProcess.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/thinExtractHighlightsPostProcess.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB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AAU,CAAC,AAA5B,CAA6B","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 { ToGammaSpace } from \"../Maths/math.constants\";\r\nimport { Engine } from \"../Engines/engine\";\r\n\r\n/**\r\n * Post process used to extract highlights.\r\n */\r\nexport class ThinExtractHighlightsPostProcess extends EffectWrapper {\r\n /**\r\n * The fragment shader url\r\n */\r\n public static readonly FragmentUrl = \"extractHighlights\";\r\n\r\n /**\r\n * The list of uniforms used by the effect\r\n */\r\n public static readonly Uniforms = [\"threshold\", \"exposure\"];\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/extractHighlights.fragment\"));\r\n } else {\r\n list.push(import(\"../Shaders/extractHighlights.fragment\"));\r\n }\r\n }\r\n\r\n /**\r\n * Constructs a new extract highlights 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: ThinExtractHighlightsPostProcess.FragmentUrl,\r\n uniforms: ThinExtractHighlightsPostProcess.Uniforms,\r\n });\r\n }\r\n\r\n /**\r\n * The luminance threshold, pixels below this value will be set to black.\r\n */\r\n public threshold = 0.9;\r\n\r\n /** @internal */\r\n public _exposure = 1;\r\n\r\n public override bind(noDefaultBindings = false) {\r\n super.bind(noDefaultBindings);\r\n\r\n const effect = this._drawWrapper.effect!;\r\n\r\n effect.setFloat(\"threshold\", Math.pow(this.threshold, ToGammaSpace));\r\n effect.setFloat(\"exposure\", this._exposure);\r\n }\r\n}\r\n"]}
@@ -0,0 +1,258 @@
1
+ import type { Nullable, AbstractEngine, EffectWrapperCreationOptions, NonNullableFields, Scene, ColorCurves, BaseTexture, Color4 } from "../index.js";
2
+ import { EffectWrapper } from "../Materials/effectRenderer";
3
+ import { ImageProcessingConfiguration } from "../Materials/imageProcessingConfiguration";
4
+ /**
5
+ * Options used to create a ThinImageProcessingPostProcessOptions.
6
+ */
7
+ export interface ThinImageProcessingPostProcessOptions extends EffectWrapperCreationOptions {
8
+ /**
9
+ * An existing image processing configuration to use. If not provided, the scene one will be used.
10
+ */
11
+ imageProcessingConfiguration?: ImageProcessingConfiguration;
12
+ /**
13
+ * The scene to retrieve the image processing configuration from if not provided in the options.
14
+ * If not provided, the last created scene will be used.
15
+ */
16
+ scene?: Nullable<Scene>;
17
+ }
18
+ /**
19
+ * Post process used to apply image processing to a scene
20
+ */
21
+ export declare class ThinImageProcessingPostProcess extends EffectWrapper {
22
+ /**
23
+ * The fragment shader url
24
+ */
25
+ static readonly FragmentUrl = "imageProcessing";
26
+ protected _gatherImports(useWebGPU: boolean, list: Promise<any>[]): void;
27
+ /**
28
+ * Default configuration related to image processing available in the PBR Material.
29
+ */
30
+ protected _imageProcessingConfiguration: ImageProcessingConfiguration;
31
+ /**
32
+ * Gets the image processing configuration used either in this material.
33
+ */
34
+ get imageProcessingConfiguration(): ImageProcessingConfiguration;
35
+ /**
36
+ * Sets the Default image processing configuration used either in the this material.
37
+ *
38
+ * If sets to null, the scene one is in use.
39
+ */
40
+ set imageProcessingConfiguration(value: ImageProcessingConfiguration);
41
+ /**
42
+ * Keep track of the image processing observer to allow dispose and replace.
43
+ */
44
+ private _imageProcessingObserver;
45
+ /**
46
+ * Attaches a new image processing configuration to the PBR Material.
47
+ * @param configuration
48
+ * @param doNotBuild
49
+ */
50
+ protected _attachImageProcessingConfiguration(configuration: Nullable<ImageProcessingConfiguration>, doNotBuild?: boolean): void;
51
+ /**
52
+ * Gets Color curves setup used in the effect if colorCurvesEnabled is set to true .
53
+ */
54
+ get colorCurves(): Nullable<ColorCurves>;
55
+ /**
56
+ * Sets Color curves setup used in the effect if colorCurvesEnabled is set to true .
57
+ */
58
+ set colorCurves(value: Nullable<ColorCurves>);
59
+ /**
60
+ * Gets whether the color curves effect is enabled.
61
+ */
62
+ get colorCurvesEnabled(): boolean;
63
+ /**
64
+ * Sets whether the color curves effect is enabled.
65
+ */
66
+ set colorCurvesEnabled(value: boolean);
67
+ /**
68
+ * Gets Color grading LUT texture used in the effect if colorGradingEnabled is set to true.
69
+ */
70
+ get colorGradingTexture(): Nullable<BaseTexture>;
71
+ /**
72
+ * Sets Color grading LUT texture used in the effect if colorGradingEnabled is set to true.
73
+ */
74
+ set colorGradingTexture(value: Nullable<BaseTexture>);
75
+ /**
76
+ * Gets whether the color grading effect is enabled.
77
+ */
78
+ get colorGradingEnabled(): boolean;
79
+ /**
80
+ * Gets whether the color grading effect is enabled.
81
+ */
82
+ set colorGradingEnabled(value: boolean);
83
+ /**
84
+ * Gets exposure used in the effect.
85
+ */
86
+ get exposure(): number;
87
+ /**
88
+ * Sets exposure used in the effect.
89
+ */
90
+ set exposure(value: number);
91
+ /**
92
+ * Gets whether tonemapping is enabled or not.
93
+ */
94
+ get toneMappingEnabled(): boolean;
95
+ /**
96
+ * Sets whether tonemapping is enabled or not
97
+ */
98
+ set toneMappingEnabled(value: boolean);
99
+ /**
100
+ * Gets the type of tone mapping effect.
101
+ */
102
+ get toneMappingType(): number;
103
+ /**
104
+ * Sets the type of tone mapping effect.
105
+ */
106
+ set toneMappingType(value: number);
107
+ /**
108
+ * Gets contrast used in the effect.
109
+ */
110
+ get contrast(): number;
111
+ /**
112
+ * Sets contrast used in the effect.
113
+ */
114
+ set contrast(value: number);
115
+ /**
116
+ * Gets Vignette stretch size.
117
+ */
118
+ get vignetteStretch(): number;
119
+ /**
120
+ * Sets Vignette stretch size.
121
+ */
122
+ set vignetteStretch(value: number);
123
+ /**
124
+ * Gets Vignette center X Offset.
125
+ * @deprecated use vignetteCenterX instead
126
+ */
127
+ get vignetteCentreX(): number;
128
+ /**
129
+ * Sets Vignette center X Offset.
130
+ * @deprecated use vignetteCenterX instead
131
+ */
132
+ set vignetteCentreX(value: number);
133
+ /**
134
+ * Gets Vignette center Y Offset.
135
+ * @deprecated use vignetteCenterY instead
136
+ */
137
+ get vignetteCentreY(): number;
138
+ /**
139
+ * Sets Vignette center Y Offset.
140
+ * @deprecated use vignetteCenterY instead
141
+ */
142
+ set vignetteCentreY(value: number);
143
+ /**
144
+ * Vignette center Y Offset.
145
+ */
146
+ get vignetteCenterY(): number;
147
+ set vignetteCenterY(value: number);
148
+ /**
149
+ * Vignette center X Offset.
150
+ */
151
+ get vignetteCenterX(): number;
152
+ set vignetteCenterX(value: number);
153
+ /**
154
+ * Gets Vignette weight or intensity of the vignette effect.
155
+ */
156
+ get vignetteWeight(): number;
157
+ /**
158
+ * Sets Vignette weight or intensity of the vignette effect.
159
+ */
160
+ set vignetteWeight(value: number);
161
+ /**
162
+ * Gets Color of the vignette applied on the screen through the chosen blend mode (vignetteBlendMode)
163
+ * if vignetteEnabled is set to true.
164
+ */
165
+ get vignetteColor(): Color4;
166
+ /**
167
+ * Sets Color of the vignette applied on the screen through the chosen blend mode (vignetteBlendMode)
168
+ * if vignetteEnabled is set to true.
169
+ */
170
+ set vignetteColor(value: Color4);
171
+ /**
172
+ * Gets Camera field of view used by the Vignette effect.
173
+ */
174
+ get vignetteCameraFov(): number;
175
+ /**
176
+ * Sets Camera field of view used by the Vignette effect.
177
+ */
178
+ set vignetteCameraFov(value: number);
179
+ /**
180
+ * Gets the vignette blend mode allowing different kind of effect.
181
+ */
182
+ get vignetteBlendMode(): number;
183
+ /**
184
+ * Sets the vignette blend mode allowing different kind of effect.
185
+ */
186
+ set vignetteBlendMode(value: number);
187
+ /**
188
+ * Gets whether the vignette effect is enabled.
189
+ */
190
+ get vignetteEnabled(): boolean;
191
+ /**
192
+ * Sets whether the vignette effect is enabled.
193
+ */
194
+ set vignetteEnabled(value: boolean);
195
+ /**
196
+ * Gets intensity of the dithering effect.
197
+ */
198
+ get ditheringIntensity(): number;
199
+ /**
200
+ * Sets intensity of the dithering effect.
201
+ */
202
+ set ditheringIntensity(value: number);
203
+ /**
204
+ * Gets whether the dithering effect is enabled.
205
+ */
206
+ get ditheringEnabled(): boolean;
207
+ /**
208
+ * Sets whether the dithering effect is enabled.
209
+ */
210
+ set ditheringEnabled(value: boolean);
211
+ private _fromLinearSpace;
212
+ /**
213
+ * Gets whether the input of the processing is in Gamma or Linear Space.
214
+ */
215
+ get fromLinearSpace(): boolean;
216
+ /**
217
+ * Sets whether the input of the processing is in Gamma or Linear Space.
218
+ */
219
+ set fromLinearSpace(value: boolean);
220
+ /**
221
+ * * Gets the width of the output texture used to store the result of the post process.
222
+ */
223
+ get outputTextureWidth(): number;
224
+ /**
225
+ * * Sets the width of the output texture used to store the result of the post process.
226
+ */
227
+ set outputTextureWidth(value: number);
228
+ /**
229
+ * * Gets the height of the output texture used to store the result of the post process.
230
+ */
231
+ get outputTextureHeight(): number;
232
+ /**
233
+ * * Sets the height of the output texture used to store the result of the post process.
234
+ */
235
+ set outputTextureHeight(value: number);
236
+ /**
237
+ * Gets/sets the aspect ratio used to override the default one.
238
+ */
239
+ overrideAspectRatio?: number;
240
+ /**
241
+ * Defines cache preventing GC.
242
+ */
243
+ private _defines;
244
+ readonly options: Required<NonNullableFields<ThinImageProcessingPostProcessOptions>>;
245
+ /**
246
+ * Constructs a new image processing post process
247
+ * @param name Name of the effect
248
+ * @param engine Engine to use to render the effect. If not provided, the last created engine will be used
249
+ * @param options Options to configure the effect
250
+ */
251
+ constructor(name: string, engine?: Nullable<AbstractEngine>, options?: ThinImageProcessingPostProcessOptions);
252
+ /**
253
+ * @internal
254
+ */
255
+ _updateParameters(): void;
256
+ bind(noDefaultBindings?: boolean): void;
257
+ dispose(): void;
258
+ }