Types.Filters
BlockyConfig
<static> BlockyConfig
| name | type | optional | description |
|---|---|---|---|
| size | number | Phaser.Types.Math.Vector2Like | Yes | The size of the blocks. If a number, it sets both x and y to the same value. If a Vector2Like, it sets x and y to the respective values. |
| offset | number | Phaser.Types.Math.Vector2Like | Yes | The offset of the blocks. If a number, it sets both x and y to the same value. If a Vector2Like, it sets x and y to the respective values. |
Type: object
Member of: Phaser.Types.Filters
Source: src/filters/typedefs/BlockyConfig.js#L1
Since: 4.0.0
GradientMapConfig
<static> GradientMapConfig
| name | type | optional | default | description |
|---|---|---|---|---|
| ramp | Phaser.Display.ColorRamp | Phaser.Types.Display.ColorBandConfig | Phaser.Display.ColorBand | Array.<(Phaser.Types.Display.ColorBandConfig | Phaser.Display.ColorBand)> |
| dither | boolean | Yes | false | Whether to dither the gradient output. |
| color | Array.<number> | Yes | "[0, 0, 0, 0]" | Value to add to each channel. |
| colorFactor | Array.<number> | Yes | "[0.3, 0.6, 0.1, 0]" | Factor to apply to each channel. Try to keep them summing to 1. |
| unpremultiply | boolean | Yes | true | Whether to unpremultiply color data before processing it. |
| alpha | number | Yes | 1 | How much of the effect to blend over the original. |
Type: object
Member of: Phaser.Types.Filters
Source: src/filters/typedefs/GradientMapConfig.js#L1
Since: 4.0.0
ImageLightConfig
<static> ImageLightConfig
| name | type | optional | default | description |
|---|---|---|---|---|
| normalMap | string | Phaser.Textures.Texture | Yes | "'__NORMAL'" | The texture to use for the ImageLight effect normal map. This should match the object being filtered. The default is flat lighting. |
| environmentMap | string | Phaser.Textures.Texture | Yes | "'__WHITE'" | The texture to use for the ImageLight effect environment map. |
| modelMatrix | Phaser.Math.Matrix4 | Yes | The initial model matrix. If not provided, a default matrix will be created. | |
| modelRotation | number | Yes | 0 | The initial rotation of the model in radians. |
| modelRotationSource | Phaser.GameObjects.GameObject | Phaser.Types.Filters.ImageLightSourceCallback | null | Yes | null |
| bulge | number | Yes | 0 | The amount of bulge to apply to the ImageLight effect. This distorts the surface slightly, preventing flat areas in the normal map from reflecting a single flat color. A value of 0.1 is often plenty. |
| colorFactor | Array.<number> | Yes | "[1, 1, 1]" | The color factor to apply to the ImageLight effect. This multiplies the intensity of the light in each color channel. Use values above 1 to substitute for high dynamic range lighting. |
Type: object
Member of: Phaser.Types.Filters
Source: src/filters/typedefs/ImageLightConfig.js#L1
Since: 4.0.0
ImageLightSourceCallback
<static> ImageLightSourceCallback
Type: function
Member of: Phaser.Types.Filters
Source: src/filters/typedefs/ImageLightSourceCallback.js#L1
Since: 4.0.0
KeyConfig
<static> KeyConfig
| name | type | optional | default | description |
|---|---|---|---|---|
| color | number | string | Array.<number> | Phaser.Display.Color | Yes |
| alpha | number | Yes | 1 | The amount of alpha to remove. This should be a value between 0 and 1, but you can go outside that range for different effects. |
| isolate | boolean | Yes | false | Whether to keep the region matching the key color. If true, the region matching the key color will be kept, and the rest will be removed. If false, the region matching the key color will be removed, and the rest will be kept. |
| threshold | number | Yes | 0.0625 | The threshold for the key color. A pixel is considered to be the key color if the difference between the pixel and the key color is less than the threshold. This should be a value between 0 and 1. The default threshold is 1 / 16, which is a good starting point for most images. |
| feather | number | Yes | 0 | The feathering amount for the key color. Pixels outside the threshold, but still within the feather, will be a partial match. This should be a value between 0 and 1. |
Type: object
Member of: Phaser.Types.Filters
Source: src/filters/typedefs/KeyConfig.js#L1
Since: 4.0.0
NormalToolsConfig
<static> NormalToolsConfig
| name | type | optional | default | description |
|---|---|---|---|---|
| rotation | number | Yes | 0 | 2D rotation of the normal map in radians. For more advanced controls, manipulate the filter's viewMatrix to control 3D rotation. |
| rotationSource | Phaser.GameObjects.GameObject | Phaser.Types.Filters.NormalToolsSourceCallback | null | Yes | null |
| facingPower | number | Yes | 1 | Manipulate the tendency for normals to face the camera. Higher values bend normals toward the camera; lower values bend them away. This can be useful for suggesting depth in a 2D scene. |
| outputRatio | boolean | Yes | false | If true, the output will be a grayscale texture, with the white area being the areas where the normals are facing the camera, fading to black when they're orthogonal. This can be useful as a base for other effects. |
| ratioVector | Phaser.Math.Vector3 | Yes | "[0, 0, 1]" | The vector to use for the ratio output. This is the direction in which the ratio will be calculated. The default is the camera's forward direction. Manipulate this to highlight parts of the map which are facing in a specific direction. This is only used if outputRatio is true. |
| ratioRadius | number | Yes | 1 | How much of a hemisphere to consider for the ratio output. At 1, the ratio will be calculated for the entire hemisphere. At 0, the ratio will be calculated for a single point. This uses the same algorithm as PanoramaBlur.radius. This is only used if outputRatio is true. |
Type: object
Member of: Phaser.Types.Filters
Source: src/filters/typedefs/NormalToolsConfig.js#L1
Since: 4.0.0
NormalToolsSourceCallback
<static> NormalToolsSourceCallback
Type: function
Member of: Phaser.Types.Filters
Source: src/filters/typedefs/NormalToolsSourceCallback.js#L1
Since: 4.0.0
PanoramaBlurConfig
<static> PanoramaBlurConfig
| name | type | optional | default | description |
|---|---|---|---|---|
| radius | number | Yes | 1 | The radius of the blur effect. 1 samples an entire hemisphere; 0 samples a single point. |
| samplesX | number | Yes | 32 | The number of samples to take along the X axis. More samples produces a more accurate blur, but at the cost of performance. The X axis in a panorama is usually wider than the Y axis. |
| samplesY | number | Yes | 16 | The number of samples to take along the Y axis. More samples produces a more accurate blur, but at the cost of performance. |
| power | number | Yes | 1 | An exponent applied to samples. Power above 1 increases darkness, allowing brighter colors to dominate. Power below 1 increases brightness, reducing the influence of brighter colors. To simulate an HDR environment with bright sunlight that cannot be represented in sRGB color, use low power. |
Type: object
Member of: Phaser.Types.Filters
Source: src/filters/typedefs/PanoramaBlurConfig.js#L1
Since: 4.0.0
QuantizeConfig
<static> QuantizeConfig
| name | type | optional | default | description |
|---|---|---|---|---|
| steps | Array.<number> | Yes | "[ 8, 8, 8, 8 ]" | Number of steps to use per channel. |
| gamma | Array.<number> | Yes | "[ 1, 1, 1, 1 ]" | Gamma power to apply per channel. |
| offset | Array.<number> | Yes | "[ 0, 0, 0, 0 ]" | Offset to apply per channel. |
| dither | boolean | Yes | false | Whether to dither the quantization. |
| mode | number | Yes | 0 | Color space mode. 0 is RGBA. 1 is HSVA. Use HSVA for better treatment of hues. |
Type: object
Member of: Phaser.Types.Filters
Source: src/filters/typedefs/QuantizeConfig.js#L1
Since: 4.0.0