C# Class SparrowSharp.Filters.BlurFilter

The BlurFilter applies a gaussian blur to an object. The strength of the blur can be set for x- and y-axis separately (always relative to the stage).

A blur filter can also be set up as a drop shadow or glow filter. Use FilterFactory to create such a filter.

For each blur direction, the number of required passes is ceil(blur).

blur = 0.5: 1 pass

blur = 1.0: 1 pass

blur = 1.5: 2 passes

blur = 2.0: 2 passes

etc.

Inheritance: FragmentFilter
Afficher le fichier Open project: fmotagarcia/sparrow-sharp Class Usage Examples

Méthodes publiques

Méthode Description
BlurFilter ( float blur = 1.0f, float resolution = 1.0f ) : System

Initializes a blur filter with the specified blur and a resolution.

SetUniformColor ( bool enable, uint color = 0x000000, float alpha = 1.0f ) : void

A uniform color will replace the RGB values of the input color, while the alpha value will be multiplied with the given factor. Pass false as the first parameter to deactivate the uniform color.

Méthodes protégées

Méthode Description
ActivateWithPass ( int pass, Texture texture, Matrix mvpMatrix ) : void
CreatePrograms ( ) : void

Private Methods

Méthode Description
UpdateMarginsAndPasses ( ) : void
UpdateParamaters ( int pass, int texWidth, int texHeight ) : void

Method Details

ActivateWithPass() protected méthode

protected ActivateWithPass ( int pass, Texture texture, Matrix mvpMatrix ) : void
pass int
texture Sparrow.Textures.Texture
mvpMatrix Matrix
Résultat void

BlurFilter() public méthode

Initializes a blur filter with the specified blur and a resolution.
public BlurFilter ( float blur = 1.0f, float resolution = 1.0f ) : System
blur float
resolution float
Résultat System

CreatePrograms() protected méthode

protected CreatePrograms ( ) : void
Résultat void

SetUniformColor() public méthode

A uniform color will replace the RGB values of the input color, while the alpha value will be multiplied with the given factor. Pass false as the first parameter to deactivate the uniform color.
public SetUniformColor ( bool enable, uint color = 0x000000, float alpha = 1.0f ) : void
enable bool
color uint
alpha float
Résultat void