@onerjs/core 8.55.9 → 8.56.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AudioV2/webAudio/webAudioEngine.d.ts +7 -0
- package/AudioV2/webAudio/webAudioEngine.js +6 -5
- package/AudioV2/webAudio/webAudioEngine.js.map +1 -1
- package/Culling/Helper/boundingInfoHelper.js +8 -4
- package/Culling/Helper/boundingInfoHelper.js.map +1 -1
- package/Engines/AbstractEngine/abstractEngine.textureLoaders.d.ts +5 -1
- package/Engines/AbstractEngine/abstractEngine.textureLoaders.js +7 -3
- package/Engines/AbstractEngine/abstractEngine.textureLoaders.js.map +1 -1
- package/Engines/AbstractEngine/abstractEngine.textureLoaders.pure.d.ts +6 -0
- package/Engines/AbstractEngine/abstractEngine.textureLoaders.pure.js +16 -0
- package/Engines/AbstractEngine/abstractEngine.textureLoaders.pure.js.map +1 -0
- package/Engines/AbstractEngine/pure.d.ts +1 -0
- package/Engines/AbstractEngine/pure.js +1 -0
- package/Engines/AbstractEngine/pure.js.map +1 -1
- package/Engines/IDrawContext.d.ts +2 -0
- package/Engines/IDrawContext.js.map +1 -1
- package/Engines/WebGPU/webgpuDrawContext.d.ts +8 -0
- package/Engines/WebGPU/webgpuDrawContext.js +15 -0
- package/Engines/WebGPU/webgpuDrawContext.js.map +1 -1
- package/Engines/abstractEngine.pure.js +2 -2
- package/Engines/abstractEngine.pure.js.map +1 -1
- package/Engines/engine.d.ts +11 -3
- package/Engines/webgpuEngine.d.ts +1 -0
- package/Engines/webgpuEngine.js +1 -0
- package/Engines/webgpuEngine.js.map +1 -1
- package/Engines/webgpuEngine.pure.d.ts +10 -0
- package/Engines/webgpuEngine.pure.js +15 -1
- package/Engines/webgpuEngine.pure.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/iblShadowsRendererTask.pure.js +2 -5
- package/FrameGraph/Tasks/Rendering/iblShadowsRendererTask.pure.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/imageProcessingBlock.pure.js +2 -0
- package/Materials/Node/Blocks/Fragment/imageProcessingBlock.pure.js.map +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.pure.js +1 -0
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.pure.js.map +1 -1
- package/Materials/Node/Blocks/powBlock.pure.js +2 -1
- package/Materials/Node/Blocks/powBlock.pure.js.map +1 -1
- package/Materials/Node/Blocks/triPlanarBlock.pure.js +14 -12
- package/Materials/Node/Blocks/triPlanarBlock.pure.js.map +1 -1
- package/Materials/Node/nodeMaterial.pure.d.ts +1 -0
- package/Materials/Node/nodeMaterialBuildState.d.ts +3 -3
- package/Materials/PBR/openpbrMaterial.pure.d.ts +1 -0
- package/Materials/PBR/pbrBaseMaterial.pure.d.ts +1 -0
- package/Materials/Textures/index.d.ts +1 -0
- package/Materials/Textures/index.js +1 -0
- package/Materials/Textures/index.js.map +1 -1
- package/Materials/drawWrapper.js +3 -0
- package/Materials/drawWrapper.js.map +1 -1
- package/Materials/imageProcessingConfiguration.defines.d.ts +3 -0
- package/Materials/imageProcessingConfiguration.defines.js +2 -0
- package/Materials/imageProcessingConfiguration.defines.js.map +1 -1
- package/Materials/imageProcessingConfiguration.functions.js +3 -0
- package/Materials/imageProcessingConfiguration.functions.js.map +1 -1
- package/Materials/imageProcessingConfiguration.pure.d.ts +58 -0
- package/Materials/imageProcessingConfiguration.pure.js +123 -2
- package/Materials/imageProcessingConfiguration.pure.js.map +1 -1
- package/Materials/standardMaterial.pure.d.ts +1 -0
- package/Materials/uniformBuffer.d.ts +29 -0
- package/Materials/uniformBuffer.js +146 -0
- package/Materials/uniformBuffer.js.map +1 -1
- package/Maths/colorTemperature.functions.d.ts +29 -0
- package/Maths/colorTemperature.functions.js +196 -0
- package/Maths/colorTemperature.functions.js.map +1 -0
- package/Maths/index.d.ts +1 -0
- package/Maths/index.js +1 -0
- package/Maths/index.js.map +1 -1
- package/Maths/pure.d.ts +1 -0
- package/Maths/pure.js +1 -0
- package/Maths/pure.js.map +1 -1
- package/Misc/observable.pure.js +1 -3
- package/Misc/observable.pure.js.map +1 -1
- package/Misc/tools.pure.js +1 -1
- package/Misc/tools.pure.js.map +1 -1
- package/PostProcesses/imageProcessingPostProcess.d.ts +41 -1
- package/PostProcesses/imageProcessingPostProcess.js +41 -1
- package/PostProcesses/imageProcessingPostProcess.js.map +1 -1
- package/PostProcesses/thinImageProcessingPostProcess.d.ts +50 -0
- package/PostProcesses/thinImageProcessingPostProcess.js +65 -0
- package/PostProcesses/thinImageProcessingPostProcess.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsMaterialCompatibility.pure.d.ts +12 -0
- package/Rendering/IBLShadows/iblShadowsMaterialCompatibility.pure.js +22 -0
- package/Rendering/IBLShadows/iblShadowsMaterialCompatibility.pure.js.map +1 -0
- package/Rendering/IBLShadows/iblShadowsPluginMaterial.pure.d.ts +1 -0
- package/Rendering/IBLShadows/iblShadowsPluginMaterial.pure.js +39 -0
- package/Rendering/IBLShadows/iblShadowsPluginMaterial.pure.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js +2 -4
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js.map +1 -1
- package/Rendering/IBLShadows/pure.d.ts +1 -0
- package/Rendering/IBLShadows/pure.js +1 -0
- package/Rendering/IBLShadows/pure.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObject.d.ts +11 -0
- package/Rendering/fluidRenderer/fluidRenderingObject.js +36 -14
- package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.d.ts +5 -0
- package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js +16 -3
- package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.d.ts +5 -0
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js +12 -0
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js.map +1 -1
- package/Rendering/iblCdfGenerator.js +10 -1
- package/Rendering/iblCdfGenerator.js.map +1 -1
- package/Shaders/ShadersInclude/hdrFilteringFunctions.js +1 -1
- package/Shaders/ShadersInclude/hdrFilteringFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/helperFunctions.js +2 -2
- package/Shaders/ShadersInclude/helperFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/imageProcessingDeclaration.js +3 -0
- package/Shaders/ShadersInclude/imageProcessingDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/imageProcessingFunctions.js +3 -0
- package/Shaders/ShadersInclude/imageProcessingFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrDirectLighting.js +34 -4
- package/Shaders/ShadersInclude/openpbrDirectLighting.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrIblFunctions.js +8 -2
- package/Shaders/ShadersInclude/openpbrIblFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/pbrDirectLightingFunctions.js +5 -0
- package/Shaders/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
- package/Shaders/fluidRenderingParticleDepth.vertex.js +7 -1
- package/Shaders/fluidRenderingParticleDepth.vertex.js.map +1 -1
- package/Shaders/fluidRenderingParticleDiffuse.vertex.js +7 -1
- package/Shaders/fluidRenderingParticleDiffuse.vertex.js.map +1 -1
- package/Shaders/fluidRenderingParticleThickness.vertex.js +7 -1
- package/Shaders/fluidRenderingParticleThickness.vertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/imageProcessingDeclaration.js +3 -0
- package/ShadersWGSL/ShadersInclude/imageProcessingDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/imageProcessingFunctions.js +3 -0
- package/ShadersWGSL/ShadersInclude/imageProcessingFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrDirectLighting.js +35 -5
- package/ShadersWGSL/ShadersInclude/openpbrDirectLighting.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrDirectLightingInit.js +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrDirectLightingInit.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrIblFunctions.js +8 -2
- package/ShadersWGSL/ShadersInclude/openpbrIblFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js +5 -0
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
- package/ShadersWGSL/fluidRenderingParticleDepth.vertex.js +16 -4
- package/ShadersWGSL/fluidRenderingParticleDepth.vertex.js.map +1 -1
- package/ShadersWGSL/fluidRenderingParticleDiffuse.vertex.js +15 -3
- package/ShadersWGSL/fluidRenderingParticleDiffuse.vertex.js.map +1 -1
- package/ShadersWGSL/fluidRenderingParticleThickness.vertex.js +15 -3
- package/ShadersWGSL/fluidRenderingParticleThickness.vertex.js.map +1 -1
- package/XR/features/Layers/WebXRCompositionLayer.d.ts +52 -0
- package/XR/features/Layers/WebXRCompositionLayer.js +80 -0
- package/XR/features/Layers/WebXRCompositionLayer.js.map +1 -1
- package/XR/features/WebXRControllerPointerSelection.pure.js +2 -1
- package/XR/features/WebXRControllerPointerSelection.pure.js.map +1 -1
- package/XR/features/WebXRControllerTeleportation.pure.js +2 -1
- package/XR/features/WebXRControllerTeleportation.pure.js.map +1 -1
- package/XR/features/WebXRDepthSensing.pure.d.ts +21 -0
- package/XR/features/WebXRDepthSensing.pure.js +42 -0
- package/XR/features/WebXRDepthSensing.pure.js.map +1 -1
- package/XR/features/WebXRHandTracking.pure.js +2 -0
- package/XR/features/WebXRHandTracking.pure.js.map +1 -1
- package/XR/features/WebXRLayers.pure.d.ts +12 -0
- package/XR/features/WebXRLayers.pure.js +31 -1
- package/XR/features/WebXRLayers.pure.js.map +1 -1
- package/XR/features/WebXRTrackedSources.d.ts +5 -0
- package/XR/features/WebXRTrackedSources.js +8 -0
- package/XR/features/WebXRTrackedSources.js.map +1 -0
- package/XR/features/WebXRTrackedSources.pure.d.ts +70 -0
- package/XR/features/WebXRTrackedSources.pure.js +153 -0
- package/XR/features/WebXRTrackedSources.pure.js.map +1 -0
- package/XR/features/index.d.ts +1 -0
- package/XR/features/index.js +1 -0
- package/XR/features/index.js.map +1 -1
- package/XR/features/pure.d.ts +1 -0
- package/XR/features/pure.js +1 -0
- package/XR/features/pure.js.map +1 -1
- package/XR/motionController/webXRAbstractMotionController.d.ts +53 -1
- package/XR/motionController/webXRAbstractMotionController.js +61 -0
- package/XR/motionController/webXRAbstractMotionController.js.map +1 -1
- package/XR/webXRDefaultExperience.js +8 -4
- package/XR/webXRDefaultExperience.js.map +1 -1
- package/XR/webXRExperienceHelper.js +86 -44
- package/XR/webXRExperienceHelper.js.map +1 -1
- package/XR/webXRFeaturesManager.d.ts +9 -0
- package/XR/webXRFeaturesManager.js +4 -0
- package/XR/webXRFeaturesManager.js.map +1 -1
- package/XR/webXRGraphicsBinding.d.ts +29 -0
- package/XR/webXRGraphicsBinding.js +40 -0
- package/XR/webXRGraphicsBinding.js.map +1 -1
- package/XR/webXRInputSource.js +1 -1
- package/XR/webXRInputSource.js.map +1 -1
- package/XR/webXRLayerWrapper.d.ts +7 -5
- package/XR/webXRLayerWrapper.js +10 -7
- package/XR/webXRLayerWrapper.js.map +1 -1
- package/XR/webXRSessionManager.d.ts +45 -0
- package/XR/webXRSessionManager.js +174 -29
- package/XR/webXRSessionManager.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { __esDecorate, __runInitializers } from "../tslib.es6.js";
|
|
|
2
2
|
import { serialize } from "../Misc/decorators.js";
|
|
3
3
|
import { PostProcess } from "./postProcess.pure.js";
|
|
4
4
|
|
|
5
|
-
import { ThinImageProcessingPostProcess } from "./thinImageProcessingPostProcess.js";
|
|
5
|
+
import { _ApplyWhiteBalanceOptions, ThinImageProcessingPostProcess } from "./thinImageProcessingPostProcess.js";
|
|
6
6
|
/**
|
|
7
7
|
* ImageProcessingPostProcess
|
|
8
8
|
* @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses#imageprocessing
|
|
@@ -133,6 +133,42 @@ let ImageProcessingPostProcess = (() => {
|
|
|
133
133
|
set contrast(value) {
|
|
134
134
|
this.imageProcessingConfiguration.contrast = value;
|
|
135
135
|
}
|
|
136
|
+
/**
|
|
137
|
+
* Gets whether the white balance effect is enabled.
|
|
138
|
+
*/
|
|
139
|
+
get whiteBalanceEnabled() {
|
|
140
|
+
return this.imageProcessingConfiguration.whiteBalanceEnabled;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Sets whether the white balance effect is enabled.
|
|
144
|
+
*/
|
|
145
|
+
set whiteBalanceEnabled(value) {
|
|
146
|
+
this.imageProcessingConfiguration.whiteBalanceEnabled = value;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Gets the white balance correlated color temperature, in Kelvin, used in the effect.
|
|
150
|
+
*/
|
|
151
|
+
get temperature() {
|
|
152
|
+
return this.imageProcessingConfiguration.temperature;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Sets the white balance correlated color temperature, in Kelvin, used in the effect.
|
|
156
|
+
*/
|
|
157
|
+
set temperature(value) {
|
|
158
|
+
this.imageProcessingConfiguration.temperature = value;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Gets the white balance tint offset used in the effect.
|
|
162
|
+
*/
|
|
163
|
+
get tint() {
|
|
164
|
+
return this.imageProcessingConfiguration.tint;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Sets the white balance tint offset used in the effect.
|
|
168
|
+
*/
|
|
169
|
+
set tint(value) {
|
|
170
|
+
this.imageProcessingConfiguration.tint = value;
|
|
171
|
+
}
|
|
136
172
|
/**
|
|
137
173
|
* Gets Vignette stretch size.
|
|
138
174
|
*/
|
|
@@ -307,6 +343,10 @@ let ImageProcessingPostProcess = (() => {
|
|
|
307
343
|
...localOptions,
|
|
308
344
|
});
|
|
309
345
|
__runInitializers(this, _instanceExtraInitializers);
|
|
346
|
+
// Applied here (not just inside ThinImageProcessingPostProcess's own constructor) so that `temperature`/
|
|
347
|
+
// `tint` are honored even when a caller supplies their own pre-built `effectWrapper`, in which case the
|
|
348
|
+
// thin wrapper above is never constructed and its own application of these options never runs.
|
|
349
|
+
_ApplyWhiteBalanceOptions(this.imageProcessingConfiguration, options);
|
|
310
350
|
this.onApply = () => {
|
|
311
351
|
this._effectWrapper.overrideAspectRatio = this.aspectRatio;
|
|
312
352
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imageProcessingPostProcess.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/imageProcessingPostProcess.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAM/C,OAAO,EAA2B,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAE1E,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAElF;;;GAGG;IACU,0BAA0B;;sBAAS,WAAW;;;sBAA9C,0BAA2B,SAAQ,WAAW;YACvD,IAAc,6BAA6B;gBACvC,OAAO,IAAI,CAAC,cAAc,CAAC,4BAA4B,CAAC;YAC5D,CAAC;YAED;;eAEG;YACH,IAAW,4BAA4B;gBACnC,OAAO,IAAI,CAAC,cAAc,CAAC,4BAA4B,CAAC;YAC5D,CAAC;YAED;;;;eAIG;YACH,IAAW,4BAA4B,CAAC,KAAmC;gBACvE,IAAI,CAAC,cAAc,CAAC,4BAA4B,GAAG,KAAK,CAAC;YAC7D,CAAC;YAED;;eAEG;YACH,IAAoB,WAAW;gBAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;gBAChC,OAAO,CAAC,MAAM,IAAI,MAAM,CAAC,WAAW,CAAC;YACzC,CAAC;YAED;;eAEG;YACH,IAA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C,CAAC,CAAC,IAAI,8BAA8B,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,SAAS;oBACjJ,GAAG,YAAY;iBAClB,CAAC,CAAC;gBA3UE,mDAA0B;gBA6U/B,IAAI,CAAC,OAAO,GAAG,GAAG,EAAE;oBAChB,IAAI,CAAC,cAAc,CAAC,mBAAmB,GAAG,IAAI,CAAC,WAAW,CAAC;gBAC/D,CAAC,CAAC;aACL;YAED;;;eAGG;YACa,YAAY;gBACxB,OAAO,4BAA4B,CAAC;YACxC,CAAC;YAED;;eAEG;YACI,iBAAiB;gBACpB,IAAI,CAAC,cAAc,CAAC,iBAAiB,EAAE,CAAC;YAC5C,CAAC;YACe,OAAO,CAAC,MAAe;gBACnC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;gBAEtB,IAAI,IAAI,CAAC,6BAA6B,EAAE,CAAC;oBACrC,IAAI,CAAC,4BAA4B,CAAC,kBAAkB,GAAG,KAAK,CAAC;gBACjE,CAAC;YACL,CAAC;;;;+CAlEA,SAAS,EAAE;YACZ,kMAAW,eAAe,6DAEzB;;;;;SAvSQ,0BAA0B","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport { type Nullable } from \"../types\";\r\nimport { serialize } from \"../Misc/decorators\";\r\nimport { type Color4 } from \"../Maths/math.color\";\r\nimport { type Camera } from \"../Cameras/camera\";\r\nimport { type BaseTexture } from \"../Materials/Textures/baseTexture\";\r\nimport { type ColorCurves } from \"../Materials/colorCurves\";\r\nimport { type ImageProcessingConfiguration } from \"../Materials/imageProcessingConfiguration\";\r\nimport { type PostProcessOptions, PostProcess } from \"./postProcess.pure\";\r\nimport { type AbstractEngine } from \"../Engines/abstractEngine\";\r\nimport { Constants } from \"../Engines/constants\";\r\nimport { ThinImageProcessingPostProcess } from \"./thinImageProcessingPostProcess\";\r\n\r\n/**\r\n * ImageProcessingPostProcess\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses#imageprocessing\r\n */\r\nexport class ImageProcessingPostProcess extends PostProcess {\r\n protected get _imageProcessingConfiguration(): ImageProcessingConfiguration {\r\n return this._effectWrapper.imageProcessingConfiguration;\r\n }\r\n\r\n /**\r\n * Gets the image processing configuration used either in this material.\r\n */\r\n public get imageProcessingConfiguration(): ImageProcessingConfiguration {\r\n return this._effectWrapper.imageProcessingConfiguration;\r\n }\r\n\r\n /**\r\n * Sets the Default image processing configuration used either in the this material.\r\n *\r\n * If sets to null, the scene one is in use.\r\n */\r\n public set imageProcessingConfiguration(value: ImageProcessingConfiguration) {\r\n this._effectWrapper.imageProcessingConfiguration = value;\r\n }\r\n\r\n /**\r\n * If the post process is supported.\r\n */\r\n public override get isSupported(): boolean {\r\n const effect = this.getEffect();\r\n return !effect || effect.isSupported;\r\n }\r\n\r\n /**\r\n * Gets Color curves setup used in the effect if colorCurvesEnabled is set to true .\r\n */\r\n public get colorCurves(): Nullable<ColorCurves> {\r\n return this.imageProcessingConfiguration.colorCurves;\r\n }\r\n /**\r\n * Sets Color curves setup used in the effect if colorCurvesEnabled is set to true .\r\n */\r\n public set colorCurves(value: Nullable<ColorCurves>) {\r\n this.imageProcessingConfiguration.colorCurves = value;\r\n }\r\n\r\n /**\r\n * Gets whether the color curves effect is enabled.\r\n */\r\n public get colorCurvesEnabled(): boolean {\r\n return this.imageProcessingConfiguration.colorCurvesEnabled;\r\n }\r\n /**\r\n * Sets whether the color curves effect is enabled.\r\n */\r\n public set colorCurvesEnabled(value: boolean) {\r\n this.imageProcessingConfiguration.colorCurvesEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets Color grading LUT texture used in the effect if colorGradingEnabled is set to true.\r\n */\r\n public get colorGradingTexture(): Nullable<BaseTexture> {\r\n return this.imageProcessingConfiguration.colorGradingTexture;\r\n }\r\n /**\r\n * Sets Color grading LUT texture used in the effect if colorGradingEnabled is set to true.\r\n */\r\n public set colorGradingTexture(value: Nullable<BaseTexture>) {\r\n this.imageProcessingConfiguration.colorGradingTexture = value;\r\n }\r\n\r\n /**\r\n * Gets whether the color grading effect is enabled.\r\n */\r\n public get colorGradingEnabled(): boolean {\r\n return this.imageProcessingConfiguration.colorGradingEnabled;\r\n }\r\n /**\r\n * Gets whether the color grading effect is enabled.\r\n */\r\n public set colorGradingEnabled(value: boolean) {\r\n this.imageProcessingConfiguration.colorGradingEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets exposure used in the effect.\r\n */\r\n public get exposure(): number {\r\n return this.imageProcessingConfiguration.exposure;\r\n }\r\n /**\r\n * Sets exposure used in the effect.\r\n */\r\n public set exposure(value: number) {\r\n this.imageProcessingConfiguration.exposure = value;\r\n }\r\n\r\n /**\r\n * Gets whether tonemapping is enabled or not.\r\n */\r\n public get toneMappingEnabled(): boolean {\r\n return this._imageProcessingConfiguration.toneMappingEnabled;\r\n }\r\n /**\r\n * Sets whether tonemapping is enabled or not\r\n */\r\n public set toneMappingEnabled(value: boolean) {\r\n this._imageProcessingConfiguration.toneMappingEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets the type of tone mapping effect.\r\n */\r\n public get toneMappingType(): number {\r\n return this._imageProcessingConfiguration.toneMappingType;\r\n }\r\n /**\r\n * Sets the type of tone mapping effect.\r\n */\r\n public set toneMappingType(value: number) {\r\n this._imageProcessingConfiguration.toneMappingType = value;\r\n }\r\n\r\n /**\r\n * Gets contrast used in the effect.\r\n */\r\n public get contrast(): number {\r\n return this.imageProcessingConfiguration.contrast;\r\n }\r\n /**\r\n * Sets contrast used in the effect.\r\n */\r\n public set contrast(value: number) {\r\n this.imageProcessingConfiguration.contrast = value;\r\n }\r\n\r\n /**\r\n * Gets Vignette stretch size.\r\n */\r\n public get vignetteStretch(): number {\r\n return this.imageProcessingConfiguration.vignetteStretch;\r\n }\r\n /**\r\n * Sets Vignette stretch size.\r\n */\r\n public set vignetteStretch(value: number) {\r\n this.imageProcessingConfiguration.vignetteStretch = value;\r\n }\r\n\r\n /**\r\n * Gets Vignette center X Offset.\r\n * @deprecated use vignetteCenterX instead\r\n */\r\n public get vignetteCentreX(): number {\r\n return this.imageProcessingConfiguration.vignetteCenterX;\r\n }\r\n /**\r\n * Sets Vignette center X Offset.\r\n * @deprecated use vignetteCenterX instead\r\n */\r\n public set vignetteCentreX(value: number) {\r\n this.imageProcessingConfiguration.vignetteCenterX = value;\r\n }\r\n\r\n /**\r\n * Gets Vignette center Y Offset.\r\n * @deprecated use vignetteCenterY instead\r\n */\r\n public get vignetteCentreY(): number {\r\n return this.imageProcessingConfiguration.vignetteCenterY;\r\n }\r\n /**\r\n * Sets Vignette center Y Offset.\r\n * @deprecated use vignetteCenterY instead\r\n */\r\n public set vignetteCentreY(value: number) {\r\n this.imageProcessingConfiguration.vignetteCenterY = value;\r\n }\r\n\r\n /**\r\n * Vignette center Y Offset.\r\n */\r\n public get vignetteCenterY(): number {\r\n return this.imageProcessingConfiguration.vignetteCenterY;\r\n }\r\n public set vignetteCenterY(value: number) {\r\n this.imageProcessingConfiguration.vignetteCenterY = value;\r\n }\r\n\r\n /**\r\n * Vignette center X Offset.\r\n */\r\n public get vignetteCenterX(): number {\r\n return this.imageProcessingConfiguration.vignetteCenterX;\r\n }\r\n public set vignetteCenterX(value: number) {\r\n this.imageProcessingConfiguration.vignetteCenterX = value;\r\n }\r\n\r\n /**\r\n * Gets Vignette weight or intensity of the vignette effect.\r\n */\r\n public get vignetteWeight(): number {\r\n return this.imageProcessingConfiguration.vignetteWeight;\r\n }\r\n /**\r\n * Sets Vignette weight or intensity of the vignette effect.\r\n */\r\n public set vignetteWeight(value: number) {\r\n this.imageProcessingConfiguration.vignetteWeight = value;\r\n }\r\n\r\n /**\r\n * Gets Color of the vignette applied on the screen through the chosen blend mode (vignetteBlendMode)\r\n * if vignetteEnabled is set to true.\r\n */\r\n public get vignetteColor(): Color4 {\r\n return this.imageProcessingConfiguration.vignetteColor;\r\n }\r\n /**\r\n * Sets Color of the vignette applied on the screen through the chosen blend mode (vignetteBlendMode)\r\n * if vignetteEnabled is set to true.\r\n */\r\n public set vignetteColor(value: Color4) {\r\n this.imageProcessingConfiguration.vignetteColor = value;\r\n }\r\n\r\n /**\r\n * Gets Camera field of view used by the Vignette effect.\r\n */\r\n public get vignetteCameraFov(): number {\r\n return this.imageProcessingConfiguration.vignetteCameraFov;\r\n }\r\n /**\r\n * Sets Camera field of view used by the Vignette effect.\r\n */\r\n public set vignetteCameraFov(value: number) {\r\n this.imageProcessingConfiguration.vignetteCameraFov = value;\r\n }\r\n\r\n /**\r\n * Gets the vignette blend mode allowing different kind of effect.\r\n */\r\n public get vignetteBlendMode(): number {\r\n return this.imageProcessingConfiguration.vignetteBlendMode;\r\n }\r\n /**\r\n * Sets the vignette blend mode allowing different kind of effect.\r\n */\r\n public set vignetteBlendMode(value: number) {\r\n this.imageProcessingConfiguration.vignetteBlendMode = value;\r\n }\r\n\r\n /**\r\n * Gets whether the vignette effect is enabled.\r\n */\r\n public get vignetteEnabled(): boolean {\r\n return this.imageProcessingConfiguration.vignetteEnabled;\r\n }\r\n /**\r\n * Sets whether the vignette effect is enabled.\r\n */\r\n public set vignetteEnabled(value: boolean) {\r\n this.imageProcessingConfiguration.vignetteEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets intensity of the dithering effect.\r\n */\r\n public get ditheringIntensity(): number {\r\n return this.imageProcessingConfiguration.ditheringIntensity;\r\n }\r\n /**\r\n * Sets intensity of the dithering effect.\r\n */\r\n public set ditheringIntensity(value: number) {\r\n this.imageProcessingConfiguration.ditheringIntensity = value;\r\n }\r\n\r\n /**\r\n * Gets whether the dithering effect is enabled.\r\n */\r\n public get ditheringEnabled(): boolean {\r\n return this.imageProcessingConfiguration.ditheringEnabled;\r\n }\r\n /**\r\n * Sets whether the dithering effect is enabled.\r\n */\r\n public set ditheringEnabled(value: boolean) {\r\n this.imageProcessingConfiguration.ditheringEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets whether the input of the processing is in Gamma or Linear Space.\r\n */\r\n @serialize()\r\n public get fromLinearSpace(): boolean {\r\n return this._effectWrapper.fromLinearSpace;\r\n }\r\n /**\r\n * Sets whether the input of the processing is in Gamma or Linear Space.\r\n */\r\n public set fromLinearSpace(value: boolean) {\r\n this._effectWrapper.fromLinearSpace = value;\r\n }\r\n\r\n declare protected _effectWrapper: ThinImageProcessingPostProcess;\r\n\r\n constructor(\r\n name: string,\r\n options: number | PostProcessOptions,\r\n camera: Nullable<Camera> = null,\r\n samplingMode?: number,\r\n engine?: AbstractEngine,\r\n reusable?: boolean,\r\n textureType: number = Constants.TEXTURETYPE_UNSIGNED_BYTE,\r\n imageProcessingConfiguration?: ImageProcessingConfiguration\r\n ) {\r\n const localOptions = {\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 imageProcessingConfiguration,\r\n scene: camera?.getScene(),\r\n ...(options as PostProcessOptions),\r\n blockCompilation: true,\r\n };\r\n\r\n super(name, ThinImageProcessingPostProcess.FragmentUrl, {\r\n effectWrapper: typeof options === \"number\" || !options.effectWrapper ? new ThinImageProcessingPostProcess(name, engine, localOptions) : undefined,\r\n ...localOptions,\r\n });\r\n\r\n this.onApply = () => {\r\n this._effectWrapper.overrideAspectRatio = this.aspectRatio;\r\n };\r\n }\r\n\r\n /**\r\n * \"ImageProcessingPostProcess\"\r\n * @returns \"ImageProcessingPostProcess\"\r\n */\r\n public override getClassName(): string {\r\n return \"ImageProcessingPostProcess\";\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _updateParameters(): void {\r\n this._effectWrapper._updateParameters();\r\n }\r\n public override dispose(camera?: Camera): void {\r\n super.dispose(camera);\r\n\r\n if (this._imageProcessingConfiguration) {\r\n this.imageProcessingConfiguration.applyByPostProcess = false;\r\n }\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"imageProcessingPostProcess.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/imageProcessingPostProcess.ts"],"names":[],"mappings":";AAEA,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,IAAI;iBACzB,CAAC;gBAEF,KAAK,CAAC,IAAI,EAAE,8BAA8B,CAAC,WAAW,EAAE;oBACpD,aAAa,EAAE,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,8BAA8B,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,SAAS;oBACjJ,GAAG,YAAY;iBAClB,CAAC,CAAC;gBAlXE,mDAA0B;gBAoX/B,yGAAyG;gBACzG,wGAAwG;gBACxG,+FAA+F;gBAC/F,yBAAyB,CAAC,IAAI,CAAC,4BAA4B,EAAE,OAAO,CAAC,CAAC;gBAEtE,IAAI,CAAC,OAAO,GAAG,GAAG,EAAE;oBAChB,IAAI,CAAC,cAAc,CAAC,mBAAmB,GAAG,IAAI,CAAC,WAAW,CAAC;gBAC/D,CAAC,CAAC;aACL;YAED;;;eAGG;YACa,YAAY;gBACxB,OAAO,4BAA4B,CAAC;YACxC,CAAC;YAED;;eAEG;YACI,iBAAiB;gBACpB,IAAI,CAAC,cAAc,CAAC,iBAAiB,EAAE,CAAC;YAC5C,CAAC;YACe,OAAO,CAAC,MAAe;gBACnC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;gBAEtB,IAAI,IAAI,CAAC,6BAA6B,EAAE,CAAC;oBACrC,IAAI,CAAC,4BAA4B,CAAC,kBAAkB,GAAG,KAAK,CAAC;gBACjE,CAAC;YACL,CAAC;;;;+CAvEA,SAAS,EAAE;YACZ,kMAAW,eAAe,6DAEzB;;;;;SA9UQ,0BAA0B","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport { type Nullable } from \"../types\";\r\nimport { serialize } from \"../Misc/decorators\";\r\nimport { type Color4 } from \"../Maths/math.color\";\r\nimport { type Camera } from \"../Cameras/camera\";\r\nimport { type BaseTexture } from \"../Materials/Textures/baseTexture\";\r\nimport { type ColorCurves } from \"../Materials/colorCurves\";\r\nimport { type ImageProcessingConfiguration } from \"../Materials/imageProcessingConfiguration\";\r\nimport { type PostProcessOptions, PostProcess } from \"./postProcess.pure\";\r\nimport { type AbstractEngine } from \"../Engines/abstractEngine\";\r\nimport { Constants } from \"../Engines/constants\";\r\nimport { _ApplyWhiteBalanceOptions, ThinImageProcessingPostProcess } from \"./thinImageProcessingPostProcess\";\r\n\r\n/**\r\n * Options used to create an `ImageProcessingPostProcess`.\r\n */\r\nexport type ImageProcessingPostProcessOptions = PostProcessOptions & {\r\n /**\r\n * The correlated color temperature, in Kelvin, of the illuminant to neutralize via white balance - see\r\n * `ImageProcessingConfiguration.temperature`. Providing this (or `tint`) also enables white balance.\r\n * Defaults to 6500 K.\r\n */\r\n temperature?: number;\r\n\r\n /**\r\n * The white balance tint offset to apply, on the green/magenta axis - see `ImageProcessingConfiguration.tint`.\r\n * Providing this (or `temperature`) also enables white balance. Defaults to 0 (no tint offset).\r\n */\r\n tint?: number;\r\n};\r\n\r\n/**\r\n * ImageProcessingPostProcess\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses#imageprocessing\r\n */\r\nexport class ImageProcessingPostProcess extends PostProcess {\r\n protected get _imageProcessingConfiguration(): ImageProcessingConfiguration {\r\n return this._effectWrapper.imageProcessingConfiguration;\r\n }\r\n\r\n /**\r\n * Gets the image processing configuration used either in this material.\r\n */\r\n public get imageProcessingConfiguration(): ImageProcessingConfiguration {\r\n return this._effectWrapper.imageProcessingConfiguration;\r\n }\r\n\r\n /**\r\n * Sets the Default image processing configuration used either in the this material.\r\n *\r\n * If sets to null, the scene one is in use.\r\n */\r\n public set imageProcessingConfiguration(value: ImageProcessingConfiguration) {\r\n this._effectWrapper.imageProcessingConfiguration = value;\r\n }\r\n\r\n /**\r\n * If the post process is supported.\r\n */\r\n public override get isSupported(): boolean {\r\n const effect = this.getEffect();\r\n return !effect || effect.isSupported;\r\n }\r\n\r\n /**\r\n * Gets Color curves setup used in the effect if colorCurvesEnabled is set to true .\r\n */\r\n public get colorCurves(): Nullable<ColorCurves> {\r\n return this.imageProcessingConfiguration.colorCurves;\r\n }\r\n /**\r\n * Sets Color curves setup used in the effect if colorCurvesEnabled is set to true .\r\n */\r\n public set colorCurves(value: Nullable<ColorCurves>) {\r\n this.imageProcessingConfiguration.colorCurves = value;\r\n }\r\n\r\n /**\r\n * Gets whether the color curves effect is enabled.\r\n */\r\n public get colorCurvesEnabled(): boolean {\r\n return this.imageProcessingConfiguration.colorCurvesEnabled;\r\n }\r\n /**\r\n * Sets whether the color curves effect is enabled.\r\n */\r\n public set colorCurvesEnabled(value: boolean) {\r\n this.imageProcessingConfiguration.colorCurvesEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets Color grading LUT texture used in the effect if colorGradingEnabled is set to true.\r\n */\r\n public get colorGradingTexture(): Nullable<BaseTexture> {\r\n return this.imageProcessingConfiguration.colorGradingTexture;\r\n }\r\n /**\r\n * Sets Color grading LUT texture used in the effect if colorGradingEnabled is set to true.\r\n */\r\n public set colorGradingTexture(value: Nullable<BaseTexture>) {\r\n this.imageProcessingConfiguration.colorGradingTexture = value;\r\n }\r\n\r\n /**\r\n * Gets whether the color grading effect is enabled.\r\n */\r\n public get colorGradingEnabled(): boolean {\r\n return this.imageProcessingConfiguration.colorGradingEnabled;\r\n }\r\n /**\r\n * Gets whether the color grading effect is enabled.\r\n */\r\n public set colorGradingEnabled(value: boolean) {\r\n this.imageProcessingConfiguration.colorGradingEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets exposure used in the effect.\r\n */\r\n public get exposure(): number {\r\n return this.imageProcessingConfiguration.exposure;\r\n }\r\n /**\r\n * Sets exposure used in the effect.\r\n */\r\n public set exposure(value: number) {\r\n this.imageProcessingConfiguration.exposure = value;\r\n }\r\n\r\n /**\r\n * Gets whether tonemapping is enabled or not.\r\n */\r\n public get toneMappingEnabled(): boolean {\r\n return this._imageProcessingConfiguration.toneMappingEnabled;\r\n }\r\n /**\r\n * Sets whether tonemapping is enabled or not\r\n */\r\n public set toneMappingEnabled(value: boolean) {\r\n this._imageProcessingConfiguration.toneMappingEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets the type of tone mapping effect.\r\n */\r\n public get toneMappingType(): number {\r\n return this._imageProcessingConfiguration.toneMappingType;\r\n }\r\n /**\r\n * Sets the type of tone mapping effect.\r\n */\r\n public set toneMappingType(value: number) {\r\n this._imageProcessingConfiguration.toneMappingType = value;\r\n }\r\n\r\n /**\r\n * Gets contrast used in the effect.\r\n */\r\n public get contrast(): number {\r\n return this.imageProcessingConfiguration.contrast;\r\n }\r\n /**\r\n * Sets contrast used in the effect.\r\n */\r\n public set contrast(value: number) {\r\n this.imageProcessingConfiguration.contrast = value;\r\n }\r\n\r\n /**\r\n * Gets whether the white balance effect is enabled.\r\n */\r\n public get whiteBalanceEnabled(): boolean {\r\n return this.imageProcessingConfiguration.whiteBalanceEnabled;\r\n }\r\n /**\r\n * Sets whether the white balance effect is enabled.\r\n */\r\n public set whiteBalanceEnabled(value: boolean) {\r\n this.imageProcessingConfiguration.whiteBalanceEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets the white balance correlated color temperature, in Kelvin, used in the effect.\r\n */\r\n public get temperature(): number {\r\n return this.imageProcessingConfiguration.temperature;\r\n }\r\n /**\r\n * Sets the white balance correlated color temperature, in Kelvin, used in the effect.\r\n */\r\n public set temperature(value: number) {\r\n this.imageProcessingConfiguration.temperature = value;\r\n }\r\n\r\n /**\r\n * Gets the white balance tint offset used in the effect.\r\n */\r\n public get tint(): number {\r\n return this.imageProcessingConfiguration.tint;\r\n }\r\n /**\r\n * Sets the white balance tint offset used in the effect.\r\n */\r\n public set tint(value: number) {\r\n this.imageProcessingConfiguration.tint = value;\r\n }\r\n\r\n /**\r\n * Gets Vignette stretch size.\r\n */\r\n public get vignetteStretch(): number {\r\n return this.imageProcessingConfiguration.vignetteStretch;\r\n }\r\n /**\r\n * Sets Vignette stretch size.\r\n */\r\n public set vignetteStretch(value: number) {\r\n this.imageProcessingConfiguration.vignetteStretch = value;\r\n }\r\n\r\n /**\r\n * Gets Vignette center X Offset.\r\n * @deprecated use vignetteCenterX instead\r\n */\r\n public get vignetteCentreX(): number {\r\n return this.imageProcessingConfiguration.vignetteCenterX;\r\n }\r\n /**\r\n * Sets Vignette center X Offset.\r\n * @deprecated use vignetteCenterX instead\r\n */\r\n public set vignetteCentreX(value: number) {\r\n this.imageProcessingConfiguration.vignetteCenterX = value;\r\n }\r\n\r\n /**\r\n * Gets Vignette center Y Offset.\r\n * @deprecated use vignetteCenterY instead\r\n */\r\n public get vignetteCentreY(): number {\r\n return this.imageProcessingConfiguration.vignetteCenterY;\r\n }\r\n /**\r\n * Sets Vignette center Y Offset.\r\n * @deprecated use vignetteCenterY instead\r\n */\r\n public set vignetteCentreY(value: number) {\r\n this.imageProcessingConfiguration.vignetteCenterY = value;\r\n }\r\n\r\n /**\r\n * Vignette center Y Offset.\r\n */\r\n public get vignetteCenterY(): number {\r\n return this.imageProcessingConfiguration.vignetteCenterY;\r\n }\r\n public set vignetteCenterY(value: number) {\r\n this.imageProcessingConfiguration.vignetteCenterY = value;\r\n }\r\n\r\n /**\r\n * Vignette center X Offset.\r\n */\r\n public get vignetteCenterX(): number {\r\n return this.imageProcessingConfiguration.vignetteCenterX;\r\n }\r\n public set vignetteCenterX(value: number) {\r\n this.imageProcessingConfiguration.vignetteCenterX = value;\r\n }\r\n\r\n /**\r\n * Gets Vignette weight or intensity of the vignette effect.\r\n */\r\n public get vignetteWeight(): number {\r\n return this.imageProcessingConfiguration.vignetteWeight;\r\n }\r\n /**\r\n * Sets Vignette weight or intensity of the vignette effect.\r\n */\r\n public set vignetteWeight(value: number) {\r\n this.imageProcessingConfiguration.vignetteWeight = value;\r\n }\r\n\r\n /**\r\n * Gets Color of the vignette applied on the screen through the chosen blend mode (vignetteBlendMode)\r\n * if vignetteEnabled is set to true.\r\n */\r\n public get vignetteColor(): Color4 {\r\n return this.imageProcessingConfiguration.vignetteColor;\r\n }\r\n /**\r\n * Sets Color of the vignette applied on the screen through the chosen blend mode (vignetteBlendMode)\r\n * if vignetteEnabled is set to true.\r\n */\r\n public set vignetteColor(value: Color4) {\r\n this.imageProcessingConfiguration.vignetteColor = value;\r\n }\r\n\r\n /**\r\n * Gets Camera field of view used by the Vignette effect.\r\n */\r\n public get vignetteCameraFov(): number {\r\n return this.imageProcessingConfiguration.vignetteCameraFov;\r\n }\r\n /**\r\n * Sets Camera field of view used by the Vignette effect.\r\n */\r\n public set vignetteCameraFov(value: number) {\r\n this.imageProcessingConfiguration.vignetteCameraFov = value;\r\n }\r\n\r\n /**\r\n * Gets the vignette blend mode allowing different kind of effect.\r\n */\r\n public get vignetteBlendMode(): number {\r\n return this.imageProcessingConfiguration.vignetteBlendMode;\r\n }\r\n /**\r\n * Sets the vignette blend mode allowing different kind of effect.\r\n */\r\n public set vignetteBlendMode(value: number) {\r\n this.imageProcessingConfiguration.vignetteBlendMode = value;\r\n }\r\n\r\n /**\r\n * Gets whether the vignette effect is enabled.\r\n */\r\n public get vignetteEnabled(): boolean {\r\n return this.imageProcessingConfiguration.vignetteEnabled;\r\n }\r\n /**\r\n * Sets whether the vignette effect is enabled.\r\n */\r\n public set vignetteEnabled(value: boolean) {\r\n this.imageProcessingConfiguration.vignetteEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets intensity of the dithering effect.\r\n */\r\n public get ditheringIntensity(): number {\r\n return this.imageProcessingConfiguration.ditheringIntensity;\r\n }\r\n /**\r\n * Sets intensity of the dithering effect.\r\n */\r\n public set ditheringIntensity(value: number) {\r\n this.imageProcessingConfiguration.ditheringIntensity = value;\r\n }\r\n\r\n /**\r\n * Gets whether the dithering effect is enabled.\r\n */\r\n public get ditheringEnabled(): boolean {\r\n return this.imageProcessingConfiguration.ditheringEnabled;\r\n }\r\n /**\r\n * Sets whether the dithering effect is enabled.\r\n */\r\n public set ditheringEnabled(value: boolean) {\r\n this.imageProcessingConfiguration.ditheringEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets whether the input of the processing is in Gamma or Linear Space.\r\n */\r\n @serialize()\r\n public get fromLinearSpace(): boolean {\r\n return this._effectWrapper.fromLinearSpace;\r\n }\r\n /**\r\n * Sets whether the input of the processing is in Gamma or Linear Space.\r\n */\r\n public set fromLinearSpace(value: boolean) {\r\n this._effectWrapper.fromLinearSpace = value;\r\n }\r\n\r\n declare protected _effectWrapper: ThinImageProcessingPostProcess;\r\n\r\n constructor(\r\n name: string,\r\n options: number | ImageProcessingPostProcessOptions,\r\n camera: Nullable<Camera> = null,\r\n samplingMode?: number,\r\n engine?: AbstractEngine,\r\n reusable?: boolean,\r\n textureType: number = Constants.TEXTURETYPE_UNSIGNED_BYTE,\r\n imageProcessingConfiguration?: ImageProcessingConfiguration\r\n ) {\r\n const localOptions = {\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 imageProcessingConfiguration,\r\n scene: camera?.getScene(),\r\n ...(options as ImageProcessingPostProcessOptions),\r\n blockCompilation: true,\r\n };\r\n\r\n super(name, ThinImageProcessingPostProcess.FragmentUrl, {\r\n effectWrapper: typeof options === \"number\" || !options.effectWrapper ? new ThinImageProcessingPostProcess(name, engine, localOptions) : undefined,\r\n ...localOptions,\r\n });\r\n\r\n // Applied here (not just inside ThinImageProcessingPostProcess's own constructor) so that `temperature`/\r\n // `tint` are honored even when a caller supplies their own pre-built `effectWrapper`, in which case the\r\n // thin wrapper above is never constructed and its own application of these options never runs.\r\n _ApplyWhiteBalanceOptions(this.imageProcessingConfiguration, options);\r\n\r\n this.onApply = () => {\r\n this._effectWrapper.overrideAspectRatio = this.aspectRatio;\r\n };\r\n }\r\n\r\n /**\r\n * \"ImageProcessingPostProcess\"\r\n * @returns \"ImageProcessingPostProcess\"\r\n */\r\n public override getClassName(): string {\r\n return \"ImageProcessingPostProcess\";\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _updateParameters(): void {\r\n this._effectWrapper._updateParameters();\r\n }\r\n public override dispose(camera?: Camera): void {\r\n super.dispose(camera);\r\n\r\n if (this._imageProcessingConfiguration) {\r\n this.imageProcessingConfiguration.applyByPostProcess = false;\r\n }\r\n }\r\n}\r\n"]}
|
|
@@ -14,7 +14,33 @@ export interface ThinImageProcessingPostProcessOptions extends EffectWrapperCrea
|
|
|
14
14
|
* If not provided, the last created scene will be used.
|
|
15
15
|
*/
|
|
16
16
|
scene?: Nullable<Scene>;
|
|
17
|
+
/**
|
|
18
|
+
* The correlated color temperature, in Kelvin, of the illuminant to neutralize via white balance, applied to
|
|
19
|
+
* the resolved image processing configuration - see `ImageProcessingConfiguration.temperature`. Providing
|
|
20
|
+
* this (or `tint`) also enables white balance. Defaults to 6500 K.
|
|
21
|
+
*/
|
|
22
|
+
temperature?: number;
|
|
23
|
+
/**
|
|
24
|
+
* The white balance tint offset to apply, on the green/magenta axis, to the resolved image processing
|
|
25
|
+
* configuration - see `ImageProcessingConfiguration.tint`. Providing this (or `temperature`) also enables
|
|
26
|
+
* white balance. Defaults to 0 (no tint offset).
|
|
27
|
+
*/
|
|
28
|
+
tint?: number;
|
|
17
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Applies the `temperature`/`tint` white balance options (if provided) to an image processing configuration,
|
|
32
|
+
* enabling white balance if either was supplied. Exported (but internal) so it can be applied uniformly
|
|
33
|
+
* regardless of how the configuration was resolved - in particular, `ImageProcessingPostProcess` also calls this
|
|
34
|
+
* directly on `this.imageProcessingConfiguration` after construction, since a caller-supplied `effectWrapper`
|
|
35
|
+
* bypasses `ThinImageProcessingPostProcess`'s own constructor (and thus its own call to this function) entirely.
|
|
36
|
+
* @param configuration the image processing configuration to update
|
|
37
|
+
* @param options the options object that may contain `temperature`/`tint`, or a plain size number (ignored)
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
export declare function _ApplyWhiteBalanceOptions(configuration: ImageProcessingConfiguration, options?: {
|
|
41
|
+
temperature?: number;
|
|
42
|
+
tint?: number;
|
|
43
|
+
} | number): void;
|
|
18
44
|
/**
|
|
19
45
|
* Post process used to apply image processing to a scene
|
|
20
46
|
*/
|
|
@@ -112,6 +138,30 @@ export declare class ThinImageProcessingPostProcess extends EffectWrapper {
|
|
|
112
138
|
* Sets contrast used in the effect.
|
|
113
139
|
*/
|
|
114
140
|
set contrast(value: number);
|
|
141
|
+
/**
|
|
142
|
+
* Gets whether the white balance effect is enabled.
|
|
143
|
+
*/
|
|
144
|
+
get whiteBalanceEnabled(): boolean;
|
|
145
|
+
/**
|
|
146
|
+
* Sets whether the white balance effect is enabled.
|
|
147
|
+
*/
|
|
148
|
+
set whiteBalanceEnabled(value: boolean);
|
|
149
|
+
/**
|
|
150
|
+
* Gets the white balance correlated color temperature, in Kelvin, used in the effect.
|
|
151
|
+
*/
|
|
152
|
+
get temperature(): number;
|
|
153
|
+
/**
|
|
154
|
+
* Sets the white balance correlated color temperature, in Kelvin, used in the effect.
|
|
155
|
+
*/
|
|
156
|
+
set temperature(value: number);
|
|
157
|
+
/**
|
|
158
|
+
* Gets the white balance tint offset used in the effect.
|
|
159
|
+
*/
|
|
160
|
+
get tint(): number;
|
|
161
|
+
/**
|
|
162
|
+
* Sets the white balance tint offset used in the effect.
|
|
163
|
+
*/
|
|
164
|
+
set tint(value: number);
|
|
115
165
|
/**
|
|
116
166
|
* Gets Vignette stretch size.
|
|
117
167
|
*/
|
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
import { EffectWrapper } from "../Materials/effectRenderer.pure.js";
|
|
2
2
|
import { EngineStore } from "../Engines/engineStore.js";
|
|
3
3
|
import { ImageProcessingConfiguration } from "../Materials/imageProcessingConfiguration.pure.js";
|
|
4
|
+
/**
|
|
5
|
+
* Applies the `temperature`/`tint` white balance options (if provided) to an image processing configuration,
|
|
6
|
+
* enabling white balance if either was supplied. Exported (but internal) so it can be applied uniformly
|
|
7
|
+
* regardless of how the configuration was resolved - in particular, `ImageProcessingPostProcess` also calls this
|
|
8
|
+
* directly on `this.imageProcessingConfiguration` after construction, since a caller-supplied `effectWrapper`
|
|
9
|
+
* bypasses `ThinImageProcessingPostProcess`'s own constructor (and thus its own call to this function) entirely.
|
|
10
|
+
* @param configuration the image processing configuration to update
|
|
11
|
+
* @param options the options object that may contain `temperature`/`tint`, or a plain size number (ignored)
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
15
|
+
export function _ApplyWhiteBalanceOptions(configuration, options) {
|
|
16
|
+
if (!options || typeof options === "number") {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (options.temperature === undefined && options.tint === undefined) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (options.temperature !== undefined) {
|
|
23
|
+
configuration.temperature = options.temperature;
|
|
24
|
+
}
|
|
25
|
+
if (options.tint !== undefined) {
|
|
26
|
+
configuration.tint = options.tint;
|
|
27
|
+
}
|
|
28
|
+
configuration.whiteBalanceEnabled = true;
|
|
29
|
+
}
|
|
4
30
|
/**
|
|
5
31
|
* Post process used to apply image processing to a scene
|
|
6
32
|
*/
|
|
@@ -174,6 +200,42 @@ export class ThinImageProcessingPostProcess extends EffectWrapper {
|
|
|
174
200
|
set contrast(value) {
|
|
175
201
|
this.imageProcessingConfiguration.contrast = value;
|
|
176
202
|
}
|
|
203
|
+
/**
|
|
204
|
+
* Gets whether the white balance effect is enabled.
|
|
205
|
+
*/
|
|
206
|
+
get whiteBalanceEnabled() {
|
|
207
|
+
return this.imageProcessingConfiguration.whiteBalanceEnabled;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Sets whether the white balance effect is enabled.
|
|
211
|
+
*/
|
|
212
|
+
set whiteBalanceEnabled(value) {
|
|
213
|
+
this.imageProcessingConfiguration.whiteBalanceEnabled = value;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Gets the white balance correlated color temperature, in Kelvin, used in the effect.
|
|
217
|
+
*/
|
|
218
|
+
get temperature() {
|
|
219
|
+
return this.imageProcessingConfiguration.temperature;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Sets the white balance correlated color temperature, in Kelvin, used in the effect.
|
|
223
|
+
*/
|
|
224
|
+
set temperature(value) {
|
|
225
|
+
this.imageProcessingConfiguration.temperature = value;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Gets the white balance tint offset used in the effect.
|
|
229
|
+
*/
|
|
230
|
+
get tint() {
|
|
231
|
+
return this.imageProcessingConfiguration.tint;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Sets the white balance tint offset used in the effect.
|
|
235
|
+
*/
|
|
236
|
+
set tint(value) {
|
|
237
|
+
this.imageProcessingConfiguration.tint = value;
|
|
238
|
+
}
|
|
177
239
|
/**
|
|
178
240
|
* Gets Vignette stretch size.
|
|
179
241
|
*/
|
|
@@ -379,6 +441,7 @@ export class ThinImageProcessingPostProcess extends EffectWrapper {
|
|
|
379
441
|
*/
|
|
380
442
|
this._defines = {
|
|
381
443
|
IMAGEPROCESSING: false,
|
|
444
|
+
WHITEBALANCE: false,
|
|
382
445
|
VIGNETTE: false,
|
|
383
446
|
VIGNETTEBLENDMODEMULTIPLY: false,
|
|
384
447
|
VIGNETTEBLENDMODEOPAQUE: false,
|
|
@@ -401,12 +464,14 @@ export class ThinImageProcessingPostProcess extends EffectWrapper {
|
|
|
401
464
|
if (imageProcessingConfiguration) {
|
|
402
465
|
imageProcessingConfiguration.applyByPostProcess = true;
|
|
403
466
|
this._attachImageProcessingConfiguration(imageProcessingConfiguration, true);
|
|
467
|
+
_ApplyWhiteBalanceOptions(this.imageProcessingConfiguration, options);
|
|
404
468
|
// This will cause the shader to be compiled
|
|
405
469
|
this._updateParameters();
|
|
406
470
|
}
|
|
407
471
|
// Setup the default processing configuration to the scene.
|
|
408
472
|
else {
|
|
409
473
|
this._attachImageProcessingConfiguration(null, true);
|
|
474
|
+
_ApplyWhiteBalanceOptions(this.imageProcessingConfiguration, options);
|
|
410
475
|
this.imageProcessingConfiguration.applyByPostProcess = true;
|
|
411
476
|
}
|
|
412
477
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thinImageProcessingPostProcess.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/thinImageProcessingPostProcess.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EAAE,4BAA4B,EAAE,MAAM,gDAAgD,CAAC;AAmB9F;;GAEG;AACH,MAAM,OAAO,8BAA+B,SAAQ,aAAa;IAM1C,cAAc,CAAC,SAAkB,EAAE,IAAoB;QACtE,IAAI,SAAS,EAAE,CAAC;YACZ,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;YACzB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,yCAAyC,CAAC,CAAC,CAAC;QACjE,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,qCAAqC,CAAC,CAAC,CAAC;QAC7D,CAAC;IACL,CAAC;IAOD;;OAEG;IACH,IAAW,4BAA4B;QACnC,OAAO,IAAI,CAAC,6BAA6B,CAAC;IAC9C,CAAC;IAED;;;;OAIG;IACH,IAAW,4BAA4B,CAAC,KAAmC;QACvE,sDAAsD;QACtD,iCAAiC;QACjC,KAAK,CAAC,kBAAkB,GAAG,IAAI,CAAC;QAChC,IAAI,CAAC,mCAAmC,CAAC,KAAK,CAAC,CAAC;IACpD,CAAC;IAOD;;;;OAIG;IACO,mCAAmC,CAAC,aAAqD,EAAE,UAAU,GAAG,KAAK;QACnH,IAAI,aAAa,KAAK,IAAI,CAAC,6BAA6B,EAAE,CAAC;YACvD,OAAO;QACX,CAAC;QAED,qBAAqB;QACrB,IAAI,IAAI,CAAC,6BAA6B,IAAI,IAAI,CAAC,wBAAwB,EAAE,CAAC;YACtE,IAAI,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,IAAI,CAAC,6BAA6B,CAAC,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QAChG,CAAC;QAED,IAAI,IAAI,CAAC,6BAA6B,EAAE,CAAC;YACrC,IAAI,CAAC,4BAA4B,CAAC,kBAAkB,GAAG,KAAK,CAAC;QACjE,CAAC;IACL,CAAC;;AAjgBD;;GAEG;AACoB,0CAAW,GAAG,iBAAiB,AAApB,CAAqB","sourcesContent":["import {\r\n type Nullable,\r\n type AbstractEngine,\r\n type EffectWrapperCreationOptions,\r\n type Observer,\r\n type NonNullableFields,\r\n type Scene,\r\n type ColorCurves,\r\n type BaseTexture,\r\n type Color4,\r\n} from \"core/index\";\r\nimport { EffectWrapper } from \"../Materials/effectRenderer.pure\";\r\nimport { EngineStore } from \"../Engines/engineStore\";\r\nimport { type IImageProcessingConfigurationDefines } from \"../Materials/imageProcessingConfiguration.defines\";\r\nimport { ImageProcessingConfiguration } from \"../Materials/imageProcessingConfiguration.pure\";\r\n\r\n/**\r\n * Options used to create a ThinImageProcessingPostProcessOptions.\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport interface ThinImageProcessingPostProcessOptions extends EffectWrapperCreationOptions {\r\n /**\r\n * An existing image processing configuration to use. If not provided, the scene one will be used.\r\n */\r\n imageProcessingConfiguration?: ImageProcessingConfiguration;\r\n\r\n /**\r\n * The scene to retrieve the image processing configuration from if not provided in the options.\r\n * If not provided, the last created scene will be used.\r\n */\r\n scene?: Nullable<Scene>;\r\n}\r\n\r\n/**\r\n * Post process used to apply image processing to a scene\r\n */\r\nexport class ThinImageProcessingPostProcess extends EffectWrapper {\r\n /**\r\n * The fragment shader url\r\n */\r\n public static readonly FragmentUrl = \"imageProcessing\";\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/imageProcessing.fragment\"));\r\n } else {\r\n list.push(import(\"../Shaders/imageProcessing.fragment\"));\r\n }\r\n }\r\n\r\n /**\r\n * Default configuration related to image processing available in the PBR Material.\r\n */\r\n protected _imageProcessingConfiguration: ImageProcessingConfiguration;\r\n\r\n /**\r\n * Gets the image processing configuration used either in this material.\r\n */\r\n public get imageProcessingConfiguration(): ImageProcessingConfiguration {\r\n return this._imageProcessingConfiguration;\r\n }\r\n\r\n /**\r\n * Sets the Default image processing configuration used either in the this material.\r\n *\r\n * If sets to null, the scene one is in use.\r\n */\r\n public set imageProcessingConfiguration(value: ImageProcessingConfiguration) {\r\n // We are almost sure it is applied by post process as\r\n // We are in the post process :-)\r\n value.applyByPostProcess = true;\r\n this._attachImageProcessingConfiguration(value);\r\n }\r\n\r\n /**\r\n * Keep track of the image processing observer to allow dispose and replace.\r\n */\r\n private _imageProcessingObserver: Nullable<Observer<ImageProcessingConfiguration>>;\r\n\r\n /**\r\n * Attaches a new image processing configuration to the PBR Material.\r\n * @param configuration\r\n * @param doNotBuild\r\n */\r\n protected _attachImageProcessingConfiguration(configuration: Nullable<ImageProcessingConfiguration>, doNotBuild = false): void {\r\n if (configuration === this._imageProcessingConfiguration) {\r\n return;\r\n }\r\n\r\n // Detaches observer.\r\n if (this._imageProcessingConfiguration && this._imageProcessingObserver) {\r\n this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver);\r\n }\r\n\r\n // Pick the scene configuration if needed.\r\n if (!configuration) {\r\n let scene = this.options.scene;\r\n\r\n if (!scene) {\r\n const engine = this.options.engine;\r\n if (engine && engine.scenes) {\r\n const scenes = engine.scenes;\r\n scene = scenes[scenes.length - 1];\r\n } else {\r\n scene = EngineStore.LastCreatedScene!;\r\n }\r\n }\r\n\r\n if (scene) {\r\n this._imageProcessingConfiguration = scene.imageProcessingConfiguration;\r\n } else {\r\n this._imageProcessingConfiguration = new ImageProcessingConfiguration();\r\n }\r\n } else {\r\n this._imageProcessingConfiguration = configuration;\r\n }\r\n\r\n // Attaches observer.\r\n if (this._imageProcessingConfiguration) {\r\n this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(() => {\r\n this._updateParameters();\r\n });\r\n }\r\n\r\n // Ensure the effect will be rebuilt.\r\n if (!doNotBuild) {\r\n this._updateParameters();\r\n }\r\n }\r\n\r\n /**\r\n * Gets Color curves setup used in the effect if colorCurvesEnabled is set to true .\r\n */\r\n public get colorCurves(): Nullable<ColorCurves> {\r\n return this.imageProcessingConfiguration.colorCurves;\r\n }\r\n /**\r\n * Sets Color curves setup used in the effect if colorCurvesEnabled is set to true .\r\n */\r\n public set colorCurves(value: Nullable<ColorCurves>) {\r\n this.imageProcessingConfiguration.colorCurves = value;\r\n }\r\n\r\n /**\r\n * Gets whether the color curves effect is enabled.\r\n */\r\n public get colorCurvesEnabled(): boolean {\r\n return this.imageProcessingConfiguration.colorCurvesEnabled;\r\n }\r\n /**\r\n * Sets whether the color curves effect is enabled.\r\n */\r\n public set colorCurvesEnabled(value: boolean) {\r\n this.imageProcessingConfiguration.colorCurvesEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets Color grading LUT texture used in the effect if colorGradingEnabled is set to true.\r\n */\r\n public get colorGradingTexture(): Nullable<BaseTexture> {\r\n return this.imageProcessingConfiguration.colorGradingTexture;\r\n }\r\n /**\r\n * Sets Color grading LUT texture used in the effect if colorGradingEnabled is set to true.\r\n */\r\n public set colorGradingTexture(value: Nullable<BaseTexture>) {\r\n this.imageProcessingConfiguration.colorGradingTexture = value;\r\n }\r\n\r\n /**\r\n * Gets whether the color grading effect is enabled.\r\n */\r\n public get colorGradingEnabled(): boolean {\r\n return this.imageProcessingConfiguration.colorGradingEnabled;\r\n }\r\n /**\r\n * Gets whether the color grading effect is enabled.\r\n */\r\n public set colorGradingEnabled(value: boolean) {\r\n this.imageProcessingConfiguration.colorGradingEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets exposure used in the effect.\r\n */\r\n public get exposure(): number {\r\n return this.imageProcessingConfiguration.exposure;\r\n }\r\n /**\r\n * Sets exposure used in the effect.\r\n */\r\n public set exposure(value: number) {\r\n this.imageProcessingConfiguration.exposure = value;\r\n }\r\n\r\n /**\r\n * Gets whether tonemapping is enabled or not.\r\n */\r\n public get toneMappingEnabled(): boolean {\r\n return this._imageProcessingConfiguration.toneMappingEnabled;\r\n }\r\n /**\r\n * Sets whether tonemapping is enabled or not\r\n */\r\n public set toneMappingEnabled(value: boolean) {\r\n this._imageProcessingConfiguration.toneMappingEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets the type of tone mapping effect.\r\n */\r\n public get toneMappingType(): number {\r\n return this._imageProcessingConfiguration.toneMappingType;\r\n }\r\n /**\r\n * Sets the type of tone mapping effect.\r\n */\r\n public set toneMappingType(value: number) {\r\n this._imageProcessingConfiguration.toneMappingType = value;\r\n }\r\n\r\n /**\r\n * Gets contrast used in the effect.\r\n */\r\n public get contrast(): number {\r\n return this.imageProcessingConfiguration.contrast;\r\n }\r\n /**\r\n * Sets contrast used in the effect.\r\n */\r\n public set contrast(value: number) {\r\n this.imageProcessingConfiguration.contrast = value;\r\n }\r\n\r\n /**\r\n * Gets Vignette stretch size.\r\n */\r\n public get vignetteStretch(): number {\r\n return this.imageProcessingConfiguration.vignetteStretch;\r\n }\r\n /**\r\n * Sets Vignette stretch size.\r\n */\r\n public set vignetteStretch(value: number) {\r\n this.imageProcessingConfiguration.vignetteStretch = value;\r\n }\r\n\r\n /**\r\n * Gets Vignette center X Offset.\r\n * @deprecated use vignetteCenterX instead\r\n */\r\n public get vignetteCentreX(): number {\r\n return this.imageProcessingConfiguration.vignetteCenterX;\r\n }\r\n /**\r\n * Sets Vignette center X Offset.\r\n * @deprecated use vignetteCenterX instead\r\n */\r\n public set vignetteCentreX(value: number) {\r\n this.imageProcessingConfiguration.vignetteCenterX = value;\r\n }\r\n\r\n /**\r\n * Gets Vignette center Y Offset.\r\n * @deprecated use vignetteCenterY instead\r\n */\r\n public get vignetteCentreY(): number {\r\n return this.imageProcessingConfiguration.vignetteCenterY;\r\n }\r\n /**\r\n * Sets Vignette center Y Offset.\r\n * @deprecated use vignetteCenterY instead\r\n */\r\n public set vignetteCentreY(value: number) {\r\n this.imageProcessingConfiguration.vignetteCenterY = value;\r\n }\r\n\r\n /**\r\n * Vignette center Y Offset.\r\n */\r\n public get vignetteCenterY(): number {\r\n return this.imageProcessingConfiguration.vignetteCenterY;\r\n }\r\n public set vignetteCenterY(value: number) {\r\n this.imageProcessingConfiguration.vignetteCenterY = value;\r\n }\r\n\r\n /**\r\n * Vignette center X Offset.\r\n */\r\n public get vignetteCenterX(): number {\r\n return this.imageProcessingConfiguration.vignetteCenterX;\r\n }\r\n public set vignetteCenterX(value: number) {\r\n this.imageProcessingConfiguration.vignetteCenterX = value;\r\n }\r\n\r\n /**\r\n * Gets Vignette weight or intensity of the vignette effect.\r\n */\r\n public get vignetteWeight(): number {\r\n return this.imageProcessingConfiguration.vignetteWeight;\r\n }\r\n /**\r\n * Sets Vignette weight or intensity of the vignette effect.\r\n */\r\n public set vignetteWeight(value: number) {\r\n this.imageProcessingConfiguration.vignetteWeight = value;\r\n }\r\n\r\n /**\r\n * Gets Color of the vignette applied on the screen through the chosen blend mode (vignetteBlendMode)\r\n * if vignetteEnabled is set to true.\r\n */\r\n public get vignetteColor(): Color4 {\r\n return this.imageProcessingConfiguration.vignetteColor;\r\n }\r\n /**\r\n * Sets Color of the vignette applied on the screen through the chosen blend mode (vignetteBlendMode)\r\n * if vignetteEnabled is set to true.\r\n */\r\n public set vignetteColor(value: Color4) {\r\n this.imageProcessingConfiguration.vignetteColor = value;\r\n }\r\n\r\n /**\r\n * Gets Camera field of view used by the Vignette effect.\r\n */\r\n public get vignetteCameraFov(): number {\r\n return this.imageProcessingConfiguration.vignetteCameraFov;\r\n }\r\n /**\r\n * Sets Camera field of view used by the Vignette effect.\r\n */\r\n public set vignetteCameraFov(value: number) {\r\n this.imageProcessingConfiguration.vignetteCameraFov = value;\r\n }\r\n\r\n /**\r\n * Gets the vignette blend mode allowing different kind of effect.\r\n */\r\n public get vignetteBlendMode(): number {\r\n return this.imageProcessingConfiguration.vignetteBlendMode;\r\n }\r\n /**\r\n * Sets the vignette blend mode allowing different kind of effect.\r\n */\r\n public set vignetteBlendMode(value: number) {\r\n this.imageProcessingConfiguration.vignetteBlendMode = value;\r\n }\r\n\r\n /**\r\n * Gets whether the vignette effect is enabled.\r\n */\r\n public get vignetteEnabled(): boolean {\r\n return this.imageProcessingConfiguration.vignetteEnabled;\r\n }\r\n /**\r\n * Sets whether the vignette effect is enabled.\r\n */\r\n public set vignetteEnabled(value: boolean) {\r\n this.imageProcessingConfiguration.vignetteEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets intensity of the dithering effect.\r\n */\r\n public get ditheringIntensity(): number {\r\n return this.imageProcessingConfiguration.ditheringIntensity;\r\n }\r\n /**\r\n * Sets intensity of the dithering effect.\r\n */\r\n public set ditheringIntensity(value: number) {\r\n this.imageProcessingConfiguration.ditheringIntensity = value;\r\n }\r\n\r\n /**\r\n * Gets whether the dithering effect is enabled.\r\n */\r\n public get ditheringEnabled(): boolean {\r\n return this.imageProcessingConfiguration.ditheringEnabled;\r\n }\r\n /**\r\n * Sets whether the dithering effect is enabled.\r\n */\r\n public set ditheringEnabled(value: boolean) {\r\n this.imageProcessingConfiguration.ditheringEnabled = value;\r\n }\r\n\r\n private _fromLinearSpace = true;\r\n /**\r\n * Gets whether the input of the processing is in Gamma or Linear Space.\r\n */\r\n public get fromLinearSpace(): boolean {\r\n return this._fromLinearSpace;\r\n }\r\n /**\r\n * Sets whether the input of the processing is in Gamma or Linear Space.\r\n */\r\n public set fromLinearSpace(value: boolean) {\r\n if (this._fromLinearSpace === value) {\r\n return;\r\n }\r\n\r\n this._fromLinearSpace = value;\r\n this._updateParameters();\r\n }\r\n\r\n /**\r\n * * Gets the width of the output texture used to store the result of the post process.\r\n */\r\n public get outputTextureWidth() {\r\n return this.imageProcessingConfiguration.outputTextureWidth;\r\n }\r\n\r\n /**\r\n * * Sets the width of the output texture used to store the result of the post process.\r\n */\r\n public set outputTextureWidth(value: number) {\r\n this.imageProcessingConfiguration.outputTextureWidth = value;\r\n }\r\n\r\n /**\r\n * * Gets the height of the output texture used to store the result of the post process.\r\n */\r\n public get outputTextureHeight() {\r\n return this.imageProcessingConfiguration.outputTextureHeight;\r\n }\r\n\r\n /**\r\n * * Sets the height of the output texture used to store the result of the post process.\r\n */\r\n public set outputTextureHeight(value: number) {\r\n this.imageProcessingConfiguration.outputTextureHeight = value;\r\n }\r\n\r\n /**\r\n * Gets/sets the aspect ratio used to override the default one.\r\n */\r\n public overrideAspectRatio?: number;\r\n\r\n /**\r\n * Defines cache preventing GC.\r\n */\r\n private _defines: IImageProcessingConfigurationDefines & { FROMLINEARSPACE: boolean } = {\r\n IMAGEPROCESSING: false,\r\n VIGNETTE: false,\r\n VIGNETTEBLENDMODEMULTIPLY: false,\r\n VIGNETTEBLENDMODEOPAQUE: false,\r\n TONEMAPPING: 0,\r\n CONTRAST: false,\r\n COLORCURVES: false,\r\n COLORGRADING: false,\r\n COLORGRADING3D: false,\r\n FROMLINEARSPACE: false,\r\n SAMPLER3DGREENDEPTH: false,\r\n SAMPLER3DBGRMAP: false,\r\n DITHER: false,\r\n IMAGEPROCESSINGPOSTPROCESS: false,\r\n EXPOSURE: false,\r\n SKIPFINALCOLORCLAMP: false,\r\n };\r\n\r\n public override readonly options: Required<NonNullableFields<ThinImageProcessingPostProcessOptions>>;\r\n\r\n /**\r\n * Constructs a new image processing 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?: ThinImageProcessingPostProcessOptions) {\r\n super({\r\n ...options,\r\n name,\r\n engine: engine || EngineStore.LastCreatedEngine!,\r\n useShaderStore: true,\r\n useAsPostProcess: true,\r\n fragmentShader: ThinImageProcessingPostProcess.FragmentUrl,\r\n });\r\n\r\n const imageProcessingConfiguration = options?.imageProcessingConfiguration;\r\n\r\n // Setup the configuration as forced by the constructor. This would then not force the\r\n // scene materials output in linear space and let untouched the default forward pass.\r\n if (imageProcessingConfiguration) {\r\n imageProcessingConfiguration.applyByPostProcess = true;\r\n this._attachImageProcessingConfiguration(imageProcessingConfiguration, true);\r\n // This will cause the shader to be compiled\r\n this._updateParameters();\r\n }\r\n // Setup the default processing configuration to the scene.\r\n else {\r\n this._attachImageProcessingConfiguration(null, true);\r\n this.imageProcessingConfiguration.applyByPostProcess = true;\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _updateParameters(): void {\r\n this._defines.FROMLINEARSPACE = this._fromLinearSpace;\r\n this.imageProcessingConfiguration.prepareDefines(this._defines, true);\r\n let defines = \"\";\r\n for (const prop in this._defines) {\r\n const value = (<any>this._defines)[prop];\r\n const type = typeof value;\r\n\r\n switch (type) {\r\n case \"number\":\r\n case \"string\":\r\n defines += `#define ${prop} ${value};\\n`;\r\n break;\r\n default:\r\n if (value) {\r\n defines += `#define ${prop};\\n`;\r\n }\r\n break;\r\n }\r\n }\r\n\r\n const samplers = [\"textureSampler\"];\r\n const uniforms = [\"scale\"];\r\n\r\n if (ImageProcessingConfiguration) {\r\n ImageProcessingConfiguration.PrepareSamplers(samplers, this._defines);\r\n ImageProcessingConfiguration.PrepareUniforms(uniforms, this._defines);\r\n }\r\n\r\n this.updateEffect(defines, uniforms, samplers);\r\n }\r\n\r\n public override bind(noDefaultBindings = false) {\r\n super.bind(noDefaultBindings);\r\n this.imageProcessingConfiguration.bind(this.effect, this.overrideAspectRatio);\r\n }\r\n\r\n public override dispose(): void {\r\n super.dispose();\r\n\r\n if (this._imageProcessingConfiguration && this._imageProcessingObserver) {\r\n this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver);\r\n }\r\n\r\n if (this._imageProcessingConfiguration) {\r\n this.imageProcessingConfiguration.applyByPostProcess = false;\r\n }\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"thinImageProc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,6BAA6B,CAAC,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QAChG,CAAC;QAED,IAAI,IAAI,CAAC,6BAA6B,EAAE,CAAC;YACrC,IAAI,CAAC,4BAA4B,CAAC,kBAAkB,GAAG,KAAK,CAAC;QACjE,CAAC;IACL,CAAC;;AA3iBD;;GAEG;AACoB,0CAAW,GAAG,iBAAiB,AAApB,CAAqB","sourcesContent":["import {\r\n type Nullable,\r\n type AbstractEngine,\r\n type EffectWrapperCreationOptions,\r\n type Observer,\r\n type NonNullableFields,\r\n type Scene,\r\n type ColorCurves,\r\n type BaseTexture,\r\n type Color4,\r\n} from \"core/index\";\r\nimport { EffectWrapper } from \"../Materials/effectRenderer.pure\";\r\nimport { EngineStore } from \"../Engines/engineStore\";\r\nimport { type IImageProcessingConfigurationDefines } from \"../Materials/imageProcessingConfiguration.defines\";\r\nimport { ImageProcessingConfiguration } from \"../Materials/imageProcessingConfiguration.pure\";\r\n\r\n/**\r\n * Options used to create a ThinImageProcessingPostProcessOptions.\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport interface ThinImageProcessingPostProcessOptions extends EffectWrapperCreationOptions {\r\n /**\r\n * An existing image processing configuration to use. If not provided, the scene one will be used.\r\n */\r\n imageProcessingConfiguration?: ImageProcessingConfiguration;\r\n\r\n /**\r\n * The scene to retrieve the image processing configuration from if not provided in the options.\r\n * If not provided, the last created scene will be used.\r\n */\r\n scene?: Nullable<Scene>;\r\n\r\n /**\r\n * The correlated color temperature, in Kelvin, of the illuminant to neutralize via white balance, applied to\r\n * the resolved image processing configuration - see `ImageProcessingConfiguration.temperature`. Providing\r\n * this (or `tint`) also enables white balance. Defaults to 6500 K.\r\n */\r\n temperature?: number;\r\n\r\n /**\r\n * The white balance tint offset to apply, on the green/magenta axis, to the resolved image processing\r\n * configuration - see `ImageProcessingConfiguration.tint`. Providing this (or `temperature`) also enables\r\n * white balance. Defaults to 0 (no tint offset).\r\n */\r\n tint?: number;\r\n}\r\n\r\n/**\r\n * Applies the `temperature`/`tint` white balance options (if provided) to an image processing configuration,\r\n * enabling white balance if either was supplied. Exported (but internal) so it can be applied uniformly\r\n * regardless of how the configuration was resolved - in particular, `ImageProcessingPostProcess` also calls this\r\n * directly on `this.imageProcessingConfiguration` after construction, since a caller-supplied `effectWrapper`\r\n * bypasses `ThinImageProcessingPostProcess`'s own constructor (and thus its own call to this function) entirely.\r\n * @param configuration the image processing configuration to update\r\n * @param options the options object that may contain `temperature`/`tint`, or a plain size number (ignored)\r\n * @internal\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function _ApplyWhiteBalanceOptions(configuration: ImageProcessingConfiguration, options?: { temperature?: number; tint?: number } | number): void {\r\n if (!options || typeof options === \"number\") {\r\n return;\r\n }\r\n\r\n if (options.temperature === undefined && options.tint === undefined) {\r\n return;\r\n }\r\n\r\n if (options.temperature !== undefined) {\r\n configuration.temperature = options.temperature;\r\n }\r\n if (options.tint !== undefined) {\r\n configuration.tint = options.tint;\r\n }\r\n configuration.whiteBalanceEnabled = true;\r\n}\r\n\r\n/**\r\n * Post process used to apply image processing to a scene\r\n */\r\nexport class ThinImageProcessingPostProcess extends EffectWrapper {\r\n /**\r\n * The fragment shader url\r\n */\r\n public static readonly FragmentUrl = \"imageProcessing\";\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/imageProcessing.fragment\"));\r\n } else {\r\n list.push(import(\"../Shaders/imageProcessing.fragment\"));\r\n }\r\n }\r\n\r\n /**\r\n * Default configuration related to image processing available in the PBR Material.\r\n */\r\n protected _imageProcessingConfiguration: ImageProcessingConfiguration;\r\n\r\n /**\r\n * Gets the image processing configuration used either in this material.\r\n */\r\n public get imageProcessingConfiguration(): ImageProcessingConfiguration {\r\n return this._imageProcessingConfiguration;\r\n }\r\n\r\n /**\r\n * Sets the Default image processing configuration used either in the this material.\r\n *\r\n * If sets to null, the scene one is in use.\r\n */\r\n public set imageProcessingConfiguration(value: ImageProcessingConfiguration) {\r\n // We are almost sure it is applied by post process as\r\n // We are in the post process :-)\r\n value.applyByPostProcess = true;\r\n this._attachImageProcessingConfiguration(value);\r\n }\r\n\r\n /**\r\n * Keep track of the image processing observer to allow dispose and replace.\r\n */\r\n private _imageProcessingObserver: Nullable<Observer<ImageProcessingConfiguration>>;\r\n\r\n /**\r\n * Attaches a new image processing configuration to the PBR Material.\r\n * @param configuration\r\n * @param doNotBuild\r\n */\r\n protected _attachImageProcessingConfiguration(configuration: Nullable<ImageProcessingConfiguration>, doNotBuild = false): void {\r\n if (configuration === this._imageProcessingConfiguration) {\r\n return;\r\n }\r\n\r\n // Detaches observer.\r\n if (this._imageProcessingConfiguration && this._imageProcessingObserver) {\r\n this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver);\r\n }\r\n\r\n // Pick the scene configuration if needed.\r\n if (!configuration) {\r\n let scene = this.options.scene;\r\n\r\n if (!scene) {\r\n const engine = this.options.engine;\r\n if (engine && engine.scenes) {\r\n const scenes = engine.scenes;\r\n scene = scenes[scenes.length - 1];\r\n } else {\r\n scene = EngineStore.LastCreatedScene!;\r\n }\r\n }\r\n\r\n if (scene) {\r\n this._imageProcessingConfiguration = scene.imageProcessingConfiguration;\r\n } else {\r\n this._imageProcessingConfiguration = new ImageProcessingConfiguration();\r\n }\r\n } else {\r\n this._imageProcessingConfiguration = configuration;\r\n }\r\n\r\n // Attaches observer.\r\n if (this._imageProcessingConfiguration) {\r\n this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(() => {\r\n this._updateParameters();\r\n });\r\n }\r\n\r\n // Ensure the effect will be rebuilt.\r\n if (!doNotBuild) {\r\n this._updateParameters();\r\n }\r\n }\r\n\r\n /**\r\n * Gets Color curves setup used in the effect if colorCurvesEnabled is set to true .\r\n */\r\n public get colorCurves(): Nullable<ColorCurves> {\r\n return this.imageProcessingConfiguration.colorCurves;\r\n }\r\n /**\r\n * Sets Color curves setup used in the effect if colorCurvesEnabled is set to true .\r\n */\r\n public set colorCurves(value: Nullable<ColorCurves>) {\r\n this.imageProcessingConfiguration.colorCurves = value;\r\n }\r\n\r\n /**\r\n * Gets whether the color curves effect is enabled.\r\n */\r\n public get colorCurvesEnabled(): boolean {\r\n return this.imageProcessingConfiguration.colorCurvesEnabled;\r\n }\r\n /**\r\n * Sets whether the color curves effect is enabled.\r\n */\r\n public set colorCurvesEnabled(value: boolean) {\r\n this.imageProcessingConfiguration.colorCurvesEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets Color grading LUT texture used in the effect if colorGradingEnabled is set to true.\r\n */\r\n public get colorGradingTexture(): Nullable<BaseTexture> {\r\n return this.imageProcessingConfiguration.colorGradingTexture;\r\n }\r\n /**\r\n * Sets Color grading LUT texture used in the effect if colorGradingEnabled is set to true.\r\n */\r\n public set colorGradingTexture(value: Nullable<BaseTexture>) {\r\n this.imageProcessingConfiguration.colorGradingTexture = value;\r\n }\r\n\r\n /**\r\n * Gets whether the color grading effect is enabled.\r\n */\r\n public get colorGradingEnabled(): boolean {\r\n return this.imageProcessingConfiguration.colorGradingEnabled;\r\n }\r\n /**\r\n * Gets whether the color grading effect is enabled.\r\n */\r\n public set colorGradingEnabled(value: boolean) {\r\n this.imageProcessingConfiguration.colorGradingEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets exposure used in the effect.\r\n */\r\n public get exposure(): number {\r\n return this.imageProcessingConfiguration.exposure;\r\n }\r\n /**\r\n * Sets exposure used in the effect.\r\n */\r\n public set exposure(value: number) {\r\n this.imageProcessingConfiguration.exposure = value;\r\n }\r\n\r\n /**\r\n * Gets whether tonemapping is enabled or not.\r\n */\r\n public get toneMappingEnabled(): boolean {\r\n return this._imageProcessingConfiguration.toneMappingEnabled;\r\n }\r\n /**\r\n * Sets whether tonemapping is enabled or not\r\n */\r\n public set toneMappingEnabled(value: boolean) {\r\n this._imageProcessingConfiguration.toneMappingEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets the type of tone mapping effect.\r\n */\r\n public get toneMappingType(): number {\r\n return this._imageProcessingConfiguration.toneMappingType;\r\n }\r\n /**\r\n * Sets the type of tone mapping effect.\r\n */\r\n public set toneMappingType(value: number) {\r\n this._imageProcessingConfiguration.toneMappingType = value;\r\n }\r\n\r\n /**\r\n * Gets contrast used in the effect.\r\n */\r\n public get contrast(): number {\r\n return this.imageProcessingConfiguration.contrast;\r\n }\r\n /**\r\n * Sets contrast used in the effect.\r\n */\r\n public set contrast(value: number) {\r\n this.imageProcessingConfiguration.contrast = value;\r\n }\r\n\r\n /**\r\n * Gets whether the white balance effect is enabled.\r\n */\r\n public get whiteBalanceEnabled(): boolean {\r\n return this.imageProcessingConfiguration.whiteBalanceEnabled;\r\n }\r\n /**\r\n * Sets whether the white balance effect is enabled.\r\n */\r\n public set whiteBalanceEnabled(value: boolean) {\r\n this.imageProcessingConfiguration.whiteBalanceEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets the white balance correlated color temperature, in Kelvin, used in the effect.\r\n */\r\n public get temperature(): number {\r\n return this.imageProcessingConfiguration.temperature;\r\n }\r\n /**\r\n * Sets the white balance correlated color temperature, in Kelvin, used in the effect.\r\n */\r\n public set temperature(value: number) {\r\n this.imageProcessingConfiguration.temperature = value;\r\n }\r\n\r\n /**\r\n * Gets the white balance tint offset used in the effect.\r\n */\r\n public get tint(): number {\r\n return this.imageProcessingConfiguration.tint;\r\n }\r\n /**\r\n * Sets the white balance tint offset used in the effect.\r\n */\r\n public set tint(value: number) {\r\n this.imageProcessingConfiguration.tint = value;\r\n }\r\n\r\n /**\r\n * Gets Vignette stretch size.\r\n */\r\n public get vignetteStretch(): number {\r\n return this.imageProcessingConfiguration.vignetteStretch;\r\n }\r\n /**\r\n * Sets Vignette stretch size.\r\n */\r\n public set vignetteStretch(value: number) {\r\n this.imageProcessingConfiguration.vignetteStretch = value;\r\n }\r\n\r\n /**\r\n * Gets Vignette center X Offset.\r\n * @deprecated use vignetteCenterX instead\r\n */\r\n public get vignetteCentreX(): number {\r\n return this.imageProcessingConfiguration.vignetteCenterX;\r\n }\r\n /**\r\n * Sets Vignette center X Offset.\r\n * @deprecated use vignetteCenterX instead\r\n */\r\n public set vignetteCentreX(value: number) {\r\n this.imageProcessingConfiguration.vignetteCenterX = value;\r\n }\r\n\r\n /**\r\n * Gets Vignette center Y Offset.\r\n * @deprecated use vignetteCenterY instead\r\n */\r\n public get vignetteCentreY(): number {\r\n return this.imageProcessingConfiguration.vignetteCenterY;\r\n }\r\n /**\r\n * Sets Vignette center Y Offset.\r\n * @deprecated use vignetteCenterY instead\r\n */\r\n public set vignetteCentreY(value: number) {\r\n this.imageProcessingConfiguration.vignetteCenterY = value;\r\n }\r\n\r\n /**\r\n * Vignette center Y Offset.\r\n */\r\n public get vignetteCenterY(): number {\r\n return this.imageProcessingConfiguration.vignetteCenterY;\r\n }\r\n public set vignetteCenterY(value: number) {\r\n this.imageProcessingConfiguration.vignetteCenterY = value;\r\n }\r\n\r\n /**\r\n * Vignette center X Offset.\r\n */\r\n public get vignetteCenterX(): number {\r\n return this.imageProcessingConfiguration.vignetteCenterX;\r\n }\r\n public set vignetteCenterX(value: number) {\r\n this.imageProcessingConfiguration.vignetteCenterX = value;\r\n }\r\n\r\n /**\r\n * Gets Vignette weight or intensity of the vignette effect.\r\n */\r\n public get vignetteWeight(): number {\r\n return this.imageProcessingConfiguration.vignetteWeight;\r\n }\r\n /**\r\n * Sets Vignette weight or intensity of the vignette effect.\r\n */\r\n public set vignetteWeight(value: number) {\r\n this.imageProcessingConfiguration.vignetteWeight = value;\r\n }\r\n\r\n /**\r\n * Gets Color of the vignette applied on the screen through the chosen blend mode (vignetteBlendMode)\r\n * if vignetteEnabled is set to true.\r\n */\r\n public get vignetteColor(): Color4 {\r\n return this.imageProcessingConfiguration.vignetteColor;\r\n }\r\n /**\r\n * Sets Color of the vignette applied on the screen through the chosen blend mode (vignetteBlendMode)\r\n * if vignetteEnabled is set to true.\r\n */\r\n public set vignetteColor(value: Color4) {\r\n this.imageProcessingConfiguration.vignetteColor = value;\r\n }\r\n\r\n /**\r\n * Gets Camera field of view used by the Vignette effect.\r\n */\r\n public get vignetteCameraFov(): number {\r\n return this.imageProcessingConfiguration.vignetteCameraFov;\r\n }\r\n /**\r\n * Sets Camera field of view used by the Vignette effect.\r\n */\r\n public set vignetteCameraFov(value: number) {\r\n this.imageProcessingConfiguration.vignetteCameraFov = value;\r\n }\r\n\r\n /**\r\n * Gets the vignette blend mode allowing different kind of effect.\r\n */\r\n public get vignetteBlendMode(): number {\r\n return this.imageProcessingConfiguration.vignetteBlendMode;\r\n }\r\n /**\r\n * Sets the vignette blend mode allowing different kind of effect.\r\n */\r\n public set vignetteBlendMode(value: number) {\r\n this.imageProcessingConfiguration.vignetteBlendMode = value;\r\n }\r\n\r\n /**\r\n * Gets whether the vignette effect is enabled.\r\n */\r\n public get vignetteEnabled(): boolean {\r\n return this.imageProcessingConfiguration.vignetteEnabled;\r\n }\r\n /**\r\n * Sets whether the vignette effect is enabled.\r\n */\r\n public set vignetteEnabled(value: boolean) {\r\n this.imageProcessingConfiguration.vignetteEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets intensity of the dithering effect.\r\n */\r\n public get ditheringIntensity(): number {\r\n return this.imageProcessingConfiguration.ditheringIntensity;\r\n }\r\n /**\r\n * Sets intensity of the dithering effect.\r\n */\r\n public set ditheringIntensity(value: number) {\r\n this.imageProcessingConfiguration.ditheringIntensity = value;\r\n }\r\n\r\n /**\r\n * Gets whether the dithering effect is enabled.\r\n */\r\n public get ditheringEnabled(): boolean {\r\n return this.imageProcessingConfiguration.ditheringEnabled;\r\n }\r\n /**\r\n * Sets whether the dithering effect is enabled.\r\n */\r\n public set ditheringEnabled(value: boolean) {\r\n this.imageProcessingConfiguration.ditheringEnabled = value;\r\n }\r\n\r\n private _fromLinearSpace = true;\r\n /**\r\n * Gets whether the input of the processing is in Gamma or Linear Space.\r\n */\r\n public get fromLinearSpace(): boolean {\r\n return this._fromLinearSpace;\r\n }\r\n /**\r\n * Sets whether the input of the processing is in Gamma or Linear Space.\r\n */\r\n public set fromLinearSpace(value: boolean) {\r\n if (this._fromLinearSpace === value) {\r\n return;\r\n }\r\n\r\n this._fromLinearSpace = value;\r\n this._updateParameters();\r\n }\r\n\r\n /**\r\n * * Gets the width of the output texture used to store the result of the post process.\r\n */\r\n public get outputTextureWidth() {\r\n return this.imageProcessingConfiguration.outputTextureWidth;\r\n }\r\n\r\n /**\r\n * * Sets the width of the output texture used to store the result of the post process.\r\n */\r\n public set outputTextureWidth(value: number) {\r\n this.imageProcessingConfiguration.outputTextureWidth = value;\r\n }\r\n\r\n /**\r\n * * Gets the height of the output texture used to store the result of the post process.\r\n */\r\n public get outputTextureHeight() {\r\n return this.imageProcessingConfiguration.outputTextureHeight;\r\n }\r\n\r\n /**\r\n * * Sets the height of the output texture used to store the result of the post process.\r\n */\r\n public set outputTextureHeight(value: number) {\r\n this.imageProcessingConfiguration.outputTextureHeight = value;\r\n }\r\n\r\n /**\r\n * Gets/sets the aspect ratio used to override the default one.\r\n */\r\n public overrideAspectRatio?: number;\r\n\r\n /**\r\n * Defines cache preventing GC.\r\n */\r\n private _defines: IImageProcessingConfigurationDefines & { FROMLINEARSPACE: boolean } = {\r\n IMAGEPROCESSING: false,\r\n WHITEBALANCE: false,\r\n VIGNETTE: false,\r\n VIGNETTEBLENDMODEMULTIPLY: false,\r\n VIGNETTEBLENDMODEOPAQUE: false,\r\n TONEMAPPING: 0,\r\n CONTRAST: false,\r\n COLORCURVES: false,\r\n COLORGRADING: false,\r\n COLORGRADING3D: false,\r\n FROMLINEARSPACE: false,\r\n SAMPLER3DGREENDEPTH: false,\r\n SAMPLER3DBGRMAP: false,\r\n DITHER: false,\r\n IMAGEPROCESSINGPOSTPROCESS: false,\r\n EXPOSURE: false,\r\n SKIPFINALCOLORCLAMP: false,\r\n };\r\n\r\n public override readonly options: Required<NonNullableFields<ThinImageProcessingPostProcessOptions>>;\r\n\r\n /**\r\n * Constructs a new image processing 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?: ThinImageProcessingPostProcessOptions) {\r\n super({\r\n ...options,\r\n name,\r\n engine: engine || EngineStore.LastCreatedEngine!,\r\n useShaderStore: true,\r\n useAsPostProcess: true,\r\n fragmentShader: ThinImageProcessingPostProcess.FragmentUrl,\r\n });\r\n\r\n const imageProcessingConfiguration = options?.imageProcessingConfiguration;\r\n\r\n // Setup the configuration as forced by the constructor. This would then not force the\r\n // scene materials output in linear space and let untouched the default forward pass.\r\n if (imageProcessingConfiguration) {\r\n imageProcessingConfiguration.applyByPostProcess = true;\r\n this._attachImageProcessingConfiguration(imageProcessingConfiguration, true);\r\n _ApplyWhiteBalanceOptions(this.imageProcessingConfiguration, options);\r\n // This will cause the shader to be compiled\r\n this._updateParameters();\r\n }\r\n // Setup the default processing configuration to the scene.\r\n else {\r\n this._attachImageProcessingConfiguration(null, true);\r\n _ApplyWhiteBalanceOptions(this.imageProcessingConfiguration, options);\r\n this.imageProcessingConfiguration.applyByPostProcess = true;\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _updateParameters(): void {\r\n this._defines.FROMLINEARSPACE = this._fromLinearSpace;\r\n this.imageProcessingConfiguration.prepareDefines(this._defines, true);\r\n let defines = \"\";\r\n for (const prop in this._defines) {\r\n const value = (<any>this._defines)[prop];\r\n const type = typeof value;\r\n\r\n switch (type) {\r\n case \"number\":\r\n case \"string\":\r\n defines += `#define ${prop} ${value};\\n`;\r\n break;\r\n default:\r\n if (value) {\r\n defines += `#define ${prop};\\n`;\r\n }\r\n break;\r\n }\r\n }\r\n\r\n const samplers = [\"textureSampler\"];\r\n const uniforms = [\"scale\"];\r\n\r\n if (ImageProcessingConfiguration) {\r\n ImageProcessingConfiguration.PrepareSamplers(samplers, this._defines);\r\n ImageProcessingConfiguration.PrepareUniforms(uniforms, this._defines);\r\n }\r\n\r\n this.updateEffect(defines, uniforms, samplers);\r\n }\r\n\r\n public override bind(noDefaultBindings = false) {\r\n super.bind(noDefaultBindings);\r\n this.imageProcessingConfiguration.bind(this.effect, this.overrideAspectRatio);\r\n }\r\n\r\n public override dispose(): void {\r\n super.dispose();\r\n\r\n if (this._imageProcessingConfiguration && this._imageProcessingObserver) {\r\n this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver);\r\n }\r\n\r\n if (this._imageProcessingConfiguration) {\r\n this.imageProcessingConfiguration.applyByPostProcess = false;\r\n }\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** This file must only contain pure code and pure imports */
|
|
2
|
+
import { type Material } from "../../Materials/material.pure.js";
|
|
3
|
+
/**
|
|
4
|
+
* Determines whether a material can receive IBL shadows by hosting an `IBLShadowsPluginMaterial`.
|
|
5
|
+
*
|
|
6
|
+
* Shared by both the legacy `IblShadowsRenderPipeline` and the Frame Graph
|
|
7
|
+
* `FrameGraphIblShadowsRendererTask` so the two code paths cannot drift out of sync.
|
|
8
|
+
* @param material The material to test.
|
|
9
|
+
* @returns True if the material supports the IBL shadows plugin.
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export declare function IsIBLShadowsReceiverCompatible(material: Material): boolean;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** This file must only contain pure code and pure imports */
|
|
2
|
+
import { PBRBaseMaterial } from "../../Materials/PBR/pbrBaseMaterial.pure.js";
|
|
3
|
+
import { StandardMaterial } from "../../Materials/standardMaterial.pure.js";
|
|
4
|
+
import { OpenPBRMaterial } from "../../Materials/PBR/openpbrMaterial.pure.js";
|
|
5
|
+
/**
|
|
6
|
+
* Determines whether a material can receive IBL shadows by hosting an `IBLShadowsPluginMaterial`.
|
|
7
|
+
*
|
|
8
|
+
* Shared by both the legacy `IblShadowsRenderPipeline` and the Frame Graph
|
|
9
|
+
* `FrameGraphIblShadowsRendererTask` so the two code paths cannot drift out of sync.
|
|
10
|
+
* @param material The material to test.
|
|
11
|
+
* @returns True if the material supports the IBL shadows plugin.
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export function IsIBLShadowsReceiverCompatible(material) {
|
|
15
|
+
return (material instanceof PBRBaseMaterial ||
|
|
16
|
+
material instanceof StandardMaterial ||
|
|
17
|
+
material instanceof OpenPBRMaterial ||
|
|
18
|
+
// ShadowOnlyMaterial lives in the separate `materials` package (which `core` cannot import),
|
|
19
|
+
// so it is identified by class name rather than `instanceof`.
|
|
20
|
+
material.getClassName() === "ShadowOnlyMaterial");
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=iblShadowsMaterialCompatibility.pure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iblShadowsMaterialCompatibility.pure.js","sourceRoot":"","sources":["../../../../../dev/core/src/Rendering/IBLShadows/iblShadowsMaterialCompatibility.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAG7D,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAE1E;;;;;;;;GAQG;AACH,MAAM,UAAU,8BAA8B,CAAC,QAAkB;IAC7D,OAAO,CACH,QAAQ,YAAY,eAAe;QACnC,QAAQ,YAAY,gBAAgB;QACpC,QAAQ,YAAY,eAAe;QACnC,6FAA6F;QAC7F,8DAA8D;QAC9D,QAAQ,CAAC,YAAY,EAAE,KAAK,oBAAoB,CACnD,CAAC;AACN,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\n\nimport { type Material } from \"core/Materials/material.pure\";\nimport { PBRBaseMaterial } from \"core/Materials/PBR/pbrBaseMaterial.pure\";\nimport { StandardMaterial } from \"core/Materials/standardMaterial.pure\";\nimport { OpenPBRMaterial } from \"core/Materials/PBR/openpbrMaterial.pure\";\n\n/**\n * Determines whether a material can receive IBL shadows by hosting an `IBLShadowsPluginMaterial`.\n *\n * Shared by both the legacy `IblShadowsRenderPipeline` and the Frame Graph\n * `FrameGraphIblShadowsRendererTask` so the two code paths cannot drift out of sync.\n * @param material The material to test.\n * @returns True if the material supports the IBL shadows plugin.\n * @internal\n */\nexport function IsIBLShadowsReceiverCompatible(material: Material): boolean {\n return (\n material instanceof PBRBaseMaterial ||\n material instanceof StandardMaterial ||\n material instanceof OpenPBRMaterial ||\n // ShadowOnlyMaterial lives in the separate `materials` package (which `core` cannot import),\n // so it is identified by class name rather than `instanceof`.\n material.getClassName() === \"ShadowOnlyMaterial\"\n );\n}\n"]}
|
|
@@ -50,6 +50,7 @@ export declare class IBLShadowsPluginMaterial extends MaterialPluginBase {
|
|
|
50
50
|
isCompatible(): boolean;
|
|
51
51
|
constructor(material: Material | StandardMaterial | PBRBaseMaterial | OpenPBRMaterial);
|
|
52
52
|
private _isOpenPBRMaterial;
|
|
53
|
+
private _isShadowOnlyMaterial;
|
|
53
54
|
prepareDefines(defines: MaterialIBLShadowsRenderDefines): void;
|
|
54
55
|
getClassName(): string;
|
|
55
56
|
getUniforms(_shaderLanguage: ShaderLanguage): any;
|
|
@@ -80,6 +80,9 @@ let IBLShadowsPluginMaterial = (() => {
|
|
|
80
80
|
_isOpenPBRMaterial() {
|
|
81
81
|
return this._material.getClassName() === "OpenPBRMaterial";
|
|
82
82
|
}
|
|
83
|
+
_isShadowOnlyMaterial() {
|
|
84
|
+
return this._material.getClassName() === "ShadowOnlyMaterial";
|
|
85
|
+
}
|
|
83
86
|
prepareDefines(defines) {
|
|
84
87
|
defines.RENDER_WITH_IBL_SHADOWS = this._isEnabled;
|
|
85
88
|
defines.COLORED_IBL_SHADOWS = this.isColored;
|
|
@@ -197,6 +200,24 @@ let IBLShadowsPluginMaterial = (() => {
|
|
|
197
200
|
ambient_occlusion = min(ambient_occlusion, vec3f(computeIndirectShadow().x));
|
|
198
201
|
#endif
|
|
199
202
|
#endif
|
|
203
|
+
`;
|
|
204
|
+
}
|
|
205
|
+
else if (this._isShadowOnlyMaterial()) {
|
|
206
|
+
// ShadowOnlyMaterial encodes shadow strength in a single alpha channel via the `shadow`
|
|
207
|
+
// scalar, so modulate `shadow` directly rather than color.rgb (which is the -typically
|
|
208
|
+
// black- shadowColor). Because there is only one output channel, IBL shadows on this
|
|
209
|
+
// material are monochrome by contract: a colored shadow value is reduced to its Rec.709
|
|
210
|
+
// luminance rather than preserving per-channel hue (which an alpha-only catcher cannot do).
|
|
211
|
+
frag["CUSTOM_FRAGMENT_BEFORE_LIGHT_COMPOSITION"] = `
|
|
212
|
+
#ifdef RENDER_WITH_IBL_SHADOWS
|
|
213
|
+
#ifdef COLORED_IBL_SHADOWS
|
|
214
|
+
var shadowValue: vec3f = computeIndirectShadow();
|
|
215
|
+
shadow *= clamp(dot(shadowValue, vec3f(0.2126f, 0.7152f, 0.0722f)), 0.0f, 1.0f);
|
|
216
|
+
#else
|
|
217
|
+
var shadowValue: vec2f = computeIndirectShadow();
|
|
218
|
+
shadow *= clamp(shadowValue.x, 0.0f, 1.0f);
|
|
219
|
+
#endif
|
|
220
|
+
#endif
|
|
200
221
|
`;
|
|
201
222
|
}
|
|
202
223
|
else {
|
|
@@ -276,6 +297,24 @@ let IBLShadowsPluginMaterial = (() => {
|
|
|
276
297
|
ambient_occlusion = min(ambient_occlusion, vec3(computeIndirectShadow().x));
|
|
277
298
|
#endif
|
|
278
299
|
#endif
|
|
300
|
+
`;
|
|
301
|
+
}
|
|
302
|
+
else if (this._isShadowOnlyMaterial()) {
|
|
303
|
+
// ShadowOnlyMaterial encodes shadow strength in a single alpha channel via the `shadow`
|
|
304
|
+
// scalar, so modulate `shadow` directly rather than color.rgb (which is the -typically
|
|
305
|
+
// black- shadowColor). Because there is only one output channel, IBL shadows on this
|
|
306
|
+
// material are monochrome by contract: a colored shadow value is reduced to its Rec.709
|
|
307
|
+
// luminance rather than preserving per-channel hue (which an alpha-only catcher cannot do).
|
|
308
|
+
frag["CUSTOM_FRAGMENT_BEFORE_LIGHT_COMPOSITION"] = `
|
|
309
|
+
#ifdef RENDER_WITH_IBL_SHADOWS
|
|
310
|
+
#ifdef COLORED_IBL_SHADOWS
|
|
311
|
+
vec3 shadowValue = computeIndirectShadow();
|
|
312
|
+
shadow *= clamp(dot(shadowValue, vec3(0.2126, 0.7152, 0.0722)), 0.0, 1.0);
|
|
313
|
+
#else
|
|
314
|
+
vec2 shadowValue = computeIndirectShadow();
|
|
315
|
+
shadow *= clamp(shadowValue.x, 0.0, 1.0);
|
|
316
|
+
#endif
|
|
317
|
+
#endif
|
|
279
318
|
`;
|
|
280
319
|
}
|
|
281
320
|
else {
|