Packageflare.materials
Classpublic class Material3D
InheritanceMaterial3D Inheritance flash.events.EventDispatcher
Subclasses FLSLMaterial

The Material3D class represents a base for all materials.



Public Properties
 PropertyDefined By
  blendMode : int
Material3D
  cullFace : String
The culling mode.
Material3D
  depthCompare : String = lessEqual
The test comparasion to be used when depthWrite is 'true'.
Material3D
  depthWrite : Boolean = true
Gets or sets whatever the material writes into the z-buffer.
Material3D
  destFactor : String
The factor with which to multiply the destination color.
Material3D
  flags : uint
A 32bit flag to store different material properties.
Material3D
  materialAttributes : uint = 0
A 32bit flag values which defines the vertex attributes needed to render this particula material.
Material3D
  name : String
The name of the material.
Material3D
  scene : Scene3D
[read-only] Gets a reference to the scene that the material is associated.
Material3D
  sourceFactor : String
The factor with which to multiply the source color.
Material3D
  transparent : Boolean
Sets or gets if the material should use alpha blending.
Material3D
  twoSided : Boolean
Sets or gets if the material should be drawn useing both sides of the surfaces.
Material3D
Public Methods
 MethodDefined By
  
Material3D(name:String)
Creates a new Material3D.
Material3D
  
Clones the material.
Material3D
  
dispose():void
Eliminates all the resources associated to the material.
Material3D
  
download():void
Downloads all the data uploaded to the graphics card.
Material3D
  
draw(pivot:Pivot3D, surf:Surface3D, firstIndex:int = 0, count:int = -1):void
Draw a mesh surface using the current material.
Material3D
  
getTextures(out:Vector.<Texture3D>):Vector.<Texture3D>
Material3D
  
replaceTexture(source:Texture3D, replaceFor:Texture3D):void
Material3D
  
upload(scene:Scene3D):void
Associates and link the material with the scene to be uploaded.
Material3D
  
validate(surf:Surface3D):Boolean
Validates that the surface is compatible with the material.
Material3D
Protected Methods
 MethodDefined By
  
context3DEvent(e:Event = null):void
Uploads the necesary data to the graphics card.
Material3D
Public Constants
 ConstantDefined By
  BLEND_ADDITIVE : int = 1
[static]
Material3D
  BLEND_ALPHA_BLENDED : int = 2
[static]
Material3D
  BLEND_MULTIPLY : int = 3
[static]
Material3D
  BLEND_NONE : int = 0
[static]
Material3D
  BLEND_SCREEN : int = 4
[static]
Material3D
  FLAG_MASK : uint
[static]
Material3D
  FLAG_SKIN1 : uint
[static]
Material3D
  FLAG_SKIN2 : uint
[static]
Material3D
  FLAG_SKIN3 : uint
[static]
Material3D
  FLAG_SKIN4 : uint
[static]
Material3D
Property Detail
blendModeproperty
blendMode:int


Implementation
    public function get blendMode():int
    public function set blendMode(value:int):void
cullFaceproperty 
public var cullFace:String

The culling mode. One of Context3DTriangleFace values.

depthCompareproperty 
public var depthCompare:String = lessEqual

The test comparasion to be used when depthWrite is 'true'. Should be one of the values of Context3DCompareMode.

depthWriteproperty 
public var depthWrite:Boolean = true

Gets or sets whatever the material writes into the z-buffer.

destFactorproperty 
public var destFactor:String

The factor with which to multiply the destination color. Souldd be one of Context3DBlendFactor values.

flagsproperty 
public var flags:uint

A 32bit flag to store different material properties.

materialAttributesproperty 
public var materialAttributes:uint = 0

A 32bit flag values which defines the vertex attributes needed to render this particula material. Do not change this value, it is automatically updated when compiling the materials.

See also

nameproperty 
public var name:String

The name of the material.

sceneproperty 
scene:Scene3D  [read-only]

Gets a reference to the scene that the material is associated.


Implementation
    public function get scene():Scene3D
sourceFactorproperty 
public var sourceFactor:String

The factor with which to multiply the source color. Souldd be one of Context3DBlendFactor values.

transparentproperty 
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
twoSidedproperty 
twoSided:Boolean

Sets or gets if the material should be drawn useing 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.
context3DEvent()method 
protected function context3DEvent(e:Event = null):void

Uploads the necesary data to the graphics card.

Parameters

e:Event (default = null) — The event associated to the Context3D.

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.

getTextures()method 
public function getTextures(out:Vector.<Texture3D>):Vector.<Texture3D>

Parameters

out:Vector.<Texture3D>

Returns
Vector.<Texture3D>
replaceTexture()method 
public function replaceTexture(source:Texture3D, replaceFor:Texture3D):void

Parameters

source:Texture3D
 
replaceFor:Texture3D

upload()method 
public function upload(scene:Scene3D):void

Associates and link the material with the scene to be uploaded.

Parameters

scene:Scene3D

validate()method 
public function validate(surf:Surface3D):Boolean

Validates that the surface is compatible with the material.

Parameters

surf:Surface3D — The surface to validate.

Returns
Boolean
Constant Detail
BLEND_ADDITIVEConstant
public static const BLEND_ADDITIVE:int = 1

BLEND_ALPHA_BLENDEDConstant 
public static const BLEND_ALPHA_BLENDED:int = 2

BLEND_MULTIPLYConstant 
public static const BLEND_MULTIPLY:int = 3

BLEND_NONEConstant 
public static const BLEND_NONE:int = 0

BLEND_SCREENConstant 
public static const BLEND_SCREEN:int = 4

FLAG_MASKConstant 
public static const FLAG_MASK:uint

FLAG_SKIN1Constant 
public static const FLAG_SKIN1:uint

FLAG_SKIN2Constant 
public static const FLAG_SKIN2:uint

FLAG_SKIN3Constant 
public static const FLAG_SKIN3:uint

FLAG_SKIN4Constant 
public static const FLAG_SKIN4:uint