Class: BlurFilterPass

PIXI.filters~BlurFilterPass

The BlurFilterPass applies a horizontal or vertical Gaussian blur to an object.

new BlurFilterPass (horizontal, strength, quality, resolution, kernelSize)

Name Type Default Description
horizontal boolean

Do pass along the x-axis (true) or y-axis (false).

strength number

The strength of the blur filter.

quality number

The quality of the blur filter.

resolution number

The resolution of the blur filter.

kernelSize number 5 optional

The kernelSize of the blur filter.Options: 5, 7, 9, 11, 13, 15.

Extends

Members

autoFit boolean inherited overrides

如果启用,PixiJS将使滤镜区域适合边界以提高性能。 如果它不适用于指定的着色器,请将其关闭。

blendMode number inherited overrides

设置滤镜的混合模式

Default Value:
  • PIXI.BLEND_MODES.NORMAL

blur number

Sets the strength of both the blur.

Default Value:
  • 16

enabled boolean inherited overrides

如果启用为true,则应用过滤器;如果为false,则不应用过滤器。

legacy boolean readonly inherited overrides

传统过滤器使用属性中的位置和uvs

padding number inherited overrides

滤镜的填充。一些滤镜需要额外的空间呼吸运动,例如模糊。 增大此值将为应用滤镜的对象的边界增加额外的宽度和高度。

着色器使用的程序

quality number

Sets the quality of the blur by modifying the number of passes. More passes means higher quaility bluring but the lower the performance.

Default Value:
  • 4

resolution number inherited overrides

滤镜的分辨率。将此值设置得较低会降低质量,但会提高滤镜的性能。

滤镜需要渲染的WebGL状态

uniforms object readonly inherited overrides

着色器uniform统,uniformGroup.uniforms 的快捷方式

Methods

apply (filterManager, input, output, clearMode, currentState) inherited overrides

应用滤镜

Name Type Description
filterManager PIXI.systems.FilterSystem

渲染器从中检索滤镜

input PIXI.RenderTexture

输入的渲染目标。

output PIXI.RenderTexture

要输出到的目标。

clearMode PIXI.CLEAR_MODES

在渲染到输出之前是否清除输出。

currentState object optional

它是滤镜的当前状态。 currentState中有一些有用的属性: target, filters, sourceFrame, destinationFrame, renderTarget, resolution