class: Material3D
Package: flare.materials
Class: public class Material3D
Inheritance: Material3Dàflash.events.EventDispatcher
Subclasses: Shader3D
The Material3D class represents a base for all materials.
Property Detail
cullFace property
public var cullFace:String
The culling mode. One of Context3DTriangleFace values.
depthCompare property
public var depthCompare:String = lessEqual
The test comparasion to be used when depthWrite is 'true'. Should be one of the values of Context3DCompareMode.
depthWrite property
public var depthWrite:Boolean = true
Gets or sets whatever the material writes into the z-buffer.
destFactor property
public var destFactor:String
The factor with which to multiply the destination color. should be one of Context3DBlendFactor values.
name property
public var name:String
The name of the material.
scene property
scene:Scene3D [read-only]
Gets a reference to the scene that the material is associated.
Implementation
public function get scene():Scene3D
sourceFactor property
public var sourceFactor:String
The factor with which to multiply the source color. should be one of Context3DBlendFactor values.
transparent property
transparent:Boolean
Sets or gets if the material should use alpha blending. This property changes the source and dest factor propertys.
Implementation
public function get transparent():Boolean
public function set transparent(value:Boolean):void
twoSided property
twoSided:Boolean
Sets or gets if the material should be drawn using both sides of the surfaces. This proeprty affects the cullFace property of the material.
Implementation
public function get twoSided():Boolean
public function set twoSided(value:Boolean):void
Constructor Detail
Material3D () Constructor
public function Material3D(name:String)
Creates a new Material3D.
Parameters name:String — Name of the material.
Method Detail
clone () method
public function clone():Material3D
Clones the material.
Returns Material3D — The new cloned material.
dispose () method
public function dispose():void
Eliminates all the resources associated to the material.
download () method
public function download():void
Downloads all the data uploaded to the graphics card.
draw () method
public function draw(pivot:Pivot3D, surf:Surface3D, firstIndex:int = 0, count:int = -1):void
Draw a mesh surface using the current material.
Parameters
pivot:Pivot3D — Pivot3D to be drawn.
surf:Surface3D — Surface3D to be drawn.
firstIndex:int (default = 0) — First triangle index to be drawn.
count:int (default = -1) — Number of triangles to be drawn.
upload () method
public function upload(scene:Scene3D):void
Uploads the necesary data to the graphics card.
Parameters
scene:Scene3D
class: ParticleMaterial3D
Package: flare.materials
Class: public class ParticleMaterial3D
Inheritance: ParticleMaterial3DàShader3DàMaterial3Dàflash.events.EventDispatcher
This is a helper material configured to use with particle emiters.
Constructor Detail
ParticleMaterial3D () Constructor
public function ParticleMaterial3D(name:String, filters:Array = null, enableLights:Boolean = false, technique:FLSLFilter = null)
Parameters
name:String
filters:Array (default = null)
enableLights:Boolean (default = false)
technique:FLSLFilter (default = null)
class:Shader3D
Package: flare.materials
Class: public class Shader3D
Inheritance: Shader3DàMaterial3Dàflash.events.EventDispatcher
Subclasses ParticleMaterial3D
The Shader3D class is a dynamic material to be used with filters.
Property Detail
enableLights property
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
filters property
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
globalFilters property
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.
program property
program:FLSLProgram3D [read-only]
Returns a shader program reference.
Implementation
public function get program():FLSLProgram3D
technique property
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
updateAllInstances property
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.
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_PARTICLE Constant
public static const VERTEX_HORIZONTAL_PARTICLE:FLSLFilter
VERTEX_NORMAL Constant
public static const VERTEX_NORMAL:FLSLFilter
VERTEX_PARTICLE Constant
public static const VERTEX_PARTICLE:FLSLFilter
VERTEX_SKIN Constant
public static const VERTEX_SKIN:FLSLFilter
VERTEX_VERTICAL_PARTICLE Constant
public static const VERTEX_VERTICAL_PARTICLE:FLSLFilter