Packageflare.materials
Classpublic class Shader3D
InheritanceShader3D Inheritance Material3D Inheritance flash.events.EventDispatcher
Subclasses ParticleMaterial3D

The Shader3D class is a dynamic material to be used with filters.



Public Properties
 PropertyDefined By
 InheritedcullFace : String
The culling mode.
Material3D
 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
  enableLights : Boolean
Sets or gets if the material is affected by scene lights.
Shader3D
  filters : Array
Gets or sets an indexed Array of filters to use in the material.
Shader3D
  globalFilters : Array
[static] Defines an array of filters to be included on the materials that will be created after setting the global filters property.
Shader3D
 Inheritedname : String
The name of the material.
Material3D
  program : FLSLProgram3D
[read-only] Returns a shader program reference.
Shader3D
 Inheritedscene : Scene3D
[read-only] Gets a reference to the scene that the material is associated.
Material3D
 InheritedsourceFactor : String
The factor with which to multiply the source color.
Material3D
  technique : FLSLFilter
Sets ot get the current method used for the vertex transform.
Shader3D
 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
  updateAllInstances : Boolean = false
Sets or returns whatever the shader should force to update the material parameters for each shader instance separately.
Shader3D
Public Methods
 MethodDefined By
  
Shader3D(name:String, filters:Array = null, enableLights:Boolean = true, technique:FLSLFilter = null)
Creates a new dynamic filter Material.
Shader3D
  
build():void
Force to recompile the material.
Shader3D
 Inherited
Clones the material.
Material3D
 Inherited
dispose():void
Eliminates all the resources associated to the material.
Material3D
 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
 Inherited
upload(scene:Scene3D):void
Uploads the necesary data to the graphics card.
Material3D
Events
 Event Summary Defined By
  This event is dispatched when material filters has been changed or the material is re compiled.Shader3D
Public Constants
 ConstantDefined By
  VERTEX_HORIZONTAL_PARTICLE : FLSLFilter
[static]
Shader3D
  VERTEX_NORMAL : FLSLFilter
[static]
Shader3D
  VERTEX_PARTICLE : FLSLFilter
[static]
Shader3D
  VERTEX_SKIN : FLSLFilter
[static]
Shader3D
  VERTEX_VERTICAL_PARTICLE : FLSLFilter
[static]
Shader3D
Property Detail
enableLightsproperty
enableLights:Boolean

Sets or gets if the material is affected by scene lights.


Implementation
    public function get enableLights():Boolean
    public function set enableLights(value:Boolean):void
filtersproperty 
filters:Array

Gets or sets an indexed Array of filters to use in the material.


Implementation
    public function get filters():Array
    public function set filters(value:Array):void

See also

globalFiltersproperty 
public static var globalFilters:Array

Defines an array of filters to be included on the materials that will be created after setting the global filters property. If the globalFilters array changes after the materials were compiled, you will need to call to build() mehotd again to recompile the shader. You can use this propery to apply a fog or color filter to all scene materials for example, but this property should be defined before the creation of the materials. You can change this property at any time, but it will only affect to those materials that are created after.

programproperty 
program:FLSLProgram3D  [read-only]

Returns a shader program reference.


Implementation
    public function get program():FLSLProgram3D
techniqueproperty 
technique:FLSLFilter

Sets ot get the current method used for the vertex transform. Should be one of the constants defined VERTEX_NORMAL or VERTEX_SKIN.


Implementation
    public function get technique():FLSLFilter
    public function set technique(value:FLSLFilter):void

See also

updateAllInstancesproperty 
public var updateAllInstances:Boolean = false

Sets or returns whatever the shader should force to update the material parameters for each shader instance separately. If the value is false, all instaces will be updated to the same values.

Constructor Detail
Shader3D()Constructor
public function Shader3D(name:String, filters:Array = null, enableLights:Boolean = true, technique:FLSLFilter = null)

Creates a new dynamic filter Material.

Parameters
name:String — The name of the material.
 
filters:Array (default = null) — Filters to use in the material.
 
enableLights:Boolean (default = true) — Sets if the material is affected by scene lights.
 
technique:FLSLFilter (default = null) — The current method used for the vertex transform. Should be one of the constants defined VERTEX_NORMAL or VERTEX_SKIN.
Method Detail
build()method
public function build():void

Force to recompile the material. If don't need to call this method if you set the filters in the constructor or if you pass directly an array of filters to the filters property.

See also

Event Detail
changed Event
Event Object Type: flash.events.Event
Event.type property = flash.events.Event

This event is dispatched when material filters has been changed or the material is re compiled.

Constant Detail
VERTEX_HORIZONTAL_PARTICLEConstant
public static const VERTEX_HORIZONTAL_PARTICLE:FLSLFilter

VERTEX_NORMALConstant 
public static const VERTEX_NORMAL:FLSLFilter

VERTEX_PARTICLEConstant 
public static const VERTEX_PARTICLE:FLSLFilter

VERTEX_SKINConstant 
public static const VERTEX_SKIN:FLSLFilter

VERTEX_VERTICAL_PARTICLEConstant 
public static const VERTEX_VERTICAL_PARTICLE:FLSLFilter