Package | flare.flsl |
Class | public class FLSLFilter |
Inheritance | FLSLFilter FLSLScope FLSL Object |
Implements | flash.events.IEventDispatcher |
Subclasses | AlphaMaskFilter, ColorFilter, ColorMatrixFilter, ColorTransformFilter, CubeMapFilter, EnvironmentMapFilter, FlipNormalsFilter, FogFilter, LightFilter, LightMapFilter, NormalMapFilter, NullFilter, PlanarMapFilter, ReflectionMapFilter, SelfColorFilter, SkinTransformFilter, SpecularFilter, SpecularMapFilter, TextureMapFilter, TextureMaskFilter, TransformFilter, VertexColorFilter |
Each fitler could contain a full or just a fragment of a shader.
Filters are used to dinamically create materials (Shader3D).
Each FLSLFilter is blended with the previous filter in the order they are placed. The blendMode of the first fitler is ignored.
FLSLFilters can write output states, vertex or fragment values, but only fragment parts are blended together. If an output vertex is overrided by any filter, the last vertex value is used.
FLSLFilter could also have multiple passes and techniques.
See also
Property | Defined By | ||
---|---|---|---|
agalVersion : int = 1 [static] | FLSL | ||
blendMode : String
The blend mode used to blend between the fragment shaders. | FLSLFilter | ||
byteCode : ByteArray
Sets or gets the flsl byteCode associated with the filter. | FLSLFilter | ||
enabled : Boolean = true | FLSLFilter | ||
name : String
The name of the flsl object. | FLSL | ||
params : Object
Contains a collection of flsl public declarations. | FLSLScope | ||
passes : int [read-only]
Returns the number of passes required by the filter. | FLSLFilter | ||
semantic : String
The semantic which the object is associated. | FLSL | ||
source : String | FLSLFilter | ||
techniqueName : String
The name of the thecnique to use. | FLSLFilter |
Method | Defined By | ||
---|---|---|---|
FLSLFilter(byteCode:ByteArray = null, blendMode:String, techniqueName:String = null)
Creates a new FLSLFitler. | FLSLFilter | ||
bind(byteCode:ByteArray):void
Bind the compiled flsl code to be executed by the scope. | FLSLScope | ||
build():void
This forces to all materials containing this filter to be recompiled. | FLSLFilter | ||
call(ns:String, params:Array = null):uint
Call to a function stored in the scope. | FLSLScope | ||
FLSLFilter | |||
getTechniqueNames():Array
Retirms all technique names available in the scope. | FLSLScope | ||
process(scope:FLSLShader):void
This method is called when the filters are being proccessed by the associated Shader3D. | FLSLFilter |
blendMode | property |
blendMode:String
The blend mode used to blend between the fragment shaders. Blend function is only applied when the used technique have an output fragment set, otherwise the technique is executed but no blending operation is performed on it. In case that blendMode is set to null, and a technique name is defined as any function, both parameters, source and destination will be set to a destination color, allowing to the specified function to modify the destination color.
public function get blendMode():String
public function set blendMode(value:String):void
byteCode | property |
byteCode:ByteArray
Sets or gets the flsl byteCode associated with the filter.
public function get byteCode():ByteArray
public function set byteCode(value:ByteArray):void
enabled | property |
public var enabled:Boolean = true
passes | property |
passes:int
[read-only] Returns the number of passes required by the filter.
public function get passes():int
source | property |
public var source:String
techniqueName | property |
techniqueName:String
The name of the thecnique to use. If a null value is passed, the first technique is used.
public function get techniqueName():String
public function set techniqueName(value:String):void
FLSLFilter | () | Constructor |
public function FLSLFilter(byteCode:ByteArray = null, blendMode:String, techniqueName:String = null)
Creates a new FLSLFitler.
ParametersbyteCode:ByteArray (default = null ) — The pre-compiled flsl code.
| |
blendMode:String (default = NaN ) — The blend mode to be used to blend between fragment shaders. The blend mode could any of the BlendMode constants or any function inside of the current filter scope (ex: "myFilter.myBlendMode") in wich case the myBlendMode function should have a proper declaration: float4 myBlendMode( float4 src, float4 dest )
| |
techniqueName:String (default = null ) — The thecnique to be used. If a null value is passed, the first technique is used.
|
build | () | method |
public function build():void
This forces to all materials containing this filter to be recompiled. You should not call this method unless is strictly necesary. Some scenarios are when the filter/shader contains any conditional compilation that has changed or when a texture has changed its mip, filter, wrap or bias properties.
clone | () | method |
process | () | method |
public function process(scope:FLSLShader):void
This method is called when the filters are being proccessed by the associated Shader3D. Do not call this function by hand.
Parameters
scope:FLSLShader — The current scope where the filter is being proccesed.
|