Packageflare.flsl
Classpublic class FLSLFilter
InheritanceFLSLFilter Inheritance FLSLScope Inheritance FLSL Inheritance 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

FLSLFilters are small pieces of pre compiled flsl shaders to be used in Shader3D materials.

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

Shader3D.
FLSLMaterial.


Public Properties
 PropertyDefined By
 InheritedagalVersion : 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
 Inheritedname : String
The name of the flsl object.
FLSL
 Inheritedparams : Object
Contains a collection of flsl public declarations.
FLSLScope
  passes : int
[read-only] Returns the number of passes required by the filter.
FLSLFilter
 Inheritedsemantic : String
The semantic which the object is associated.
FLSL
  source : String
FLSLFilter
  techniqueName : String
The name of the thecnique to use.
FLSLFilter
Public Methods
 MethodDefined By
  
FLSLFilter(byteCode:ByteArray = null, blendMode:String, techniqueName:String = null)
Creates a new FLSLFitler.
FLSLFilter
 Inherited
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
 Inherited
call(ns:String, params:Array = null):uint
Call to a function stored in the scope.
FLSLScope
  
FLSLFilter
 Inherited
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
Property Detail
blendModeproperty
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.


Implementation
    public function get blendMode():String
    public function set blendMode(value:String):void
byteCodeproperty 
byteCode:ByteArray

Sets or gets the flsl byteCode associated with the filter.


Implementation
    public function get byteCode():ByteArray
    public function set byteCode(value:ByteArray):void
enabledproperty 
public var enabled:Boolean = true

passesproperty 
passes:int  [read-only]

Returns the number of passes required by the filter.


Implementation
    public function get passes():int
sourceproperty 
public var source:String

techniqueNameproperty 
techniqueName:String

The name of the thecnique to use. If a null value is passed, the first technique is used.


Implementation
    public function get techniqueName():String
    public function set techniqueName(value:String):void
Constructor Detail
FLSLFilter()Constructor
public function FLSLFilter(byteCode:ByteArray = null, blendMode:String, techniqueName:String = null)

Creates a new FLSLFitler.

Parameters
byteCode: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.
Method Detail
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 
public function clone():FLSLFilter

Returns
FLSLFilter
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.