class CustomShader
package shaders.custom
extends FlxRuntimeShader › FlxGraphicsShader › GraphicsShader › Shader
@:directlyUsed@:build(openfl.utils._internal.ShaderMacro.build())@:autoBuild(openfl.utils._internal.ShaderMacro.build())Basically just FlxRuntimeShader but it has tween support
Constructor
Methods
@:value({ startDelay : 0.0, duration : 1 })tween(property:String, to:Float, duration:Float = 1, ease:EaseFunction, startDelay:Float = 0.0, ?onComplete:Dynamic):Void
Tweens a shader to a value
Parameters:
property | The property to tween |
---|---|
to | The value of the property to end up at |
duration | How long it will take |
ease | What ease should be used |
startDelay | The delay to start |
onComplete | When to do when the tween is done |
Inherited Variables
Defined by FlxGraphicsShader
Defined by GraphicsShader
Defined by Shader
data:ShaderData
Provides access to parameters, input images, and metadata for the
Shader instance. ShaderParameter objects representing parameters for
the shader, ShaderInput objects representing the input images for the
shader, and other values representing the shader's metadata are
dynamically added as properties of the data
property object when the
Shader instance is created. Those properties can be used to introspect
the shader and to set parameter and input values.
For information about accessing and manipulating the dynamic
properties of the data
object, see the ShaderData class description.
glFragmentSource:String
Get or set the fragment source used when compiling with GLSL.
This property is not available on the Flash target.
@SuppressWarnings("checkstyle:Dynamic")read onlyglProgram:GLProgram
The compiled GLProgram if available.
This property is not available on the Flash target.
glVertexSource:String
Get or set the vertex source used when compiling with GLSL.
This property is not available on the Flash target.
precisionHint:ShaderPrecision
The precision of math operations performed by the shader.
The set of possible values for the precisionHint
property is defined
by the constants in the ShaderPrecision class.
The default value is ShaderPrecision.FULL
. Setting the precision to
ShaderPrecision.FAST
can speed up math operations at the expense of
precision.
Full precision mode (ShaderPrecision.FULL
) computes all math
operations to the full width of the IEEE 32-bit floating standard and
provides consistent behavior on all platforms. In this mode, some math
operations such as trigonometric and exponential functions can be
slow.
Fast precision mode (ShaderPrecision.FAST
) is designed for maximum
performance but does not work consistently on different platforms and
individual CPU configurations. In many cases, this level of precision
is sufficient to create graphic effects without visible artifacts.
The precision mode selection affects the following shader operations. These operations are faster on an Intel processor with the SSE instruction set:
sin(x)
cos(x)
tan(x)
asin(x)
acos(x)
atan(x)
atan(x, y)
exp(x)
exp2(x)
log(x)
log2(x)
pow(x, y)
reciprocal(x)
sqrt(x)
Inherited Methods
Defined by FlxRuntimeShader
getBool(name:String):Null<Bool>
Retrieve a bool parameter of the shader.
Parameters:
name | The name of the parameter to retrieve. |
---|
getBoolArray(name:String):Null<Array<Bool>>
Retrieve a bool array parameter of the shader.
Parameters:
name | The name of the parameter to retrieve. |
---|
getFloat(name:String):Null<Float>
Retrieve a float parameter of the shader.
Parameters:
name | The name of the parameter to retrieve. |
---|
getFloatArray(name:String):Null<Array<Float>>
Retrieve a float array parameter of the shader.
Parameters:
name | The name of the parameter to retrieve. |
---|
getInt(name:String):Null<Int>
Retrieve an integer parameter of the shader.
Parameters:
name | The name of the parameter to retrieve. |
---|
getIntArray(name:String):Null<Array<Int>>
Retrieve an integer array parameter of the shader.
Parameters:
name | The name of the parameter to retrieve. |
---|
getSampler2D(name:String):Null<BitmapData>
Retrieve a bitmap data input of the shader.
Parameters:
name | The name of the parameter to retrieve. |
---|
Returns:
The value of the parameter.
setBool(name:String, value:Bool):Void
Modify a bool parameter of the shader.
Parameters:
name | The name of the parameter to modify. |
---|---|
value | The new value to use. |
setBoolArray(name:String, value:Array<Bool>):Void
Modify a bool array parameter of the shader.
Parameters:
name | The name of the parameter to modify. |
---|---|
value | The new value to use. |
setFloat(name:String, value:Float):Void
Modify a float parameter of the shader.
Parameters:
name | The name of the parameter to modify. |
---|---|
value | The new value to use. |
setFloatArray(name:String, value:Array<Float>):Void
Modify a float array parameter of the shader.
Parameters:
name | The name of the parameter to modify. |
---|---|
value | The new value to use. |
setInt(name:String, value:Int):Void
Modify an integer parameter of the shader.
Parameters:
name | The name of the parameter to modify. |
---|---|
value | The new value to use. |
setIntArray(name:String, value:Array<Int>):Void
Modify an integer array parameter of the shader.
Parameters:
name | The name of the parameter to modify. |
---|---|
value | The new value to use. |
setSampler2D(name:String, value:BitmapData):Void
Modify a bitmap data input of the shader.
Parameters:
name | The name of the parameter to modify. |
---|---|
value | The new value to use. |