@babylonjs/core 8.1.0 → 8.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AudioV2/abstractAudio/abstractSound.js +1 -1
- package/AudioV2/abstractAudio/abstractSound.js.map +1 -1
- package/Culling/Helper/boundingInfoHelper.js +9 -1
- package/Culling/Helper/boundingInfoHelper.js.map +1 -1
- package/Culling/ray.core.d.ts +1 -1
- package/Culling/ray.core.js +1 -1
- package/Culling/ray.core.js.map +1 -1
- package/Debug/debugLayer.js +8 -1
- package/Debug/debugLayer.js.map +1 -1
- package/Debug/physicsViewer.d.ts +4 -1
- package/Debug/physicsViewer.js +13 -5
- package/Debug/physicsViewer.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/imageProcessingPostProcessBlock.d.ts +71 -0
- package/FrameGraph/Node/Blocks/PostProcesses/imageProcessingPostProcessBlock.js +246 -0
- package/FrameGraph/Node/Blocks/PostProcesses/imageProcessingPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.d.ts +1 -1
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +4 -4
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/index.d.ts +1 -0
- package/FrameGraph/Node/Blocks/index.js +1 -0
- package/FrameGraph/Node/Blocks/index.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/imageProcessingTask.d.ts +17 -0
- package/FrameGraph/Tasks/PostProcesses/imageProcessingTask.js +23 -0
- package/FrameGraph/Tasks/PostProcesses/imageProcessingTask.js.map +1 -0
- package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +3 -2
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js +5 -4
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js +1 -1
- package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js.map +1 -1
- package/FrameGraph/index.d.ts +1 -0
- package/FrameGraph/index.js +1 -0
- package/FrameGraph/index.js.map +1 -1
- package/Materials/Node/Blocks/Dual/lightBlock.js +6 -3
- package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +4 -2
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.js +2 -1
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/PBR/pbrSubSurfaceConfiguration.d.ts +13 -0
- package/Materials/PBR/pbrSubSurfaceConfiguration.js +17 -0
- package/Materials/PBR/pbrSubSurfaceConfiguration.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.d.ts +4 -3
- package/Materials/Textures/renderTargetTexture.js +6 -5
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/Textures/texture.js +3 -2
- package/Materials/Textures/texture.js.map +1 -1
- package/Materials/effectRenderer.d.ts +2 -1
- package/Materials/effectRenderer.js +3 -2
- package/Materials/effectRenderer.js.map +1 -1
- package/Materials/imageProcessingConfiguration.d.ts +8 -0
- package/Materials/imageProcessingConfiguration.js +16 -2
- package/Materials/imageProcessingConfiguration.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +15 -6
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
- package/Misc/fileTools.d.ts +6 -0
- package/Misc/fileTools.js +30 -0
- package/Misc/fileTools.js.map +1 -1
- package/Physics/v2/characterController.d.ts +5 -0
- package/Physics/v2/characterController.js +7 -0
- package/Physics/v2/characterController.js.map +1 -1
- package/PostProcesses/imageProcessingPostProcess.d.ts +4 -21
- package/PostProcesses/imageProcessingPostProcess.js +27 -138
- package/PostProcesses/imageProcessingPostProcess.js.map +1 -1
- package/PostProcesses/index.d.ts +1 -0
- package/PostProcesses/index.js +1 -0
- package/PostProcesses/index.js.map +1 -1
- package/PostProcesses/postProcess.js +2 -1
- package/PostProcesses/postProcess.js.map +1 -1
- package/PostProcesses/thinBlackAndWhitePostProcess.d.ts +1 -1
- package/PostProcesses/thinBlackAndWhitePostProcess.js +2 -2
- package/PostProcesses/thinBlackAndWhitePostProcess.js.map +1 -1
- package/PostProcesses/thinBloomMergePostProcess.d.ts +1 -1
- package/PostProcesses/thinBloomMergePostProcess.js +2 -2
- package/PostProcesses/thinBloomMergePostProcess.js.map +1 -1
- package/PostProcesses/thinBlurPostProcess.d.ts +1 -1
- package/PostProcesses/thinBlurPostProcess.js +2 -2
- package/PostProcesses/thinBlurPostProcess.js.map +1 -1
- package/PostProcesses/thinChromaticAberrationPostProcess.d.ts +3 -3
- package/PostProcesses/thinChromaticAberrationPostProcess.js +2 -2
- package/PostProcesses/thinChromaticAberrationPostProcess.js.map +1 -1
- package/PostProcesses/thinCircleOfConfusionPostProcess.d.ts +1 -1
- package/PostProcesses/thinCircleOfConfusionPostProcess.js +2 -2
- package/PostProcesses/thinCircleOfConfusionPostProcess.js.map +1 -1
- package/PostProcesses/thinExtractHighlightsPostProcess.d.ts +1 -1
- package/PostProcesses/thinExtractHighlightsPostProcess.js +2 -2
- package/PostProcesses/thinExtractHighlightsPostProcess.js.map +1 -1
- package/PostProcesses/thinImageProcessingPostProcess.d.ts +258 -0
- package/PostProcesses/thinImageProcessingPostProcess.js +462 -0
- package/PostProcesses/thinImageProcessingPostProcess.js.map +1 -0
- package/PostProcesses/thinSSRBlurCombinerPostProcess.d.ts +1 -1
- package/PostProcesses/thinSSRBlurCombinerPostProcess.js +2 -2
- package/PostProcesses/thinSSRBlurCombinerPostProcess.js.map +1 -1
- package/PostProcesses/thinSSRBlurPostProcess.d.ts +1 -1
- package/PostProcesses/thinSSRBlurPostProcess.js +2 -2
- package/PostProcesses/thinSSRBlurPostProcess.js.map +1 -1
- package/PostProcesses/thinSSRPostProcess.d.ts +1 -1
- package/PostProcesses/thinSSRPostProcess.js +2 -2
- package/PostProcesses/thinSSRPostProcess.js.map +1 -1
- package/PostProcesses/thinTAAPostProcess.d.ts +1 -1
- package/PostProcesses/thinTAAPostProcess.js +2 -2
- package/PostProcesses/thinTAAPostProcess.js.map +1 -1
- package/Rendering/objectRenderer.d.ts +5 -5
- package/Rendering/objectRenderer.js +11 -11
- package/Rendering/objectRenderer.js.map +1 -1
- package/Shaders/ShadersInclude/lightFragment.js +10 -7
- package/Shaders/ShadersInclude/lightFragment.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBRDFFunctions.js +5 -1
- package/Shaders/ShadersInclude/pbrBRDFFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockDirectLighting.js +1 -1
- package/Shaders/ShadersInclude/pbrBlockDirectLighting.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockFinalUnlitComponents.js +1 -1
- package/Shaders/ShadersInclude/pbrBlockFinalUnlitComponents.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockReflectance.js +1 -1
- package/Shaders/ShadersInclude/pbrBlockReflectance.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockReflectivity.js +2 -2
- package/Shaders/ShadersInclude/pbrBlockReflectivity.js.map +1 -1
- package/Shaders/ShadersInclude/pbrDirectLightingFunctions.js +16 -4
- package/Shaders/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
- package/Shaders/gaussianSplatting.vertex.js +1 -1
- package/Shaders/gaussianSplatting.vertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/lightFragment.js +10 -7
- package/ShadersWGSL/ShadersInclude/lightFragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBRDFFunctions.js +5 -1
- package/ShadersWGSL/ShadersInclude/pbrBRDFFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockDirectLighting.js +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockDirectLighting.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockFinalUnlitComponents.js +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockFinalUnlitComponents.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockReflectance.js +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockReflectance.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockReflectivity.js +2 -2
- package/ShadersWGSL/ShadersInclude/pbrBlockReflectivity.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js +24 -8
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
- package/ShadersWGSL/gaussianSplatting.vertex.d.ts +1 -0
- package/ShadersWGSL/gaussianSplatting.vertex.js +4 -1
- package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,19 +3,17 @@ import type { Color4 } from "../Maths/math.color";
|
|
|
3
3
|
import type { Camera } from "../Cameras/camera";
|
|
4
4
|
import type { BaseTexture } from "../Materials/Textures/baseTexture";
|
|
5
5
|
import type { ColorCurves } from "../Materials/colorCurves";
|
|
6
|
-
import { ImageProcessingConfiguration } from "../Materials/imageProcessingConfiguration";
|
|
6
|
+
import type { ImageProcessingConfiguration } from "../Materials/imageProcessingConfiguration";
|
|
7
7
|
import type { PostProcessOptions } from "./postProcess";
|
|
8
8
|
import { PostProcess } from "./postProcess";
|
|
9
9
|
import type { AbstractEngine } from "../Engines/abstractEngine";
|
|
10
|
+
import { ThinImageProcessingPostProcess } from "./thinImageProcessingPostProcess";
|
|
10
11
|
/**
|
|
11
12
|
* ImageProcessingPostProcess
|
|
12
13
|
* @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses#imageprocessing
|
|
13
14
|
*/
|
|
14
15
|
export declare class ImageProcessingPostProcess extends PostProcess {
|
|
15
|
-
|
|
16
|
-
* Default configuration related to image processing available in the PBR Material.
|
|
17
|
-
*/
|
|
18
|
-
protected _imageProcessingConfiguration: ImageProcessingConfiguration;
|
|
16
|
+
protected get _imageProcessingConfiguration(): ImageProcessingConfiguration;
|
|
19
17
|
/**
|
|
20
18
|
* Gets the image processing configuration used either in this material.
|
|
21
19
|
*/
|
|
@@ -26,16 +24,6 @@ export declare class ImageProcessingPostProcess extends PostProcess {
|
|
|
26
24
|
* If sets to null, the scene one is in use.
|
|
27
25
|
*/
|
|
28
26
|
set imageProcessingConfiguration(value: ImageProcessingConfiguration);
|
|
29
|
-
/**
|
|
30
|
-
* Keep track of the image processing observer to allow dispose and replace.
|
|
31
|
-
*/
|
|
32
|
-
private _imageProcessingObserver;
|
|
33
|
-
/**
|
|
34
|
-
* Attaches a new image processing configuration to the PBR Material.
|
|
35
|
-
* @param configuration
|
|
36
|
-
* @param doNotBuild
|
|
37
|
-
*/
|
|
38
|
-
protected _attachImageProcessingConfiguration(configuration: Nullable<ImageProcessingConfiguration>, doNotBuild?: boolean): void;
|
|
39
27
|
/**
|
|
40
28
|
* If the post process is supported.
|
|
41
29
|
*/
|
|
@@ -200,7 +188,6 @@ export declare class ImageProcessingPostProcess extends PostProcess {
|
|
|
200
188
|
* Sets whether the dithering effect is enabled.
|
|
201
189
|
*/
|
|
202
190
|
set ditheringEnabled(value: boolean);
|
|
203
|
-
private _fromLinearSpace;
|
|
204
191
|
/**
|
|
205
192
|
* Gets whether the input of the processing is in Gamma or Linear Space.
|
|
206
193
|
*/
|
|
@@ -209,12 +196,8 @@ export declare class ImageProcessingPostProcess extends PostProcess {
|
|
|
209
196
|
* Sets whether the input of the processing is in Gamma or Linear Space.
|
|
210
197
|
*/
|
|
211
198
|
set fromLinearSpace(value: boolean);
|
|
212
|
-
|
|
213
|
-
* Defines cache preventing GC.
|
|
214
|
-
*/
|
|
215
|
-
private _defines;
|
|
199
|
+
protected _effectWrapper: ThinImageProcessingPostProcess;
|
|
216
200
|
constructor(name: string, options: number | PostProcessOptions, camera?: Nullable<Camera>, samplingMode?: number, engine?: AbstractEngine, reusable?: boolean, textureType?: number, imageProcessingConfiguration?: ImageProcessingConfiguration);
|
|
217
|
-
protected _gatherImports(useWebGPU: boolean, list: Promise<any>[]): void;
|
|
218
201
|
/**
|
|
219
202
|
* "ImageProcessingPostProcess"
|
|
220
203
|
* @returns "ImageProcessingPostProcess"
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { __decorate } from "../tslib.es6.js";
|
|
2
2
|
import { serialize } from "../Misc/decorators.js";
|
|
3
|
-
import { ImageProcessingConfiguration } from "../Materials/imageProcessingConfiguration.js";
|
|
4
3
|
import { PostProcess } from "./postProcess.js";
|
|
5
|
-
import { EngineStore } from "../Engines/engineStore.js";
|
|
6
4
|
|
|
5
|
+
import { ThinImageProcessingPostProcess } from "./thinImageProcessingPostProcess.js";
|
|
7
6
|
/**
|
|
8
7
|
* ImageProcessingPostProcess
|
|
9
8
|
* @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses#imageprocessing
|
|
10
9
|
*/
|
|
11
10
|
export class ImageProcessingPostProcess extends PostProcess {
|
|
11
|
+
get _imageProcessingConfiguration() {
|
|
12
|
+
return this._effectWrapper.imageProcessingConfiguration;
|
|
13
|
+
}
|
|
12
14
|
/**
|
|
13
15
|
* Gets the image processing configuration used either in this material.
|
|
14
16
|
*/
|
|
15
17
|
get imageProcessingConfiguration() {
|
|
16
|
-
return this.
|
|
18
|
+
return this._effectWrapper.imageProcessingConfiguration;
|
|
17
19
|
}
|
|
18
20
|
/**
|
|
19
21
|
* Sets the Default image processing configuration used either in the this material.
|
|
@@ -21,59 +23,7 @@ export class ImageProcessingPostProcess extends PostProcess {
|
|
|
21
23
|
* If sets to null, the scene one is in use.
|
|
22
24
|
*/
|
|
23
25
|
set imageProcessingConfiguration(value) {
|
|
24
|
-
|
|
25
|
-
// We are in the post process :-)
|
|
26
|
-
value.applyByPostProcess = true;
|
|
27
|
-
this._attachImageProcessingConfiguration(value);
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Attaches a new image processing configuration to the PBR Material.
|
|
31
|
-
* @param configuration
|
|
32
|
-
* @param doNotBuild
|
|
33
|
-
*/
|
|
34
|
-
_attachImageProcessingConfiguration(configuration, doNotBuild = false) {
|
|
35
|
-
if (configuration === this._imageProcessingConfiguration) {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
// Detaches observer.
|
|
39
|
-
if (this._imageProcessingConfiguration && this._imageProcessingObserver) {
|
|
40
|
-
this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver);
|
|
41
|
-
}
|
|
42
|
-
// Pick the scene configuration if needed.
|
|
43
|
-
if (!configuration) {
|
|
44
|
-
let scene = null;
|
|
45
|
-
const engine = this.getEngine();
|
|
46
|
-
const camera = this.getCamera();
|
|
47
|
-
if (camera) {
|
|
48
|
-
scene = camera.getScene();
|
|
49
|
-
}
|
|
50
|
-
else if (engine && engine.scenes) {
|
|
51
|
-
const scenes = engine.scenes;
|
|
52
|
-
scene = scenes[scenes.length - 1];
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
scene = EngineStore.LastCreatedScene;
|
|
56
|
-
}
|
|
57
|
-
if (scene) {
|
|
58
|
-
this._imageProcessingConfiguration = scene.imageProcessingConfiguration;
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
this._imageProcessingConfiguration = new ImageProcessingConfiguration();
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
this._imageProcessingConfiguration = configuration;
|
|
66
|
-
}
|
|
67
|
-
// Attaches observer.
|
|
68
|
-
if (this._imageProcessingConfiguration) {
|
|
69
|
-
this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(() => {
|
|
70
|
-
this._updateParameters();
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
// Ensure the effect will be rebuilt.
|
|
74
|
-
if (!doNotBuild) {
|
|
75
|
-
this._updateParameters();
|
|
76
|
-
}
|
|
26
|
+
this._effectWrapper.imageProcessingConfiguration = value;
|
|
77
27
|
}
|
|
78
28
|
/**
|
|
79
29
|
* If the post process is supported.
|
|
@@ -326,69 +276,35 @@ export class ImageProcessingPostProcess extends PostProcess {
|
|
|
326
276
|
* Gets whether the input of the processing is in Gamma or Linear Space.
|
|
327
277
|
*/
|
|
328
278
|
get fromLinearSpace() {
|
|
329
|
-
return this.
|
|
279
|
+
return this._effectWrapper.fromLinearSpace;
|
|
330
280
|
}
|
|
331
281
|
/**
|
|
332
282
|
* Sets whether the input of the processing is in Gamma or Linear Space.
|
|
333
283
|
*/
|
|
334
284
|
set fromLinearSpace(value) {
|
|
335
|
-
|
|
336
|
-
return;
|
|
337
|
-
}
|
|
338
|
-
this._fromLinearSpace = value;
|
|
339
|
-
this._updateParameters();
|
|
285
|
+
this._effectWrapper.fromLinearSpace = value;
|
|
340
286
|
}
|
|
341
287
|
constructor(name, options, camera = null, samplingMode, engine, reusable, textureType = 0, imageProcessingConfiguration) {
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
CONTRAST: false,
|
|
354
|
-
COLORCURVES: false,
|
|
355
|
-
COLORGRADING: false,
|
|
356
|
-
COLORGRADING3D: false,
|
|
357
|
-
FROMLINEARSPACE: false,
|
|
358
|
-
SAMPLER3DGREENDEPTH: false,
|
|
359
|
-
SAMPLER3DBGRMAP: false,
|
|
360
|
-
DITHER: false,
|
|
361
|
-
IMAGEPROCESSINGPOSTPROCESS: false,
|
|
362
|
-
EXPOSURE: false,
|
|
363
|
-
SKIPFINALCOLORCLAMP: false,
|
|
288
|
+
const localOptions = {
|
|
289
|
+
size: typeof options === "number" ? options : undefined,
|
|
290
|
+
camera,
|
|
291
|
+
samplingMode,
|
|
292
|
+
engine,
|
|
293
|
+
reusable,
|
|
294
|
+
textureType,
|
|
295
|
+
imageProcessingConfiguration,
|
|
296
|
+
scene: camera?.getScene(),
|
|
297
|
+
...options,
|
|
298
|
+
blockCompilation: true,
|
|
364
299
|
};
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
this._updateParameters();
|
|
372
|
-
}
|
|
373
|
-
// Setup the default processing configuration to the scene.
|
|
374
|
-
else {
|
|
375
|
-
this._attachImageProcessingConfiguration(null, true);
|
|
376
|
-
this.imageProcessingConfiguration.applyByPostProcess = true;
|
|
377
|
-
}
|
|
378
|
-
this.onApply = (effect) => {
|
|
379
|
-
this.imageProcessingConfiguration.bind(effect, this.aspectRatio);
|
|
300
|
+
super(name, ThinImageProcessingPostProcess.FragmentUrl, {
|
|
301
|
+
effectWrapper: typeof options === "number" || !options.effectWrapper ? new ThinImageProcessingPostProcess(name, engine, localOptions) : undefined,
|
|
302
|
+
...localOptions,
|
|
303
|
+
});
|
|
304
|
+
this.onApply = () => {
|
|
305
|
+
this._effectWrapper.overrideAspectRatio = this.aspectRatio;
|
|
380
306
|
};
|
|
381
307
|
}
|
|
382
|
-
_gatherImports(useWebGPU, list) {
|
|
383
|
-
if (useWebGPU) {
|
|
384
|
-
this._webGPUReady = true;
|
|
385
|
-
list.push(import("../ShadersWGSL/imageProcessing.fragment.js"));
|
|
386
|
-
}
|
|
387
|
-
else {
|
|
388
|
-
list.push(import("../Shaders/imageProcessing.fragment.js"));
|
|
389
|
-
}
|
|
390
|
-
super._gatherImports(useWebGPU, list);
|
|
391
|
-
}
|
|
392
308
|
/**
|
|
393
309
|
* "ImageProcessingPostProcess"
|
|
394
310
|
* @returns "ImageProcessingPostProcess"
|
|
@@ -400,37 +316,10 @@ export class ImageProcessingPostProcess extends PostProcess {
|
|
|
400
316
|
* @internal
|
|
401
317
|
*/
|
|
402
318
|
_updateParameters() {
|
|
403
|
-
this.
|
|
404
|
-
this.imageProcessingConfiguration.prepareDefines(this._defines, true);
|
|
405
|
-
let defines = "";
|
|
406
|
-
for (const prop in this._defines) {
|
|
407
|
-
const value = this._defines[prop];
|
|
408
|
-
const type = typeof value;
|
|
409
|
-
switch (type) {
|
|
410
|
-
case "number":
|
|
411
|
-
case "string":
|
|
412
|
-
defines += `#define ${prop} ${value};\n`;
|
|
413
|
-
break;
|
|
414
|
-
default:
|
|
415
|
-
if (value) {
|
|
416
|
-
defines += `#define ${prop};\n`;
|
|
417
|
-
}
|
|
418
|
-
break;
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
const samplers = ["textureSampler"];
|
|
422
|
-
const uniforms = ["scale"];
|
|
423
|
-
if (ImageProcessingConfiguration) {
|
|
424
|
-
ImageProcessingConfiguration.PrepareSamplers(samplers, this._defines);
|
|
425
|
-
ImageProcessingConfiguration.PrepareUniforms(uniforms, this._defines);
|
|
426
|
-
}
|
|
427
|
-
this.updateEffect(defines, uniforms, samplers);
|
|
319
|
+
this._effectWrapper._updateParameters();
|
|
428
320
|
}
|
|
429
321
|
dispose(camera) {
|
|
430
322
|
super.dispose(camera);
|
|
431
|
-
if (this._imageProcessingConfiguration && this._imageProcessingObserver) {
|
|
432
|
-
this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver);
|
|
433
|
-
}
|
|
434
323
|
if (this._imageProcessingConfiguration) {
|
|
435
324
|
this.imageProcessingConfiguration.applyByPostProcess = false;
|
|
436
325
|
}
|
|
@@ -438,5 +327,5 @@ export class ImageProcessingPostProcess extends PostProcess {
|
|
|
438
327
|
}
|
|
439
328
|
__decorate([
|
|
440
329
|
serialize()
|
|
441
|
-
], ImageProcessingPostProcess.prototype, "
|
|
330
|
+
], ImageProcessingPostProcess.prototype, "fromLinearSpace", null);
|
|
442
331
|
//# sourceMappingURL=imageProcessingPostProcess.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imageProcessingPostProcess.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/imageProcessingPostProcess.ts"],"names":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;QACjE,CAAC;IACL,CAAC;CACJ;AAzIW;IADP,SAAS,EAAE;oEACoB","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport type { Nullable } from \"../types\";\r\nimport type { Observer } from \"../Misc/observable\";\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 { Effect } from \"../Materials/effect\";\r\nimport type { ColorCurves } from \"../Materials/colorCurves\";\r\nimport type { IImageProcessingConfigurationDefines } from \"../Materials/imageProcessingConfiguration.defines\";\r\nimport { ImageProcessingConfiguration } from \"../Materials/imageProcessingConfiguration\";\r\nimport type { PostProcessOptions } from \"./postProcess\";\r\nimport { PostProcess } from \"./postProcess\";\r\nimport type { AbstractEngine } from \"../Engines/abstractEngine\";\r\nimport { EngineStore } from \"../Engines/engineStore\";\r\nimport { Constants } from \"../Engines/constants\";\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 /**\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 = null;\r\n const engine = this.getEngine();\r\n const camera = this.getCamera();\r\n\r\n if (camera) {\r\n scene = camera.getScene();\r\n } else 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 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 * 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 @serialize()\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 * 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 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 super(name, \"imageProcessing\", [], [], options, camera, samplingMode, engine, reusable, null, textureType, \"postprocess\", null, true);\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 this.onApply = (effect: Effect) => {\r\n this.imageProcessingConfiguration.bind(effect, this.aspectRatio);\r\n };\r\n }\r\n\r\n protected override _gatherImports(useWebGPU: boolean, list: Promise<any>[]) {\r\n if (useWebGPU) {\r\n this._webGPUReady = true;\r\n list.push(import(\"../ShadersWGSL/imageProcessing.fragment\"));\r\n } else {\r\n list.push(import(\"../Shaders/imageProcessing.fragment\"));\r\n }\r\n\r\n super._gatherImports(useWebGPU, list);\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._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 dispose(camera?: Camera): void {\r\n super.dispose(camera);\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":"imageProcessingPostProcess.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/imageProcessingPostProcess.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAO/C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAElF;;;GAGG;AACH,MAAM,OAAO,0BAA2B,SAAQ,WAAW;IACvD,IAAc,6BAA6B;QACvC,OAAO,IAAI,CAAC,cAAc,CAAC,4BAA4B,CAAC;IAC5D,CAAC;IAED;;OAEG;IACH,IAAW,4BAA4B;QACnC,OAAO,IAAI,CAAC,cAAc,CAAC,4BAA4B,CAAC;IAC5D,CAAC;IAED;;;;OAIG;IACH,IAAW,4BAA4B,CAAC,KAAmC;QACvE,IAAI,CAAC,cAAc,CAAC,4BAA4B,GAAG,KAAK,CAAC;IAC7D,CAAC;IAED;;OAEG;IACH,IAAoB,WAAW;QAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QAChC,OAAO,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Aa,CAAC,CAAC,CAAC,IAAI,8BAA8B,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,SAAS;YACjJ,GAAG,YAAY;SAClB,CAAC,CAAC;QAEH,IAAI,CAAC,OAAO,GAAG,GAAG,EAAE;YAChB,IAAI,CAAC,cAAc,CAAC,mBAAmB,GAAG,IAAI,CAAC,WAAW,CAAC;QAC/D,CAAC,CAAC;IACN,CAAC;IAED;;;OAGG;IACa,YAAY;QACxB,OAAO,4BAA4B,CAAC;IACxC,CAAC;IAED;;OAEG;IACI,iBAAiB;QACpB,IAAI,CAAC,cAAc,CAAC,iBAAiB,EAAE,CAAC;IAC5C,CAAC;IACe,OAAO,CAAC,MAAe;QACnC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAEtB,IAAI,IAAI,CAAC,6BAA6B,EAAE,CAAC;YACrC,IAAI,CAAC,4BAA4B,CAAC,kBAAkB,GAAG,KAAK,CAAC;QACjE,CAAC;IACL,CAAC;CACJ;AAlEG;IADC,SAAS,EAAE;iEAGX","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 } from \"./postProcess\";\r\nimport { PostProcess } from \"./postProcess\";\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 protected override _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"]}
|
package/PostProcesses/index.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ export * from "./thinChromaticAberrationPostProcess";
|
|
|
39
39
|
export * from "./thinCircleOfConfusionPostProcess";
|
|
40
40
|
export * from "./thinDepthOfFieldEffect";
|
|
41
41
|
export * from "./thinExtractHighlightsPostProcess";
|
|
42
|
+
export * from "./thinImageProcessingPostProcess";
|
|
42
43
|
export * from "./thinPassPostProcess";
|
|
43
44
|
export * from "../Shaders/postprocess.vertex";
|
|
44
45
|
export * from "../ShadersWGSL/postprocess.vertex";
|
package/PostProcesses/index.js
CHANGED
|
@@ -40,6 +40,7 @@ export * from "./thinChromaticAberrationPostProcess.js";
|
|
|
40
40
|
export * from "./thinCircleOfConfusionPostProcess.js";
|
|
41
41
|
export * from "./thinDepthOfFieldEffect.js";
|
|
42
42
|
export * from "./thinExtractHighlightsPostProcess.js";
|
|
43
|
+
export * from "./thinImageProcessingPostProcess.js";
|
|
43
44
|
export * from "./thinPassPostProcess.js";
|
|
44
45
|
// Postprocess
|
|
45
46
|
export * from "../Shaders/postprocess.vertex.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,c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,2CAA2C,CAAC;AAE1D,sBAAsB;AACtB,cAAc,uCAAuC,CAAC;AACtD,cAAc,2CAA2C,CAAC;AAE1D,QAAQ;AACR,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AAEnD,qBAAqB;AACrB,cAAc,uCAAuC,CAAC;AACtD,cAAc,2CAA2C,CAAC;AAE1D,OAAO;AACP,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAE3C,MAAM;AACN,cAAc,mCAAmC,CAAC;AAClD,cAAc,uCAAuC,CAAC;AAEtD,WAAW;AACX,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AAEjD,cAAc;AACd,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AAEpD,mBAAmB;AACnB,cAAc,qCAAqC,CAAC;AACpD,cAAc,yCAAyC,CAAC;AAExD,cAAc;AACd,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AAEnD,SAAS;AACT,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAE/C,aAAa;AACb,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AAEnD,UAAU;AACV,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AAEpD,UAAU;AACV,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nexport * from \"./anaglyphPostProcess\";\r\nexport * from \"./blackAndWhitePostProcess\";\r\nexport * from \"./bloomEffect\";\r\nexport * from \"./bloomMergePostProcess\";\r\nexport * from \"./blurPostProcess\";\r\nexport * from \"./chromaticAberrationPostProcess\";\r\nexport * from \"./circleOfConfusionPostProcess\";\r\nexport * from \"./colorCorrectionPostProcess\";\r\nexport * from \"./convolutionPostProcess\";\r\nexport * from \"./depthOfFieldBlurPostProcess\";\r\nexport * from \"./depthOfFieldEffect\";\r\nexport * from \"./depthOfFieldMergePostProcess\";\r\nexport * from \"./displayPassPostProcess\";\r\nexport * from \"./extractHighlightsPostProcess\";\r\nexport * from \"./filterPostProcess\";\r\nexport * from \"./fxaaPostProcess\";\r\nexport * from \"./grainPostProcess\";\r\nexport * from \"./highlightsPostProcess\";\r\nexport * from \"./imageProcessingPostProcess\";\r\nexport * from \"./motionBlurPostProcess\";\r\nexport * from \"./passPostProcess\";\r\nexport * from \"./postProcess\";\r\nexport * from \"./postProcessManager\";\r\nexport * from \"./refractionPostProcess\";\r\nexport * from \"./RenderPipeline/index\";\r\nexport * from \"./sharpenPostProcess\";\r\nexport * from \"./stereoscopicInterlacePostProcess\";\r\nexport * from \"./tonemapPostProcess\";\r\nexport * from \"./volumetricLightScatteringPostProcess\";\r\nexport * from \"./vrDistortionCorrectionPostProcess\";\r\nexport * from \"./vrMultiviewToSingleviewPostProcess\";\r\nexport * from \"./screenSpaceReflectionPostProcess\";\r\nexport * from \"./screenSpaceCurvaturePostProcess\";\r\n\r\nexport * from \"./thinAnaglyphPostProcess\";\r\nexport * from \"./thinBlackAndWhitePostProcess\";\r\nexport * from \"./thinBloomEffect\";\r\nexport * from \"./thinBlurPostProcess\";\r\nexport * from \"./thinChromaticAberrationPostProcess\";\r\nexport * from \"./thinCircleOfConfusionPostProcess\";\r\nexport * from \"./thinDepthOfFieldEffect\";\r\nexport * from \"./thinExtractHighlightsPostProcess\";\r\nexport * from \"./thinPassPostProcess\";\r\n\r\n// Postprocess\r\nexport * from \"../Shaders/postprocess.vertex\";\r\nexport * from \"../ShadersWGSL/postprocess.vertex\";\r\n\r\n// Blur postprocess\r\nexport * from \"../Shaders/kernelBlur.fragment\";\r\nexport * from \"../Shaders/kernelBlur.vertex\";\r\nexport * from \"../ShadersWGSL/kernelBlur.fragment\";\r\nexport * from \"../ShadersWGSL/kernelBlur.vertex\";\r\n\r\n// Pass postprocess\r\nexport * from \"../Shaders/pass.fragment\";\r\nexport * from \"../Shaders/passCube.fragment\";\r\nexport * from \"../ShadersWGSL/pass.fragment\";\r\nexport * from \"../ShadersWGSL/passCube.fragment\";\r\n\r\n// vrDFistortionCorrection postprocess\r\nexport * from \"../Shaders/vrDistortionCorrection.fragment\";\r\nexport * from \"../ShadersWGSL/vrDistortionCorrection.fragment\";\r\n\r\n// Image processing postprocess\r\nexport * from \"../ShadersWGSL/imageProcessing.fragment\";\r\nexport * from \"../Shaders/imageProcessing.fragment\";\r\n\r\n// Sharpen\r\nexport * from \"../Shaders/sharpen.fragment\";\r\nexport * from \"../ShadersWGSL/sharpen.fragment\";\r\n\r\n// Grain\r\nexport * from \"../Shaders/grain.fragment\";\r\nexport * from \"../ShadersWGSL/grain.fragment\";\r\n\r\n// Chromatic Aberration\r\nexport * from \"../Shaders/chromaticAberration.fragment\";\r\nexport * from \"../ShadersWGSL/chromaticAberration.fragment\";\r\n\r\n// Depth of field merge\r\nexport * from \"../Shaders/depthOfFieldMerge.fragment\";\r\nexport * from \"../ShadersWGSL/depthOfFieldMerge.fragment\";\r\n\r\n// Circle of confusion\r\nexport * from \"../Shaders/circleOfConfusion.fragment\";\r\nexport * from \"../ShadersWGSL/circleOfConfusion.fragment\";\r\n\r\n// Bloom\r\nexport * from \"../Shaders/bloomMerge.fragment\";\r\nexport * from \"../ShadersWGSL/bloomMerge.fragment\";\r\n\r\n// Extract highlights\r\nexport * from \"../Shaders/extractHighlights.fragment\";\r\nexport * from \"../ShadersWGSL/extractHighlights.fragment\";\r\n\r\n// FXAA\r\nexport * from \"../Shaders/fxaa.fragment\";\r\nexport * from \"../Shaders/fxaa.vertex\";\r\nexport * from \"../ShadersWGSL/fxaa.fragment\";\r\nexport * from \"../ShadersWGSL/fxaa.vertex\";\r\n\r\n// B&W\r\nexport * from \"../Shaders/blackAndWhite.fragment\";\r\nexport * from \"../ShadersWGSL/blackAndWhite.fragment\";\r\n\r\n// Anaglyph\r\nexport * from \"../Shaders/anaglyph.fragment\";\r\nexport * from \"../ShadersWGSL/anaglyph.fragment\";\r\n\r\n// Convolution\r\nexport * from \"../Shaders/convolution.fragment\";\r\nexport * from \"../ShadersWGSL/convolution.fragment\";\r\n\r\n// Color correction\r\nexport * from \"../Shaders/colorCorrection.fragment\";\r\nexport * from \"../ShadersWGSL/colorCorrection.fragment\";\r\n\r\n// Motion blur\r\nexport * from \"../Shaders/motionBlur.fragment\";\r\nexport * from \"../ShadersWGSL/motionBlur.fragment\";\r\n\r\n// Filter\r\nexport * from \"../Shaders/filter.fragment\";\r\nexport * from \"../ShadersWGSL/filter.fragment\";\r\n\r\n// Highlights\r\nexport * from \"../Shaders/highlights.fragment\";\r\nexport * from \"../ShadersWGSL/highlights.fragment\";\r\n\r\n// Display\r\nexport * from \"../Shaders/displayPass.fragment\";\r\nexport * from \"../ShadersWGSL/displayPass.fragment\";\r\n\r\n// Tonemap\r\nexport * from \"../Shaders/tonemap.fragment\";\r\nexport * from \"../ShadersWGSL/tonemap.fragment\";\r\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8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AAC;AAE9C,uBAAuB;AACvB,cAAc,yCAAyC,CAAC;AACxD,cAAc,6CAA6C,CAAC;AAE5D,uBAAuB;AACvB,cAAc,uCAAuC,CAAC;AACtD,cAAc,2CAA2C,CAAC;AAE1D,sBAAsB;AACtB,cAAc,uCAAuC,CAAC;AACtD,cAAc,2CAA2C,CAAC;AAE1D,QAAQ;AACR,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AAEnD,qBAAqB;AACrB,cAAc,uCAAuC,CAAC;AACtD,cAAc,2CAA2C,CAAC;AAE1D,OAAO;AACP,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAE3C,MAAM;AACN,cAAc,mCAAmC,CAAC;AAClD,cAAc,uCAAuC,CAAC;AAEtD,WAAW;AACX,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AAEjD,cAAc;AACd,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AAEpD,mBAAmB;AACnB,cAAc,qCAAqC,CAAC;AACpD,cAAc,yCAAyC,CAAC;AAExD,cAAc;AACd,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AAEnD,SAAS;AACT,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAE/C,aAAa;AACb,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AAEnD,UAAU;AACV,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AAEpD,UAAU;AACV,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nexport * from \"./anaglyphPostProcess\";\r\nexport * from \"./blackAndWhitePostProcess\";\r\nexport * from \"./bloomEffect\";\r\nexport * from \"./bloomMergePostProcess\";\r\nexport * from \"./blurPostProcess\";\r\nexport * from \"./chromaticAberrationPostProcess\";\r\nexport * from \"./circleOfConfusionPostProcess\";\r\nexport * from \"./colorCorrectionPostProcess\";\r\nexport * from \"./convolutionPostProcess\";\r\nexport * from \"./depthOfFieldBlurPostProcess\";\r\nexport * from \"./depthOfFieldEffect\";\r\nexport * from \"./depthOfFieldMergePostProcess\";\r\nexport * from \"./displayPassPostProcess\";\r\nexport * from \"./extractHighlightsPostProcess\";\r\nexport * from \"./filterPostProcess\";\r\nexport * from \"./fxaaPostProcess\";\r\nexport * from \"./grainPostProcess\";\r\nexport * from \"./highlightsPostProcess\";\r\nexport * from \"./imageProcessingPostProcess\";\r\nexport * from \"./motionBlurPostProcess\";\r\nexport * from \"./passPostProcess\";\r\nexport * from \"./postProcess\";\r\nexport * from \"./postProcessManager\";\r\nexport * from \"./refractionPostProcess\";\r\nexport * from \"./RenderPipeline/index\";\r\nexport * from \"./sharpenPostProcess\";\r\nexport * from \"./stereoscopicInterlacePostProcess\";\r\nexport * from \"./tonemapPostProcess\";\r\nexport * from \"./volumetricLightScatteringPostProcess\";\r\nexport * from \"./vrDistortionCorrectionPostProcess\";\r\nexport * from \"./vrMultiviewToSingleviewPostProcess\";\r\nexport * from \"./screenSpaceReflectionPostProcess\";\r\nexport * from \"./screenSpaceCurvaturePostProcess\";\r\n\r\nexport * from \"./thinAnaglyphPostProcess\";\r\nexport * from \"./thinBlackAndWhitePostProcess\";\r\nexport * from \"./thinBloomEffect\";\r\nexport * from \"./thinBlurPostProcess\";\r\nexport * from \"./thinChromaticAberrationPostProcess\";\r\nexport * from \"./thinCircleOfConfusionPostProcess\";\r\nexport * from \"./thinDepthOfFieldEffect\";\r\nexport * from \"./thinExtractHighlightsPostProcess\";\r\nexport * from \"./thinImageProcessingPostProcess\";\r\nexport * from \"./thinPassPostProcess\";\r\n\r\n// Postprocess\r\nexport * from \"../Shaders/postprocess.vertex\";\r\nexport * from \"../ShadersWGSL/postprocess.vertex\";\r\n\r\n// Blur postprocess\r\nexport * from \"../Shaders/kernelBlur.fragment\";\r\nexport * from \"../Shaders/kernelBlur.vertex\";\r\nexport * from \"../ShadersWGSL/kernelBlur.fragment\";\r\nexport * from \"../ShadersWGSL/kernelBlur.vertex\";\r\n\r\n// Pass postprocess\r\nexport * from \"../Shaders/pass.fragment\";\r\nexport * from \"../Shaders/passCube.fragment\";\r\nexport * from \"../ShadersWGSL/pass.fragment\";\r\nexport * from \"../ShadersWGSL/passCube.fragment\";\r\n\r\n// vrDFistortionCorrection postprocess\r\nexport * from \"../Shaders/vrDistortionCorrection.fragment\";\r\nexport * from \"../ShadersWGSL/vrDistortionCorrection.fragment\";\r\n\r\n// Image processing postprocess\r\nexport * from \"../ShadersWGSL/imageProcessing.fragment\";\r\nexport * from \"../Shaders/imageProcessing.fragment\";\r\n\r\n// Sharpen\r\nexport * from \"../Shaders/sharpen.fragment\";\r\nexport * from \"../ShadersWGSL/sharpen.fragment\";\r\n\r\n// Grain\r\nexport * from \"../Shaders/grain.fragment\";\r\nexport * from \"../ShadersWGSL/grain.fragment\";\r\n\r\n// Chromatic Aberration\r\nexport * from \"../Shaders/chromaticAberration.fragment\";\r\nexport * from \"../ShadersWGSL/chromaticAberration.fragment\";\r\n\r\n// Depth of field merge\r\nexport * from \"../Shaders/depthOfFieldMerge.fragment\";\r\nexport * from \"../ShadersWGSL/depthOfFieldMerge.fragment\";\r\n\r\n// Circle of confusion\r\nexport * from \"../Shaders/circleOfConfusion.fragment\";\r\nexport * from \"../ShadersWGSL/circleOfConfusion.fragment\";\r\n\r\n// Bloom\r\nexport * from \"../Shaders/bloomMerge.fragment\";\r\nexport * from \"../ShadersWGSL/bloomMerge.fragment\";\r\n\r\n// Extract highlights\r\nexport * from \"../Shaders/extractHighlights.fragment\";\r\nexport * from \"../ShadersWGSL/extractHighlights.fragment\";\r\n\r\n// FXAA\r\nexport * from \"../Shaders/fxaa.fragment\";\r\nexport * from \"../Shaders/fxaa.vertex\";\r\nexport * from \"../ShadersWGSL/fxaa.fragment\";\r\nexport * from \"../ShadersWGSL/fxaa.vertex\";\r\n\r\n// B&W\r\nexport * from \"../Shaders/blackAndWhite.fragment\";\r\nexport * from \"../ShadersWGSL/blackAndWhite.fragment\";\r\n\r\n// Anaglyph\r\nexport * from \"../Shaders/anaglyph.fragment\";\r\nexport * from \"../ShadersWGSL/anaglyph.fragment\";\r\n\r\n// Convolution\r\nexport * from \"../Shaders/convolution.fragment\";\r\nexport * from \"../ShadersWGSL/convolution.fragment\";\r\n\r\n// Color correction\r\nexport * from \"../Shaders/colorCorrection.fragment\";\r\nexport * from \"../ShadersWGSL/colorCorrection.fragment\";\r\n\r\n// Motion blur\r\nexport * from \"../Shaders/motionBlur.fragment\";\r\nexport * from \"../ShadersWGSL/motionBlur.fragment\";\r\n\r\n// Filter\r\nexport * from \"../Shaders/filter.fragment\";\r\nexport * from \"../ShadersWGSL/filter.fragment\";\r\n\r\n// Highlights\r\nexport * from \"../Shaders/highlights.fragment\";\r\nexport * from \"../ShadersWGSL/highlights.fragment\";\r\n\r\n// Display\r\nexport * from \"../Shaders/displayPass.fragment\";\r\nexport * from \"../ShadersWGSL/displayPass.fragment\";\r\n\r\n// Tonemap\r\nexport * from \"../Shaders/tonemap.fragment\";\r\nexport * from \"../ShadersWGSL/tonemap.fragment\";\r\n"]}
|
|
@@ -686,6 +686,7 @@ export class PostProcess {
|
|
|
686
686
|
if (this.alphaConstants) {
|
|
687
687
|
this.getEngine().setAlphaConstants(this.alphaConstants.r, this.alphaConstants.g, this.alphaConstants.b, this.alphaConstants.a);
|
|
688
688
|
}
|
|
689
|
+
this._engine.setAlphaMode(this.alphaMode);
|
|
689
690
|
// Bind the output texture of the preivous post process as the input to this post process.
|
|
690
691
|
let source;
|
|
691
692
|
if (this._shareOutputWithPostProcess) {
|
|
@@ -703,7 +704,7 @@ export class PostProcess {
|
|
|
703
704
|
// Parameters
|
|
704
705
|
this._effectWrapper.drawWrapper.effect.setVector2("scale", this._scaleRatio);
|
|
705
706
|
this.onApplyObservable.notifyObservers(this._effectWrapper.drawWrapper.effect);
|
|
706
|
-
this._effectWrapper.bind();
|
|
707
|
+
this._effectWrapper.bind(true);
|
|
707
708
|
return this._effectWrapper.drawWrapper.effect;
|
|
708
709
|
}
|
|
709
710
|
_disposeTextures() {
|