Packs four floats on a range from 0.0 to 1.0 into a single Uint32
name | type | description |
---|---|---|
r | number |
Red component in a range from 0.0 to 1.0 |
g | number |
Green component in a range from 0.0 to 1.0 |
b | number |
Blue component in a range from 0.0 to 1.0 |
a | number |
Alpha component in a range from 0.0 to 1.0 |
The packed RGBA values as a Uint32.
Packs a Uint24, representing RGB components, with a Float32, representing the alpha component, with a range between 0.0 and 1.0 and return a Uint32
name | type | description |
---|---|---|
rgb | number |
Uint24 representing RGB components |
a | number |
Float32 representing Alpha component |
Packed RGBA as Uint32
Packs a Uint24, representing RGB components, with a Float32, representing the alpha component, with a range between 0.0 and 1.0 and return a swizzled Uint32
name | type | description |
---|---|---|
rgb | number |
Uint24 representing RGB components |
a | number |
Float32 representing Alpha component |
Packed RGBA as Uint32
Unpacks a Uint24 RGB into an array of floats of ranges of 0.0 and 1.0
name | type | description |
---|---|---|
rgb | number |
RGB packed as a Uint24 |
Array of floats representing each component as a float
Check to see how many texture units the GPU supports in a fragment shader and if the value specific in the game config is allowed.
This value is hard-clamped to 16 for performance reasons on Android devices.
name | type | description |
---|---|---|
gl | WebGLRenderingContext |
The WebGLContext used to create the shaders. |
maxTextures | number |
The Game Config maxTextures value. |
The number of texture units that is supported by this browser and GPU.
Checks the given Fragment Shader Source for %count%
and %forloop%
declarations and
replaces those with GLSL code for setting texture = texture2D(uMainSampler[i], outTexCoord)
.
name | type | description |
---|---|---|
fragmentShaderSource | string |
The Fragment Shader source code to operate on. |
maxTextures | number |
The number of maxTextures value. |
The modified Fragment Shader source.
Takes the Glow FX Shader source and parses out the SIZE and DIST consts with the configuration values.
name | type | arguments | description |
---|---|---|---|
shader | string |
The Fragment Shader source code to operate on. |
|
game | Phaser.Game |
The Phaser Game instance. |
|
quality | number | <optional> |
The quality of the glow (defaults to 0.1) |
distance | number | <optional> |
The distance of the glow (defaults to 10) |
The modified Fragment Shader source.