Packageflare.flsl
Classpublic class FLSLMaterial
InheritanceFLSLMaterial Inheritance Material3D Inheritance flash.events.EventDispatcher
Subclasses NullMaterial, QuadMaterial, Shader3D

Creates a new FLSLMaterial. FLSLMaterial are used to create static pre-compiled flsl materials.



Public Properties
 PropertyDefined By
  blendMode : int
[override]
FLSLMaterial
  byteCode : ByteArray
Sets or gets the flsl byteCode associated with the material.
FLSLMaterial
 InheritedcullFace : String
The culling mode.
Material3D
  currentTextuesPath : String
[static] FLSL shaders can request textures to be loaded, they ussualy are placed in the same directory as the flsl compiled file.
FLSLMaterial
 InheriteddepthCompare : String = lessEqual
The test comparasion to be used when depthWrite is 'true'.
Material3D
 InheriteddepthWrite : Boolean = true
Gets or sets whatever the material writes into the z-buffer.
Material3D
 InheriteddestFactor : String
The factor with which to multiply the destination color.
Material3D
 Inheritedflags : uint
A 32bit flag to store different material properties.
Material3D
 InheritedmaterialAttributes : uint = 0
A 32bit flag values which defines the vertex attributes needed to render this particula material.
Material3D
 Inheritedname : String
The name of the material.
Material3D
  params : Object
Contains a collection of flsl public declarations.
FLSLMaterial
  programs : Vector.<FLSLProgram>
Get or sets a collection of FLSLProgram structures to be used by this material.
FLSLMaterial
 Inheritedscene : Scene3D
[read-only] Gets a reference to the scene that the material is associated.
Material3D
  semantics : Array
[static] Semantics are used to bind static data into specific flsl parameters.
FLSLMaterial
  source : String
Shader source code if available.
FLSLMaterial
 InheritedsourceFactor : String
The factor with which to multiply the source color.
Material3D
  techniqueName : String
The name of the thecnique to use.
FLSLMaterial
 Inheritedtransparent : Boolean
Sets or gets if the material should use alpha blending.
Material3D
 InheritedtwoSided : Boolean
Sets or gets if the material should be drawn useing both sides of the surfaces.
Material3D
Public Methods
 MethodDefined By
  
FLSLMaterial(name:String, byteCode:ByteArray = null, techniqueName:String = null, compileAll:Boolean = false)
Creates a new FLSLMaterial that are used to create static pre-compiled flsl materials.
FLSLMaterial
  
build():void
Compiles the material if it isn't already compiled.
FLSLMaterial
  
[override] Creates a clone of the FLSLMaterial.
FLSLMaterial
  
dispose():void
[override]
FLSLMaterial
 Inherited
download():void
Downloads all the data uploaded to the graphics card.
Material3D
 Inherited
draw(pivot:Pivot3D, surf:Surface3D, firstIndex:int = 0, count:int = -1):void
Draw a mesh surface using the current material.
Material3D
  
drawQuad(x:Number = 0, y:Number = 0, width:Number = -1, height:Number = -1):void
FLSLMaterial
  
getTechnique(name:String = null):Vector.<FLSLProgram>
FLSLMaterial
  
Retirms all technique names available in the current shader.
FLSLMaterial
  
getTextures(out:Vector.<Texture3D>):Vector.<Texture3D>
[override]
FLSLMaterial
  
rebuild():void
Forces to recompile the material.
FLSLMaterial
  
replaceTexture(source:Texture3D, replaceFor:Texture3D):void
[override]
FLSLMaterial
  
setTechnique(name:String = null):void
FLSLMaterial
 Inherited
upload(scene:Scene3D):void
Associates and link the material with the scene to be uploaded.
Material3D
 Inherited
validate(surf:Surface3D):Boolean
Validates that the surface is compatible with the material.
Material3D
Protected Methods
 MethodDefined By
 Inherited
context3DEvent(e:Event = null):void
Uploads the necesary data to the graphics card.
Material3D
Public Constants
 ConstantDefined By
 InheritedBLEND_ADDITIVE : int = 1
[static]
Material3D
 InheritedBLEND_ALPHA_BLENDED : int = 2
[static]
Material3D
 InheritedBLEND_MULTIPLY : int = 3
[static]
Material3D
 InheritedBLEND_NONE : int = 0
[static]
Material3D
 InheritedBLEND_SCREEN : int = 4
[static]
Material3D
 InheritedFLAG_MASK : uint
[static]
Material3D
 InheritedFLAG_SKIN1 : uint
[static]
Material3D
 InheritedFLAG_SKIN2 : uint
[static]
Material3D
 InheritedFLAG_SKIN3 : uint
[static]
Material3D
 InheritedFLAG_SKIN4 : uint
[static]
Material3D
Property Detail
blendModeproperty
blendMode:int[override]


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

Sets or gets the flsl byteCode associated with the material.


Implementation
    public function get byteCode():ByteArray
    public function set byteCode(value:ByteArray):void
currentTextuesPathproperty 
public static var currentTextuesPath:String

FLSL shaders can request textures to be loaded, they ussualy are placed in the same directory as the flsl compiled file. This property allows to modify the texture location path to be used when loading external files.

paramsproperty 
public var params:Object

Contains a collection of flsl public declarations. Params may contain cero or many FLSL object such as FLSLParam, FLSLMatrix and FLSLSampler objects.

See also

programsproperty 
programs:Vector.<FLSLProgram>

Get or sets a collection of FLSLProgram structures to be used by this material.


Implementation
    public function get programs():Vector.<FLSLProgram>
    public function set programs(value:Vector.<FLSLProgram>):void

See also

semanticsproperty 
public static var semantics:Array

Semantics are used to bind static data into specific flsl parameters. For example, an input POSITION myPosition is binded with the position attribute automatically, and the engine knows that a geometry position attribute needs to be passed as a value. Semantics could be vector number values, Matrix3D objects, or vertex attributes indices, but the semantic data type declared in the flsl code, should match the values of the semantics declared in the AS3 side.

sourceproperty 
public var source:String

Shader source code if available.

techniqueNameproperty 
techniqueName:String

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


Implementation
    public function get techniqueName():String
    public function set techniqueName(value:String):void
Constructor Detail
FLSLMaterial()Constructor
public function FLSLMaterial(name:String, byteCode:ByteArray = null, techniqueName:String = null, compileAll:Boolean = false)

Creates a new FLSLMaterial that are used to create static pre-compiled flsl materials.

Parameters
name:String — The name of the material.
 
byteCode:ByteArray (default = null) — The pre-compiled flsl binary code.
 
techniqueName:String (default = null) — The technique name of the flsl file to be used. If null, the first technique is used.
 
compileAll:Boolean (default = false)
Method Detail
build()method
public function build():void

Compiles the material if it isn't already compiled. You should not call to this method unless it's strictly necesary. Some scenarios are when the material contains any conditional compilation that has changed or when a texture has changed its mip, filter, wrap or bias properties.

clone()method 
override public function clone():Material3D

Creates a clone of the FLSLMaterial.

Returns
Material3D — A cloned FLSLMaterial.
dispose()method 
override public function dispose():void

drawQuad()method 
public function drawQuad(x:Number = 0, y:Number = 0, width:Number = -1, height:Number = -1):void

Parameters

x:Number (default = 0)
 
y:Number (default = 0)
 
width:Number (default = -1)
 
height:Number (default = -1)

getTechnique()method 
public function getTechnique(name:String = null):Vector.<FLSLProgram>

Parameters

name:String (default = null)

Returns
Vector.<FLSLProgram>
getTechniqueNames()method 
public function getTechniqueNames():Array

Retirms all technique names available in the current shader.

Returns
Array — An array with all the technique names.
getTextures()method 
override public function getTextures(out:Vector.<Texture3D>):Vector.<Texture3D>

Parameters

out:Vector.<Texture3D>

Returns
Vector.<Texture3D>
rebuild()method 
public function rebuild():void

Forces to recompile the material.

replaceTexture()method 
override public function replaceTexture(source:Texture3D, replaceFor:Texture3D):void

Parameters

source:Texture3D
 
replaceFor:Texture3D

setTechnique()method 
public function setTechnique(name:String = null):void

Parameters

name:String (default = null)