|
@@ -1,17 +1,29 @@
|
|
module BABYLON {
|
|
module BABYLON {
|
|
export class StandardRenderingPipeline extends PostProcessRenderPipeline implements IDisposable {
|
|
export class StandardRenderingPipeline extends PostProcessRenderPipeline implements IDisposable {
|
|
- // Public members
|
|
|
|
|
|
+ /**
|
|
|
|
+ * Public members
|
|
|
|
+ */
|
|
|
|
+ // Post-processes
|
|
public originalPostProcess: PostProcess;
|
|
public originalPostProcess: PostProcess;
|
|
public downSampleX4PostProcess: PostProcess = null;
|
|
public downSampleX4PostProcess: PostProcess = null;
|
|
public brightPassPostProcess: PostProcess = null;
|
|
public brightPassPostProcess: PostProcess = null;
|
|
public gaussianBlurHPostProcesses: PostProcess[] = [];
|
|
public gaussianBlurHPostProcesses: PostProcess[] = [];
|
|
public gaussianBlurVPostProcesses: PostProcess[] = [];
|
|
public gaussianBlurVPostProcesses: PostProcess[] = [];
|
|
public textureAdderPostProcess: PostProcess = null;
|
|
public textureAdderPostProcess: PostProcess = null;
|
|
- public depthOfFieldSourcePostProcess: PostProcess = null;
|
|
|
|
|
|
+
|
|
|
|
+ public textureAdderFinalPostProcess: PostProcess = null;
|
|
|
|
+
|
|
|
|
+ public lensFlarePostProcess: PostProcess = null;
|
|
|
|
+ public lensFlareShiftPostProcess: PostProcess = null;
|
|
|
|
+ public lensFlareComposePostProcess: PostProcess = null;
|
|
|
|
+
|
|
public depthOfFieldPostProcess: PostProcess = null;
|
|
public depthOfFieldPostProcess: PostProcess = null;
|
|
|
|
|
|
|
|
+ public motionBlurPostProcess: PostProcess = null;
|
|
|
|
+
|
|
|
|
+ // Values
|
|
public brightThreshold: number = 1.0;
|
|
public brightThreshold: number = 1.0;
|
|
-
|
|
|
|
|
|
+
|
|
public gaussianCoefficient: number = 0.25;
|
|
public gaussianCoefficient: number = 0.25;
|
|
public gaussianMean: number = 1.0;
|
|
public gaussianMean: number = 1.0;
|
|
public gaussianStandardDeviation: number = 1.0;
|
|
public gaussianStandardDeviation: number = 1.0;
|
|
@@ -19,50 +31,39 @@
|
|
public exposure: number = 1.0;
|
|
public exposure: number = 1.0;
|
|
public lensTexture: Texture = null;
|
|
public lensTexture: Texture = null;
|
|
|
|
|
|
|
|
+ public lensColorTexture: Texture = null;
|
|
|
|
+ public lensFlareStrength: number = 1.0;
|
|
|
|
+ public lensFlareGhostDispersal: number = 1.0;
|
|
|
|
+ public lensFlareHaloWidth: number = 0.4;
|
|
|
|
+ public lensFlareDistortionStrength: number = 4.0;
|
|
|
|
+ public lensStarTexture: Texture = null;
|
|
|
|
+ public lensFlareDirtTexture: Texture = null;
|
|
|
|
+
|
|
public depthOfFieldDistance: number = 10.0;
|
|
public depthOfFieldDistance: number = 10.0;
|
|
|
|
|
|
- // Private members
|
|
|
|
|
|
+ /**
|
|
|
|
+ * Private members
|
|
|
|
+ */
|
|
private _scene: Scene;
|
|
private _scene: Scene;
|
|
-
|
|
|
|
|
|
+
|
|
private _depthRenderer: DepthRenderer = null;
|
|
private _depthRenderer: DepthRenderer = null;
|
|
|
|
|
|
// Getters and setters
|
|
// Getters and setters
|
|
- private _blurEnabled: boolean = true;
|
|
|
|
- private _depthOfFieldEnabled: boolean = false;
|
|
|
|
-
|
|
|
|
- public set BlurEnabled(enabled: boolean) {
|
|
|
|
- if (enabled && !this._blurEnabled || !enabled && this._blurEnabled) {
|
|
|
|
- for (var i = 0; i < this.gaussianBlurHPostProcesses.length - 1; i++) {
|
|
|
|
- if (enabled) {
|
|
|
|
- this._scene.postProcessRenderPipelineManager.enableEffectInPipeline(this._name, "HDRGaussianBlurH" + i, this._scene.cameras);
|
|
|
|
- this._scene.postProcessRenderPipelineManager.enableEffectInPipeline(this._name, "HDRGaussianBlurV" + i, this._scene.cameras);
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- this._scene.postProcessRenderPipelineManager.disableEffectInPipeline(this._name, "HDRGaussianBlurH" + i, this._scene.cameras);
|
|
|
|
- this._scene.postProcessRenderPipelineManager.disableEffectInPipeline(this._name, "HDRGaussianBlurV" + i, this._scene.cameras);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- this._blurEnabled = enabled;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public get BlurEnabled(): boolean {
|
|
|
|
- return this._blurEnabled;
|
|
|
|
- }
|
|
|
|
|
|
+ private _depthOfFieldEnabled: boolean = true;
|
|
|
|
+ private _lensFlareEnabled: boolean = true;
|
|
|
|
|
|
public set DepthOfFieldEnabled(enabled: boolean) {
|
|
public set DepthOfFieldEnabled(enabled: boolean) {
|
|
|
|
+ var blurIndex = this.gaussianBlurHPostProcesses.length - 1;
|
|
|
|
+
|
|
if (enabled && !this._depthOfFieldEnabled) {
|
|
if (enabled && !this._depthOfFieldEnabled) {
|
|
- this._scene.postProcessRenderPipelineManager.enableEffectInPipeline(this._name, "HDRDepthOfFieldSource", this._scene.cameras);
|
|
|
|
- this._scene.postProcessRenderPipelineManager.enableEffectInPipeline(this._name, "HDRGaussianBlurH4", this._scene.cameras);
|
|
|
|
- this._scene.postProcessRenderPipelineManager.enableEffectInPipeline(this._name, "HDRGaussianBlurV4", this._scene.cameras);
|
|
|
|
|
|
+ this._scene.postProcessRenderPipelineManager.enableEffectInPipeline(this._name, "HDRGaussianBlurH" + blurIndex, this._scene.cameras);
|
|
|
|
+ this._scene.postProcessRenderPipelineManager.enableEffectInPipeline(this._name, "HDRGaussianBlurV" + blurIndex, this._scene.cameras);
|
|
this._scene.postProcessRenderPipelineManager.enableEffectInPipeline(this._name, "HDRDepthOfField", this._scene.cameras);
|
|
this._scene.postProcessRenderPipelineManager.enableEffectInPipeline(this._name, "HDRDepthOfField", this._scene.cameras);
|
|
this._depthRenderer = this._scene.enableDepthRenderer();
|
|
this._depthRenderer = this._scene.enableDepthRenderer();
|
|
}
|
|
}
|
|
else if (!enabled && this._depthOfFieldEnabled) {
|
|
else if (!enabled && this._depthOfFieldEnabled) {
|
|
- this._scene.postProcessRenderPipelineManager.disableEffectInPipeline(this._name, "HDRDepthOfFieldSource", this._scene.cameras);
|
|
|
|
- this._scene.postProcessRenderPipelineManager.disableEffectInPipeline(this._name, "HDRGaussianBlurH4", this._scene.cameras);
|
|
|
|
- this._scene.postProcessRenderPipelineManager.disableEffectInPipeline(this._name, "HDRGaussianBlurV4", this._scene.cameras);
|
|
|
|
|
|
+ this._scene.postProcessRenderPipelineManager.disableEffectInPipeline(this._name, "HDRGaussianBlurH" + blurIndex, this._scene.cameras);
|
|
|
|
+ this._scene.postProcessRenderPipelineManager.disableEffectInPipeline(this._name, "HDRGaussianBlurV" + blurIndex, this._scene.cameras);
|
|
this._scene.postProcessRenderPipelineManager.disableEffectInPipeline(this._name, "HDRDepthOfField", this._scene.cameras);
|
|
this._scene.postProcessRenderPipelineManager.disableEffectInPipeline(this._name, "HDRDepthOfField", this._scene.cameras);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -73,6 +74,32 @@
|
|
return this._depthOfFieldEnabled;
|
|
return this._depthOfFieldEnabled;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public set LensFlareEnabled(enabled: boolean) {
|
|
|
|
+ var blurIndex = this.gaussianBlurHPostProcesses.length - 2;
|
|
|
|
+
|
|
|
|
+ if (enabled && !this._lensFlareEnabled) {
|
|
|
|
+ this._scene.postProcessRenderPipelineManager.enableEffectInPipeline(this._name, "HDRLensFlare", this._scene.cameras);
|
|
|
|
+ this._scene.postProcessRenderPipelineManager.enableEffectInPipeline(this._name, "HDRLensFlareShift", this._scene.cameras);
|
|
|
|
+ this._scene.postProcessRenderPipelineManager.enableEffectInPipeline(this._name, "HDRGaussianBlurH" + blurIndex, this._scene.cameras);
|
|
|
|
+ this._scene.postProcessRenderPipelineManager.enableEffectInPipeline(this._name, "HDRGaussianBlurV" + blurIndex, this._scene.cameras);
|
|
|
|
+ this._scene.postProcessRenderPipelineManager.enableEffectInPipeline(this._name, "HDRLensFlareCompose", this._scene.cameras);
|
|
|
|
+ this._depthRenderer = this._scene.enableDepthRenderer();
|
|
|
|
+ }
|
|
|
|
+ else if (!enabled && this._lensFlareEnabled) {
|
|
|
|
+ this._scene.postProcessRenderPipelineManager.disableEffectInPipeline(this._name, "HDRLensFlare", this._scene.cameras);
|
|
|
|
+ this._scene.postProcessRenderPipelineManager.disableEffectInPipeline(this._name, "HDRLensFlareShift", this._scene.cameras);
|
|
|
|
+ this._scene.postProcessRenderPipelineManager.disableEffectInPipeline(this._name, "HDRGaussianBlurH" + blurIndex, this._scene.cameras);
|
|
|
|
+ this._scene.postProcessRenderPipelineManager.disableEffectInPipeline(this._name, "HDRGaussianBlurV" + blurIndex, this._scene.cameras);
|
|
|
|
+ this._scene.postProcessRenderPipelineManager.disableEffectInPipeline(this._name, "HDRLensFlareCompose", this._scene.cameras);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this._lensFlareEnabled = enabled;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public get LensFlareEnabled(): boolean {
|
|
|
|
+ return this._lensFlareEnabled;
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* @constructor
|
|
* @constructor
|
|
* @param {string} name - The rendering pipeline name
|
|
* @param {string} name - The rendering pipeline name
|
|
@@ -113,11 +140,14 @@
|
|
this._createTextureAdderPostProcess(scene, ratio);
|
|
this._createTextureAdderPostProcess(scene, ratio);
|
|
|
|
|
|
// Create depth-of-field source post-process
|
|
// Create depth-of-field source post-process
|
|
- this.depthOfFieldSourcePostProcess = new PostProcess("HDRDepthOfFieldSource", "standard", [], [], ratio, null, Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), true, "#define PASS_POST_PROCESS", Engine.TEXTURETYPE_UNSIGNED_INT);
|
|
|
|
- this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRDepthOfFieldSource", () => { return this.depthOfFieldSourcePostProcess; }, true));
|
|
|
|
|
|
+ this.textureAdderFinalPostProcess = new PostProcess("HDRTextureAdderPostProcess", "standard", [], [], ratio, null, Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), true, "#define PASS_POST_PROCESS", Engine.TEXTURETYPE_UNSIGNED_INT);
|
|
|
|
+ this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRDepthOfFieldSource", () => { return this.textureAdderFinalPostProcess; }, true));
|
|
|
|
+
|
|
|
|
+ // Create lens flare post-process
|
|
|
|
+ this._createLensFlarePostProcess(scene, ratio);
|
|
|
|
|
|
// Create gaussian blur used by depth-of-field
|
|
// Create gaussian blur used by depth-of-field
|
|
- this._createGaussianBlurPostProcesses(scene, ratio / 2, 4);
|
|
|
|
|
|
+ this._createGaussianBlurPostProcesses(scene, ratio / 2, 5);
|
|
|
|
|
|
// Create depth-of-field post-process
|
|
// Create depth-of-field post-process
|
|
this._createDepthOfFieldPostProcess(scene, ratio);
|
|
this._createDepthOfFieldPostProcess(scene, ratio);
|
|
@@ -129,10 +159,9 @@
|
|
scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(name, cameras);
|
|
scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(name, cameras);
|
|
}
|
|
}
|
|
|
|
|
|
- this._scene.postProcessRenderPipelineManager.disableEffectInPipeline(this._name, "HDRDepthOfFieldSource", cameras);
|
|
|
|
- this._scene.postProcessRenderPipelineManager.disableEffectInPipeline(this._name, "HDRGaussianBlurH4", cameras);
|
|
|
|
- this._scene.postProcessRenderPipelineManager.disableEffectInPipeline(this._name, "HDRGaussianBlurV4", cameras);
|
|
|
|
- this._scene.postProcessRenderPipelineManager.disableEffectInPipeline(this._name, "HDRDepthOfField", cameras);
|
|
|
|
|
|
+ // Deactivate
|
|
|
|
+ this.LensFlareEnabled = false;
|
|
|
|
+ this.DepthOfFieldEnabled = false;
|
|
}
|
|
}
|
|
|
|
|
|
// Down Sample X4 Post-Processs
|
|
// Down Sample X4 Post-Processs
|
|
@@ -174,7 +203,7 @@
|
|
brightOffsets[5] = -0.5 * sV;
|
|
brightOffsets[5] = -0.5 * sV;
|
|
brightOffsets[6] = 0.5 * sU;
|
|
brightOffsets[6] = 0.5 * sU;
|
|
brightOffsets[7] = -0.5 * sV;
|
|
brightOffsets[7] = -0.5 * sV;
|
|
-
|
|
|
|
|
|
+
|
|
effect.setArray2("dsOffsets", brightOffsets);
|
|
effect.setArray2("dsOffsets", brightOffsets);
|
|
effect.setFloat("brightThreshold", this.brightThreshold);
|
|
effect.setFloat("brightThreshold", this.brightThreshold);
|
|
}
|
|
}
|
|
@@ -201,7 +230,7 @@
|
|
* (1.0 / Math.sqrt(2.0 * Math.PI * this.gaussianStandardDeviation))
|
|
* (1.0 / Math.sqrt(2.0 * Math.PI * this.gaussianStandardDeviation))
|
|
* Math.exp((-((x - this.gaussianMean) * (x - this.gaussianMean))) / (2.0 * this.gaussianStandardDeviation * this.gaussianStandardDeviation));
|
|
* Math.exp((-((x - this.gaussianMean) * (x - this.gaussianMean))) / (2.0 * this.gaussianStandardDeviation * this.gaussianStandardDeviation));
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
var lastOutputDimensions: any = {
|
|
var lastOutputDimensions: any = {
|
|
width: scene.getEngine().getRenderWidth(),
|
|
width: scene.getEngine().getRenderWidth(),
|
|
height: scene.getEngine().getRenderHeight()
|
|
height: scene.getEngine().getRenderHeight()
|
|
@@ -238,7 +267,7 @@
|
|
private _createTextureAdderPostProcess(scene: Scene, ratio: number): void {
|
|
private _createTextureAdderPostProcess(scene: Scene, ratio: number): void {
|
|
var lastGaussianBlurPostProcess = this.gaussianBlurVPostProcesses[3];
|
|
var lastGaussianBlurPostProcess = this.gaussianBlurVPostProcesses[3];
|
|
|
|
|
|
- this.textureAdderPostProcess = new PostProcess("HDRTextureAdder", "standard", ["exposure"], ["otherSampler", "lensSampler"], ratio, null, Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), true, "#define TEXTURE_ADDER", Engine.TEXTURETYPE_UNSIGNED_INT);
|
|
|
|
|
|
+ this.textureAdderPostProcess = new PostProcess("HDRTextureAdder", "standard", ["exposure"], ["otherSampler", "lensSampler"], ratio, null, Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, "#define TEXTURE_ADDER", Engine.TEXTURETYPE_UNSIGNED_INT);
|
|
this.textureAdderPostProcess.onApply = (effect: Effect) => {
|
|
this.textureAdderPostProcess.onApply = (effect: Effect) => {
|
|
effect.setTextureFromPostProcess("otherSampler", this.originalPostProcess);
|
|
effect.setTextureFromPostProcess("otherSampler", this.originalPostProcess);
|
|
effect.setTexture("lensSampler", this.lensTexture);
|
|
effect.setTexture("lensSampler", this.lensTexture);
|
|
@@ -250,11 +279,69 @@
|
|
this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRTextureAdder", () => { return this.textureAdderPostProcess; }, true));
|
|
this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRTextureAdder", () => { return this.textureAdderPostProcess; }, true));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // Create lens flare post-process
|
|
|
|
+ private _createLensFlarePostProcess(scene: Scene, ratio: number): void {
|
|
|
|
+ this.lensFlarePostProcess = new PostProcess("HDRLensFlare", "standard", ["strength", "ghostDispersal", "haloWidth"], ["lensColorSampler"], ratio / 8, null, Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), true, "#define LENS_FLARE", Engine.TEXTURETYPE_UNSIGNED_INT);
|
|
|
|
+ this.lensFlareShiftPostProcess = new PostProcess("HDRLensFlareShift", "standard", ["resolution", "distortionStrength"], [], ratio / 8, null, Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, "#define LENS_FLARE_SHIFT", Engine.TEXTURETYPE_UNSIGNED_INT);
|
|
|
|
+ this._createGaussianBlurPostProcesses(scene, ratio / 8, 4);
|
|
|
|
+ this.lensFlareComposePostProcess = new PostProcess("HDRLensFlareCompose", "standard", ["viewMatrix", "scaleBias1", "scaleBias2"], ["otherSampler", "lensDirtSampler", "lensStarSampler"], ratio, null, Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, "#define LENS_FLARE_COMPOSE", Engine.TEXTURETYPE_UNSIGNED_INT);
|
|
|
|
+
|
|
|
|
+ var resolution = new Vector2(0, 0);
|
|
|
|
+
|
|
|
|
+ // Lens flare
|
|
|
|
+ this.lensFlarePostProcess.onApply = (effect: Effect) => {
|
|
|
|
+ effect.setTextureFromPostProcess("textureSampler", this.textureAdderPostProcess);
|
|
|
|
+ effect.setTexture("lensColorSampler", this.lensColorTexture);
|
|
|
|
+ effect.setFloat("strength", this.lensFlareStrength);
|
|
|
|
+ effect.setFloat("ghostDispersal", this.lensFlareGhostDispersal);
|
|
|
|
+ effect.setFloat("haloWidth", this.lensFlareHaloWidth);
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ // Shift
|
|
|
|
+ this.lensFlareShiftPostProcess.onApply = (effect: Effect) => {
|
|
|
|
+ resolution.x = this.lensFlareShiftPostProcess.width;
|
|
|
|
+ resolution.y = this.lensFlareShiftPostProcess.height;
|
|
|
|
+ effect.setVector2("resolution", resolution);
|
|
|
|
+
|
|
|
|
+ effect.setFloat("distortionStrength", this.lensFlareDistortionStrength);
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ // Compose
|
|
|
|
+ var scaleBias1 = Matrix.GetAsMatrix3x3(Matrix.FromValues(
|
|
|
|
+ 2.0, 0.0, -1.0, 0.0,
|
|
|
|
+ 0.0, 2.0, -1.0, 0.0,
|
|
|
|
+ 0.0, 0.0, 1.0, 0.0,
|
|
|
|
+ 0.0, 0.0, 0.0, 0.0
|
|
|
|
+ ));
|
|
|
|
+
|
|
|
|
+ var scaleBias2 = Matrix.GetAsMatrix3x3(Matrix.FromValues(
|
|
|
|
+ 0.5, 0.0, 0.5, 0.0,
|
|
|
|
+ 0.0, 0.5, 0.5, 0.0,
|
|
|
|
+ 0.0, 0.0, 1.0, 0.0,
|
|
|
|
+ 0.0, 0.0, 0.0, 0.0
|
|
|
|
+ ));
|
|
|
|
+
|
|
|
|
+ this.lensFlareComposePostProcess.onApply = (effect: Effect) => {
|
|
|
|
+ effect.setTextureFromPostProcess("otherSampler", this.textureAdderFinalPostProcess);
|
|
|
|
+ effect.setTexture("lensDirtSampler", this.lensFlareDirtTexture);
|
|
|
|
+ effect.setTexture("lensStarSampler", this.lensStarTexture);
|
|
|
|
+
|
|
|
|
+ effect.setMatrix("viewMatrix", this._scene.activeCamera.getViewMatrix());
|
|
|
|
+ effect.setMatrix3x3("scaleBias1", scaleBias1);
|
|
|
|
+ effect.setMatrix3x3("scaleBias2", scaleBias2);
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ // Add to pipeline
|
|
|
|
+ this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRLensFlare", () => { return this.lensFlarePostProcess; }, false));
|
|
|
|
+ this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRLensFlareShift", () => { return this.lensFlareShiftPostProcess; }, false));
|
|
|
|
+ this.addEffect(new PostProcessRenderEffect(scene.getEngine(), "HDRLensFlareCompose", () => { return this.lensFlareComposePostProcess; }, false));
|
|
|
|
+ }
|
|
|
|
+
|
|
// Create depth-of-field post-process
|
|
// Create depth-of-field post-process
|
|
private _createDepthOfFieldPostProcess(scene: Scene, ratio: number): void {
|
|
private _createDepthOfFieldPostProcess(scene: Scene, ratio: number): void {
|
|
this.depthOfFieldPostProcess = new PostProcess("HDRDepthOfField", "standard", ["distance"], ["otherSampler", "depthSampler"], ratio, null, Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, "#define DEPTH_OF_FIELD", Engine.TEXTURETYPE_UNSIGNED_INT);
|
|
this.depthOfFieldPostProcess = new PostProcess("HDRDepthOfField", "standard", ["distance"], ["otherSampler", "depthSampler"], ratio, null, Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, "#define DEPTH_OF_FIELD", Engine.TEXTURETYPE_UNSIGNED_INT);
|
|
this.depthOfFieldPostProcess.onApply = (effect: Effect) => {
|
|
this.depthOfFieldPostProcess.onApply = (effect: Effect) => {
|
|
- effect.setTextureFromPostProcess("otherSampler", this.depthOfFieldSourcePostProcess);
|
|
|
|
|
|
+ effect.setTextureFromPostProcess("otherSampler", this.textureAdderFinalPostProcess);
|
|
effect.setTexture("depthSampler", this._depthRenderer.getDepthMap());
|
|
effect.setTexture("depthSampler", this._depthRenderer.getDepthMap());
|
|
|
|
|
|
effect.setFloat("distance", this.depthOfFieldDistance);
|
|
effect.setFloat("distance", this.depthOfFieldDistance);
|