Skip to content

Commit

Permalink
Add kernelSize param
Browse files Browse the repository at this point in the history
  • Loading branch information
vanruesc committed Aug 30, 2022
1 parent 15dea9f commit f5861cc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/passes/BoxBlurPass.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export class BoxBlurPass extends Pass {
* Constructs a new box blur pass.
*
* @param {Object} [options] - The options.
* @param {Number} [options.kernelSize=5] - The kernel size.
* @param {Number} [options.iterations=1] - The amount of times the blur should be applied.
* @param {Number} [options.bilateral=false] - Enables or disables bilateral blurring.
* @param {Number} [options.resolutionScale=1.0] - The resolution scale.
Expand All @@ -21,6 +22,7 @@ export class BoxBlurPass extends Pass {
*/

constructor({
kernelSize = 5,
iterations = 1,
bilateral = false,
resolutionScale = 1.0,
Expand Down Expand Up @@ -49,7 +51,7 @@ export class BoxBlurPass extends Pass {
* @private
*/

this.renderTargetB = this.renderTargetA.clone();
this.renderTargetB = new WebGLRenderTarget(1, 1, { depthBuffer: false });
this.renderTargetB.texture.name = "Blur.Target.B";

/**
Expand All @@ -59,7 +61,7 @@ export class BoxBlurPass extends Pass {
* @readonly
*/

this.blurMaterial = new BoxBlurMaterial({ bilateral, kernelSize: 5 });
this.blurMaterial = new BoxBlurMaterial({ bilateral, kernelSize });

/**
* A copy material.
Expand Down

0 comments on commit f5861cc

Please sign in to comment.