Packageaway3d.materials
Classpublic class MaterialBase
InheritanceMaterialBase Inheritance NamedAssetBase Inheritance flash.events.EventDispatcher
Implements IAsset
Subclasses DefaultMaterialBase, SegmentMaterial, SkyBoxMaterial

MaterialBase forms an abstract base class for any material. Vertex stream index 0 is reserved for vertex positions. Vertex shader constants index 0-3 are reserved for projections, constant 4 for viewport positioning



Public Properties
 PropertyDefined By
  alphaPremultiplied : Boolean
Indicates whether visible textures (or other pixels) used by this material have already been premultiplied.
MaterialBase
 InheritedassetFullPath : Array
[read-only]
NamedAssetBase
 InheritedassetNamespace : String
[read-only]
NamedAssetBase
  assetType : String
[read-only]
MaterialBase
  blendMode : String
The blend mode to use when drawing this renderable.
MaterialBase
  bothSides : Boolean
Defines whether or not the material should perform backface culling.
MaterialBase
  depthCompareMode : String
MaterialBase
  extra : Object
An object to contain any extra data
MaterialBase
  lightPicker : LightPickerBase
MaterialBase
  mipmap : Boolean
Indicates whether or not any used textures should use mipmapping.
MaterialBase
  name : String
[override]
MaterialBase
 InheritedoriginalName : String
[read-only] The original name used for this asset in the resource (e.g.
NamedAssetBase
  repeat : Boolean
Indicates whether or not any used textures should be tiled.
MaterialBase
  requiresBlending : Boolean
[read-only] Indicates whether or not the material requires alpha blending during rendering.
MaterialBase
  smooth : Boolean
Indicates whether or not any used textures should use smoothing.
MaterialBase
  uniqueId : uint
[read-only] The unique id assigned to the material by the MaterialLibrary.
MaterialBase
Protected Properties
 PropertyDefined By
  _depthCompareMode : String = less
MaterialBase
  _depthPass : DepthMapPass
MaterialBase
  _distancePass : DistanceMapPass
MaterialBase
  _mipmap : Boolean = true
MaterialBase
  _numPasses : uint
MaterialBase
  _passes : Vector.<MaterialPassBase>
MaterialBase
  _repeat : Boolean
MaterialBase
  _smooth : Boolean = true
MaterialBase
Public Methods
 MethodDefined By
  
Creates a new MaterialBase object.
MaterialBase
 Inherited
assetPathEquals(name:String, ns:String):Boolean
NamedAssetBase
  
dispose():void
Cleans up any resources used by the current object.
MaterialBase
 Inherited
resetAssetPath(name:String, ns:String = null, overrideOriginal:Boolean = true):void
NamedAssetBase
Protected Methods
 MethodDefined By
  
Adds a pass to the material
MaterialBase
  
Clears all passes in the material.
MaterialBase
Public Constants
 ConstantDefined By
 InheritedDEFAULT_NAMESPACE : String = default
[static]
NamedAssetBase
Property Detail
_classificationproperty
arcane var _classification:String

_depthCompareModeproperty 
protected var _depthCompareMode:String = less

_depthPassproperty 
protected var _depthPass:DepthMapPass

_distancePassproperty 
protected var _distancePass:DistanceMapPass

_mipmapproperty 
protected var _mipmap:Boolean = true

_nameproperty 
arcane var _name:String = material

_numPassesproperty 
protected var _numPasses:uint

_passesproperty 
protected var _passes:Vector.<MaterialPassBase>

_renderOrderIdproperty 
arcane var _renderOrderId:int

_repeatproperty 
protected var _repeat:Boolean

_smoothproperty 
protected var _smooth:Boolean = true

_uniqueIdproperty 
arcane var _uniqueId:uint

alphaPremultipliedproperty 
alphaPremultiplied:Boolean

Indicates whether visible textures (or other pixels) used by this material have already been premultiplied. Toggle this if you are seeing black halos around your blended alpha edges.


Implementation
    public function get alphaPremultiplied():Boolean
    public function set alphaPremultiplied(value:Boolean):void
assetTypeproperty 
assetType:String  [read-only]


Implementation
    public function get assetType():String
blendModeproperty 
blendMode:String

The blend mode to use when drawing this renderable. The following blend modes are supported:


Implementation
    public function get blendMode():String
    public function set blendMode(value:String):void
bothSidesproperty 
bothSides:Boolean

Defines whether or not the material should perform backface culling.


Implementation
    public function get bothSides():Boolean
    public function set bothSides(value:Boolean):void
depthCompareModeproperty 
depthCompareMode:String


Implementation
    public function get depthCompareMode():String
    public function set depthCompareMode(value:String):void
extraproperty 
public var extra:Object

An object to contain any extra data

lightPickerproperty 
lightPicker:LightPickerBase


Implementation
    public function get lightPicker():LightPickerBase
    public function set lightPicker(value:LightPickerBase):void
mipmapproperty 
mipmap:Boolean

Indicates whether or not any used textures should use mipmapping.


Implementation
    public function get mipmap():Boolean
    public function set mipmap(value:Boolean):void
nameproperty 
name:String[override]


Implementation
    public function get name():String
    public function set name(value:String):void
repeatproperty 
repeat:Boolean

Indicates whether or not any used textures should be tiled.


Implementation
    public function get repeat():Boolean
    public function set repeat(value:Boolean):void
requiresBlendingproperty 
requiresBlending:Boolean  [read-only]

Indicates whether or not the material requires alpha blending during rendering.


Implementation
    public function get requiresBlending():Boolean
smoothproperty 
smooth:Boolean

Indicates whether or not any used textures should use smoothing.


Implementation
    public function get smooth():Boolean
    public function set smooth(value:Boolean):void
uniqueIdproperty 
uniqueId:uint  [read-only]

The unique id assigned to the material by the MaterialLibrary.


Implementation
    public function get uniqueId():uint
Constructor Detail
MaterialBase()Constructor
public function MaterialBase()

Creates a new MaterialBase object.

Method Detail
activateForDepth()method
arcane function activateForDepth(stage3DProxy:Stage3DProxy, camera:Camera3D, distanceBased:Boolean = false, textureRatioX:Number = 1, textureRatioY:Number = 1):void

Parameters

stage3DProxy:Stage3DProxy
 
camera:Camera3D
 
distanceBased:Boolean (default = false)
 
textureRatioX:Number (default = 1)
 
textureRatioY:Number (default = 1)

addPass()method 
protected function addPass(pass:MaterialPassBase):void

Adds a pass to the material

Parameters

pass:MaterialPassBase

clearPasses()method 
protected function clearPasses():void

Clears all passes in the material.

deactivateForDepth()method 
arcane function deactivateForDepth(stage3DProxy:Stage3DProxy):void

Parameters

stage3DProxy:Stage3DProxy

dispose()method 
public function dispose():void

Cleans up any resources used by the current object.

invalidatePasses()method 
arcane function invalidatePasses(triggerPass:MaterialPassBase):void

Marks the depth shader program as invalid, so it will be recompiled before the next render.

Parameters

triggerPass:MaterialPassBase — The pass triggering the invalidation, if any, so no infinite loop will occur.

passRendersToTexture()method 
arcane function passRendersToTexture(index:uint):Boolean

Parameters

index:uint

Returns
Boolean
renderDepth()method 
arcane function renderDepth(renderable:IRenderable, stage3DProxy:Stage3DProxy, camera:Camera3D):void

Parameters

renderable:IRenderable
 
stage3DProxy:Stage3DProxy
 
camera:Camera3D