Packageaway3d.materials
Classpublic class MultiPassMaterialBase
InheritanceMultiPassMaterialBase Inheritance MaterialBase Inheritance NamedAssetBase Inheritance flash.events.EventDispatcher
Subclasses ColorMultiPassMaterial, TextureMultiPassMaterial

MultiPassMaterialBase forms an abstract base class for the default multi-pass materials provided by Away3D, using material methods to define their appearance.



Public Properties
 PropertyDefined By
 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.
MultiPassMaterialBase
  ambient : Number
The strength of the ambient reflection.
MultiPassMaterialBase
  ambientColor : uint
The colour of the ambient reflection.
MultiPassMaterialBase
  ambientMethod : BasicAmbientMethod
The method that provides the ambient lighting contribution.
MultiPassMaterialBase
 InheritedassetFullPath : Array
[read-only]
NamedAssetBase
 InheritedassetNamespace : String
[read-only]
NamedAssetBase
 InheritedassetType : String
[read-only] The type of the asset.
MaterialBase
  blendMode : String
[override] The blend mode to use when drawing this renderable.
MultiPassMaterialBase
 InheritedbothSides : Boolean
Defines whether or not the material should cull triangles facing away from the camera.
MaterialBase
  depthCompareMode : String
[override] The depth compare mode used to render the renderables using this material.
MultiPassMaterialBase
  diffuseLightSources : uint
Define which light source types to use for diffuse reflections.
MultiPassMaterialBase
  diffuseMethod : BasicDiffuseMethod
The method that provides the diffuse lighting contribution.
MultiPassMaterialBase
  enableLightFallOff : Boolean
Whether or not to use fallOff and radius properties for lights.
MultiPassMaterialBase
 Inheritedextra : Object
An object to contain any extra data.
MaterialBase
  gloss : Number
The glossiness of the material (sharpness of the specular highlight).
MultiPassMaterialBase
 Inheritedid : String
NamedAssetBase
  lightPicker : LightPickerBase
[override] The light picker used by the material to provide lights to the material if it supports lighting.
MultiPassMaterialBase
  mipmap : Boolean
[override] Indicates whether or not any used textures should use mipmapping.
MultiPassMaterialBase
 Inheritedname : String
NamedAssetBase
  normalMap : Texture2DBase
The normal map to modulate the direction of the surface for each texel.
MultiPassMaterialBase
  normalMethod : BasicNormalMethod
The method used to generate the per-pixel normals.
MultiPassMaterialBase
  numMethods : int
[read-only] The number of "effect" methods added to the material.
MultiPassMaterialBase
 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.
MultiPassMaterialBase
  shadowMethod : ShadowMapMethodBase
The method used to render shadows cast on this surface, or null if no shadows are to be rendered.
MultiPassMaterialBase
 Inheritedsmooth : Boolean
Indicates whether or not any used textures should use smoothing.
MaterialBase
  specular : Number
The overall strength of the specular reflection.
MultiPassMaterialBase
  specularColor : uint
The colour of the specular reflection.
MultiPassMaterialBase
  specularLightSources : uint
Define which light source types to use for specular reflections.
MultiPassMaterialBase
  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.
MultiPassMaterialBase
  specularMethod : BasicSpecularMethod
The method that provides the specular lighting contribution.
MultiPassMaterialBase
 InheriteduniqueId : uint
[read-only] An id for this material used to sort the renderables by material, which reduces render state changes across materials using the same Program3D.
MaterialBase
Protected Properties
 PropertyDefined By
  _casterLightPass : ShadowCasterPass
MultiPassMaterialBase
 Inherited_depthPass : DepthMapPass
MaterialBase
 Inherited_distancePass : DistanceMapPass
MaterialBase
  _effectsPass : SuperShaderPass
MultiPassMaterialBase
 Inherited_lightPicker : LightPickerBase
MaterialBase
 Inherited_mipmap : Boolean = true
MaterialBase
  _nonCasterLightPasses : Vector.<LightingPass>
MultiPassMaterialBase
 Inherited_numPasses : uint
MaterialBase
 Inherited_passes : Vector.<MaterialPassBase>
MaterialBase
 Inherited_repeat : Boolean
MaterialBase
 Inherited_smooth : Boolean = true
MaterialBase
Public Methods
 MethodDefined By
  
Creates a new MultiPassMaterialBase object.
MultiPassMaterialBase
  
Appends an "effect" shading method to the shader.
MultiPassMaterialBase
  
addMethodAt(method:EffectMethodBase, index:int):void
Adds an effect method at the specified index amongst the methods already added to the material.
MultiPassMaterialBase
 Inherited
assetPathEquals(name:String, ns:String):Boolean
NamedAssetBase
 Inherited
dispose():void
Cleans up resources owned by the material, including passes.
MaterialBase
  
Returns the method added at the given index.
MultiPassMaterialBase
  
hasMethod(method:EffectMethodBase):Boolean
Queries whether a given effect method was added to the material.
MultiPassMaterialBase
  
Removes an effect method from the material.
MultiPassMaterialBase
 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
Removes all passes from the material
MaterialBase
  
Flags that the screen passes have become invalid.
MultiPassMaterialBase
 Inherited
Removes a pass from the material.
MaterialBase
  
Updates screen passes when they were found to be invalid.
MultiPassMaterialBase
Public Constants
 ConstantDefined By
 InheritedDEFAULT_NAMESPACE : String = default
[static]
NamedAssetBase
Property Detail
_casterLightPassproperty
protected var _casterLightPass:ShadowCasterPass

_effectsPassproperty 
protected var _effectsPass:SuperShaderPass

_nonCasterLightPassesproperty 
protected var _nonCasterLightPasses:Vector.<LightingPass>

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 that provides the ambient lighting contribution. Defaults to BasicAmbientMethod.


Implementation
    public function get ambientMethod():BasicAmbientMethod
    public function set ambientMethod(value:BasicAmbientMethod):void
blendModeproperty 
blendMode:String[override]

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
depthCompareModeproperty 
depthCompareMode:String[override]

The depth compare mode used to render the renderables using this material.


Implementation
    public function get depthCompareMode():String
    public function set depthCompareMode(value:String):void
diffuseLightSourcesproperty 
diffuseLightSources:uint

Define which light source types to use for diffuse reflections. This allows choosing between regular lights and/or light probes for diffuse reflections.


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

See also

diffuseMethodproperty 
diffuseMethod:BasicDiffuseMethod

The method that provides the diffuse lighting contribution. Defaults to BasicDiffuseMethod.


Implementation
    public function get diffuseMethod():BasicDiffuseMethod
    public function set diffuseMethod(value:BasicDiffuseMethod):void
enableLightFallOffproperty 
enableLightFallOff:Boolean

Whether or not to use fallOff and radius properties for lights. This can be used to improve performance and compatibility for constrained mode.


Implementation
    public function get enableLightFallOff():Boolean
    public function set enableLightFallOff(value:Boolean):void
glossproperty 
gloss:Number

The glossiness of the material (sharpness of the specular highlight).


Implementation
    public function get gloss():Number
    public function set gloss(value:Number):void
lightPickerproperty 
lightPicker:LightPickerBase[override]

The light picker used by the material to provide lights to the material if it supports lighting.


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

Indicates whether or not any used textures should use mipmapping. Defaults to true.


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

The normal map to modulate the direction of the surface for each texel. The default normal method expects tangent-space normal maps, but others could expect object-space maps.


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

The method used to generate the per-pixel normals. Defaults to BasicNormalMethod.


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

The number of "effect" methods added to the material.


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 used to render shadows cast on this surface, or null if no shadows are to be rendered. Defaults to null.


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

Define which light source types to use for specular reflections. This allows choosing between regular lights and/or light probes for specular reflections.


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

See also

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 grayscale images, but correctly authored images are preferred.


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

The method that provides the specular lighting contribution. Defaults to BasicSpecularMethod.


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

Creates a new MultiPassMaterialBase object.

Method Detail
activateForDepth()method
override arcane function activateForDepth(stage3DProxy:Stage3DProxy, camera:Camera3D, distanceBased:Boolean = false):void

Parameters

stage3DProxy:Stage3DProxy
 
camera:Camera3D
 
distanceBased:Boolean (default = false)

activatePass()method 
override arcane function activatePass(index:uint, stage3DProxy:Stage3DProxy, camera:Camera3D):void

Parameters

index:uint
 
stage3DProxy:Stage3DProxy
 
camera:Camera3D

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

Appends an "effect" shading method to the shader. Effect methods are those that do not influence the lighting but modulate the shaded colour, used for fog, outlines, etc. The method will be applied to the result of the methods added prior.

Parameters

method:EffectMethodBase

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

Adds an effect method at the specified index amongst the methods already added to the material. Effect methods are those that do not influence the lighting but modulate the shaded colour, used for fog, outlines, etc. The method will be applied to the result of the methods with a lower index.

Parameters

method:EffectMethodBase
 
index:int

deactivate()method 
override arcane function deactivate(stage3DProxy:Stage3DProxy):void

Parameters

stage3DProxy:Stage3DProxy

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

Returns the method added at the given index.

Parameters

index:int — The index of the method to retrieve.

Returns
EffectMethodBase — The method at the given index.
hasMethod()method 
public function hasMethod(method:EffectMethodBase):Boolean

Queries whether a given effect method was added to the material.

Parameters

method:EffectMethodBase — The method to be queried.

Returns
Boolean — true if the method was added to the material, false otherwise.
invalidateScreenPasses()method 
protected function invalidateScreenPasses():void

Flags that the screen passes have become invalid.

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

Removes an effect method from the material.

Parameters

method:EffectMethodBase — The method to be removed.

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

Parameters

context:Context3D

updateScreenPasses()method 
protected function updateScreenPasses():void

Updates screen passes when they were found to be invalid.