Packageaway3d.materials
Classpublic class DefaultMaterialBase
InheritanceDefaultMaterialBase Inheritance MaterialBase Inheritance NamedAssetBase Inheritance flash.events.EventDispatcher
Subclasses ColorMaterial, TextureMaterial

DefaultMaterialBase forms an abstract base class for the default materials provided by Away3D and use methods to define their appearance.



Public Properties
 PropertyDefined By
  alphaBlending : Boolean
Indicate whether or not the material has transparency.
DefaultMaterialBase
 InheritedalphaPremultiplied : Boolean
Indicates whether visible textures (or other pixels) used by this material have already been premultiplied.
MaterialBase
  alphaThreshold : Number
The minimum alpha value for which pixels should be drawn.
DefaultMaterialBase
  ambient : Number
The strength of the ambient reflection.
DefaultMaterialBase
  ambientColor : uint
The colour of the ambient reflection.
DefaultMaterialBase
  ambientMethod : BasicAmbientMethod
The method to perform ambient shading.
DefaultMaterialBase
 InheritedassetFullPath : Array
[read-only]
NamedAssetBase
 InheritedassetNamespace : String
[read-only]
NamedAssetBase
 InheritedassetType : String
[read-only]
MaterialBase
 InheritedblendMode : String
The blend mode to use when drawing this renderable.
MaterialBase
 InheritedbothSides : Boolean
Defines whether or not the material should perform backface culling.
MaterialBase
  colorTransform : ColorTransform
The ColorTransform object to transform the colour of the material with.
DefaultMaterialBase
 InheriteddepthCompareMode : String
MaterialBase
  diffuseLightSources : uint
DefaultMaterialBase
  diffuseMethod : BasicDiffuseMethod
The method to perform diffuse shading.
DefaultMaterialBase
 Inheritedextra : Object
An object to contain any extra data
MaterialBase
  gloss : Number
The sharpness of the specular highlight.
DefaultMaterialBase
 InheritedlightPicker : LightPickerBase
MaterialBase
  mipmap : Boolean
[override] Indicates whether or not any used textures should use mipmapping.
DefaultMaterialBase
 Inheritedname : String
[override]
MaterialBase
  normalMap : Texture2DBase
The tangent space normal map to influence the direction of the surface for each texel.
DefaultMaterialBase
  normalMethod : BasicNormalMethod
The method to generate the (tangent-space) normal.
DefaultMaterialBase
  numMethods : int
[read-only]
DefaultMaterialBase
 InheritedoriginalName : String
[read-only] The original name used for this asset in the resource (e.g.
NamedAssetBase
 Inheritedrepeat : Boolean
Indicates whether or not any used textures should be tiled.
MaterialBase
  requiresBlending : Boolean
[override] [read-only] Indicates whether or not the material requires alpha blending during rendering.
DefaultMaterialBase
  shadowMethod : ShadowMapMethodBase
The method to render shadows cast on this surface.
DefaultMaterialBase
 Inheritedsmooth : Boolean
Indicates whether or not any used textures should use smoothing.
MaterialBase
  specular : Number
The overall strength of the specular reflection.
DefaultMaterialBase
  specularColor : uint
The colour of the specular reflection.
DefaultMaterialBase
  specularLightSources : uint
DefaultMaterialBase
  specularMap : Texture2DBase
A specular map that defines the strength of specular reflections for each texel in the red channel, and the gloss factor in the green channel.
DefaultMaterialBase
  specularMethod : BasicSpecularMethod
The method to perform specular shading.
DefaultMaterialBase
 InheriteduniqueId : uint
[read-only] The unique id assigned to the material by the MaterialLibrary.
MaterialBase
Protected Properties
 PropertyDefined By
 Inherited_depthCompareMode : String = less
MaterialBase
 Inherited_depthPass : DepthMapPass
MaterialBase
 Inherited_distancePass : DistanceMapPass
MaterialBase
 Inherited_mipmap : Boolean = true
MaterialBase
 Inherited_numPasses : uint
MaterialBase
 Inherited_passes : Vector.<MaterialPassBase>
MaterialBase
 Inherited_repeat : Boolean
MaterialBase
  _screenPass : DefaultScreenPass
DefaultMaterialBase
 Inherited_smooth : Boolean = true
MaterialBase
Public Methods
 MethodDefined By
  
Creates a new DefaultMaterialBase object.
DefaultMaterialBase
  
Adds a shading method to the end of the shader.
DefaultMaterialBase
  
addMethodAt(method:EffectMethodBase, index:int):void
Adds a shading method to the end of a shader, at the specified index amongst the methods in that section of the shader.
DefaultMaterialBase
 Inherited
assetPathEquals(name:String, ns:String):Boolean
NamedAssetBase
 Inherited
dispose():void
Cleans up any resources used by the current object.
MaterialBase
  
DefaultMaterialBase
  
hasMethod(method:EffectMethodBase):Boolean
DefaultMaterialBase
  
DefaultMaterialBase
 Inherited
resetAssetPath(name:String, ns:String = null, overrideOriginal:Boolean = true):void
NamedAssetBase
Protected Methods
 MethodDefined By
 Inherited
Adds a pass to the material
MaterialBase
 Inherited
Clears all passes in the material.
MaterialBase
Public Constants
 ConstantDefined By
 InheritedDEFAULT_NAMESPACE : String = default
[static]
NamedAssetBase
Property Detail
_screenPassproperty
protected var _screenPass:DefaultScreenPass

alphaBlendingproperty 
alphaBlending:Boolean

Indicate whether or not the material has transparency. If binary transparency is sufficient, for example when using textures of foliage, consider using alphaThreshold instead.


Implementation
    public function get alphaBlending():Boolean
    public function set alphaBlending(value:Boolean):void
alphaThresholdproperty 
alphaThreshold:Number

The minimum alpha value for which pixels should be drawn. This is used for transparency that is either invisible or entirely opaque, often used with textures for foliage, etc. Recommended values are 0 to disable alpha, or 0.5 to create smooth edges. Default value is 0 (disabled).


Implementation
    public function get alphaThreshold():Number
    public function set alphaThreshold(value:Number):void
ambientproperty 
ambient:Number

The strength of the ambient reflection.


Implementation
    public function get ambient():Number
    public function set ambient(value:Number):void
ambientColorproperty 
ambientColor:uint

The colour of the ambient reflection.


Implementation
    public function get ambientColor():uint
    public function set ambientColor(value:uint):void
ambientMethodproperty 
ambientMethod:BasicAmbientMethod

The method to perform ambient shading. Note that shading methods cannot be reused across materials.


Implementation
    public function get ambientMethod():BasicAmbientMethod
    public function set ambientMethod(value:BasicAmbientMethod):void
colorTransformproperty 
colorTransform:ColorTransform

The ColorTransform object to transform the colour of the material with.


Implementation
    public function get colorTransform():ColorTransform
    public function set colorTransform(value:ColorTransform):void
diffuseLightSourcesproperty 
diffuseLightSources:uint


Implementation
    public function get diffuseLightSources():uint
    public function set diffuseLightSources(value:uint):void
diffuseMethodproperty 
diffuseMethod:BasicDiffuseMethod

The method to perform diffuse shading. Note that shading methods can not be reused across materials.


Implementation
    public function get diffuseMethod():BasicDiffuseMethod
    public function set diffuseMethod(value:BasicDiffuseMethod):void
glossproperty 
gloss:Number

The sharpness of the specular highlight.


Implementation
    public function get gloss():Number
    public function set gloss(value:Number):void
mipmapproperty 
mipmap:Boolean[override]

Indicates whether or not any used textures should use mipmapping.


Implementation
    public function get mipmap():Boolean
    public function set mipmap(value:Boolean):void
normalMapproperty 
normalMap:Texture2DBase

The tangent space normal map to influence the direction of the surface for each texel.


Implementation
    public function get normalMap():Texture2DBase
    public function set normalMap(value:Texture2DBase):void
normalMethodproperty 
normalMethod:BasicNormalMethod

The method to generate the (tangent-space) normal. Note that shading methods can not be reused across materials.


Implementation
    public function get normalMethod():BasicNormalMethod
    public function set normalMethod(value:BasicNormalMethod):void
numMethodsproperty 
numMethods:int  [read-only]


Implementation
    public function get numMethods():int
requiresBlendingproperty 
requiresBlending:Boolean  [read-only] [override]

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


Implementation
    public function get requiresBlending():Boolean
shadowMethodproperty 
shadowMethod:ShadowMapMethodBase

The method to render shadows cast on this surface. Note that shading methods can not be reused across materials.


Implementation
    public function get shadowMethod():ShadowMapMethodBase
    public function set shadowMethod(value:ShadowMapMethodBase):void
specularproperty 
specular:Number

The overall strength of the specular reflection.


Implementation
    public function get specular():Number
    public function set specular(value:Number):void
specularColorproperty 
specularColor:uint

The colour of the specular reflection.


Implementation
    public function get specularColor():uint
    public function set specularColor(value:uint):void
specularLightSourcesproperty 
specularLightSources:uint


Implementation
    public function get specularLightSources():uint
    public function set specularLightSources(value:uint):void
specularMapproperty 
specularMap:Texture2DBase

A specular map that defines the strength of specular reflections for each texel in the red channel, and the gloss factor in the green channel. You can use SpecularBitmapTexture if you want to easily set specular and gloss maps from greyscale images, but prepared images are preffered.


Implementation
    public function get specularMap():Texture2DBase
    public function set specularMap(value:Texture2DBase):void
specularMethodproperty 
specularMethod:BasicSpecularMethod

The method to perform specular shading. Note that shading methods can not be reused across materials.


Implementation
    public function get specularMethod():BasicSpecularMethod
    public function set specularMethod(value:BasicSpecularMethod):void
Constructor Detail
DefaultMaterialBase()Constructor
public function DefaultMaterialBase()

Creates a new DefaultMaterialBase object.

Method Detail
activateForDepth()method
override 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)

addMethod()method 
public function addMethod(method:EffectMethodBase):void

Adds a shading method to the end of the shader. Note that shading methods can not be reused across materials.

Parameters

method:EffectMethodBase

addMethodAt()method 
public function addMethodAt(method:EffectMethodBase, index:int):void

Adds a shading method to the end of a shader, at the specified index amongst the methods in that section of the shader. Note that shading methods can not be reused across materials.

Parameters

method:EffectMethodBase
 
index:int

getMethodAt()method 
public function getMethodAt(index:int):EffectMethodBase

Parameters

index:int

Returns
EffectMethodBase
hasMethod()method 
public function hasMethod(method:EffectMethodBase):Boolean

Parameters

method:EffectMethodBase

Returns
Boolean
removeMethod()method 
public function removeMethod(method:EffectMethodBase):void

Parameters

method:EffectMethodBase

updateMaterial()method 
override arcane function updateMaterial(context:Context3D):void

Parameters

context:Context3D