@babylonjs/core
Version:
Getting started? Play directly with the Babylon.js API using our [playground](https://playground.babylonjs.com/). It also contains a lot of samples to learn how to use it.
27 lines (26 loc) • 1.41 kB
JavaScript
import { FrameGraphBlurTask } from "./blurTask.js";
import { ThinDepthOfFieldBlurPostProcess } from "../../../PostProcesses/thinDepthOfFieldBlurPostProcess.js";
import { Vector2 } from "../../../Maths/math.vector.js";
/**
* @internal
*/
export class FrameGraphDepthOfFieldBlurTask extends FrameGraphBlurTask {
constructor(name, frameGraph, thinPostProcess) {
super(name, frameGraph, thinPostProcess || new ThinDepthOfFieldBlurPostProcess(name, frameGraph.engine, new Vector2(1, 0), 10));
this.circleOfConfusionSamplingMode = 2;
this.onTexturesAllocatedObservable.add((context) => {
context.setTextureSamplingMode(this.circleOfConfusionTexture, this.circleOfConfusionSamplingMode);
});
}
record(skipCreationOfDisabledPasses = false) {
if (this.sourceTexture === undefined || this.circleOfConfusionTexture === undefined) {
throw new Error(`FrameGraphDepthOfFieldBlurTask "${this.name}": sourceTexture and circleOfConfusionTexture are required`);
}
const pass = super.record(skipCreationOfDisabledPasses, undefined, (context) => {
context.bindTextureHandle(this._postProcessDrawWrapper.effect, "circleOfConfusionSampler", this.circleOfConfusionTexture);
});
pass.addDependencies(this.circleOfConfusionTexture);
return pass;
}
}
//# sourceMappingURL=depthOfFieldBlurTask.js.map