Packageaway3d.materials.passes
Classpublic class CompiledPass
InheritanceCompiledPass Inheritance MaterialPassBase Inheritance flash.events.EventDispatcher
Subclasses LightingPass, ShadowCasterPass, SuperShaderPass

CompiledPass forms an abstract base class for the default compiled 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.
MaterialPassBase
  ambientMethod : BasicAmbientMethod
The method that provides the ambient lighting contribution.
CompiledPass
  animateUVs : Boolean
Indicate whether UV coordinates need to be animated using the renderable's transformUV matrix.
CompiledPass
 InheritedanimationRegisterCache : AnimationRegisterCache
MaterialPassBase
 InheritedanimationSet : IAnimationSet
Returns the animation data set adding animations to the material.
MaterialPassBase
 InheritedbothSides : Boolean
Defines whether or not the material should perform backface culling.
MaterialPassBase
 InheriteddepthCompareMode : String
The depth compare mode used to render the renderables using this material.
MaterialPassBase
  diffuseLightSources : uint
Define which light source types to use for diffuse reflections.
CompiledPass
  diffuseMethod : BasicDiffuseMethod
The method that provides the diffuse lighting contribution.
CompiledPass
  enableLightFallOff : Boolean
Whether or not to use fallOff and radius properties for lights.
CompiledPass
  forceSeparateMVP : Boolean
Indicates whether the screen projection should be calculated by forcing a separate scene matrix and view-projection matrix.
CompiledPass
 Inheritedmaterial : MaterialBase
The material to which this pass belongs.
MaterialPassBase
  mipmap : Boolean
[override] Defines whether any used textures should use mipmapping.
CompiledPass
 InheritedneedFragmentAnimation : Boolean
[read-only]
MaterialPassBase
 InheritedneedUVAnimation : Boolean
[read-only] Indicates whether the pass requires any UV animatin code.
MaterialPassBase
  normalMap : Texture2DBase
The normal map to modulate the direction of the surface for each texel.
CompiledPass
  normalMethod : BasicNormalMethod
The method used to generate the per-pixel normals.
CompiledPass
 InheritednumUsedFragmentConstants : uint
[read-only] The amount of used fragment constants in the fragment code.
MaterialPassBase
 InheritednumUsedStreams : uint
[read-only] The amount of used vertex streams in the vertex code.
MaterialPassBase
 InheritednumUsedVaryings : uint
[read-only]
MaterialPassBase
 InheritednumUsedVertexConstants : uint
[read-only] The amount of used vertex constants in the vertex code.
MaterialPassBase
  preserveAlpha : Boolean
Indicates whether the output alpha value should remain unchanged compared to the material's original alpha.
CompiledPass
 InheritedrenderToTexture : Boolean
[read-only] Specifies whether this pass renders to texture
MaterialPassBase
 Inheritedrepeat : Boolean
Defines whether textures should be tiled.
MaterialPassBase
  shadowMethod : ShadowMapMethodBase
The method used to render shadows cast on this surface, or null if no shadows are to be rendered.
CompiledPass
 Inheritedsmooth : Boolean
Defines whether smoothing should be applied to any used textures.
MaterialPassBase
  specularLightSources : uint
Define which light source types to use for specular reflections.
CompiledPass
  specularMethod : BasicSpecularMethod
The method that provides the specular lighting contribution.
CompiledPass
 InheritedwriteDepth : Boolean
Indicate whether this pass should write to the depth buffer or not.
MaterialPassBase
Protected Properties
 PropertyDefined By
 Inherited_alphaPremultiplied : Boolean
MaterialPassBase
  _ambientLightB : Number
CompiledPass
  _ambientLightG : Number
CompiledPass
  _ambientLightR : Number
CompiledPass
 Inherited_animatableAttributes : Vector.<String>
MaterialPassBase
  _animateUVs : Boolean
CompiledPass
 Inherited_animationSet : IAnimationSet
MaterialPassBase
 Inherited_animationTargetRegisters : Vector.<String>
MaterialPassBase
 Inherited_blendFactorDest : String = zero
MaterialPassBase
 Inherited_blendFactorSource : String = one
MaterialPassBase
  _cameraPositionIndex : int
CompiledPass
  _commonsDataIndex : int
CompiledPass
  _compiler : ShaderCompiler
CompiledPass
 Inherited_defaultCulling : String = back
MaterialPassBase
 Inherited_depthCompareMode : String = lessEqual
MaterialPassBase
  _diffuseLightSources : uint = 0x03
CompiledPass
 Inherited_enableBlending : Boolean
MaterialPassBase
  _enableLightFallOff : Boolean = true
CompiledPass
  _fragmentConstantData : Vector.<Number>
CompiledPass
  _fragmentLightCode : String
CompiledPass
  _framentPostLightCode : String
CompiledPass
  _lightFragmentConstantIndex : int
CompiledPass
 Inherited_lightPicker : LightPickerBase
MaterialPassBase
  _lightProbeDiffuseIndices : Vector.<uint>
CompiledPass
  _lightProbeSpecularIndices : Vector.<uint>
CompiledPass
 Inherited_material : MaterialBase
MaterialPassBase
  _methodSetup : ShaderMethodSetup
CompiledPass
 Inherited_mipmap : Boolean = true
MaterialPassBase
 Inherited_needFragmentAnimation : Boolean
MaterialPassBase
 Inherited_needUVAnimation : Boolean
MaterialPassBase
  _normalBufferIndex : int
CompiledPass
  _numDirectionalLights : uint
CompiledPass
  _numLightProbes : uint
CompiledPass
  _numPointLights : uint
CompiledPass
 Inherited_numUsedFragmentConstants : uint
MaterialPassBase
 Inherited_numUsedStreams : uint
MaterialPassBase
 Inherited_numUsedTextures : uint
MaterialPassBase
 Inherited_numUsedVaryings : uint
MaterialPassBase
 Inherited_numUsedVertexConstants : uint
MaterialPassBase
  _preserveAlpha : Boolean = true
CompiledPass
  _probeWeightsIndex : int
CompiledPass
 Inherited_repeat : Boolean = false
MaterialPassBase
  _sceneMatrixIndex : int
CompiledPass
  _sceneNormalMatrixIndex : int
CompiledPass
  _secondaryUVBufferIndex : int
CompiledPass
 Inherited_shadedTarget : String = ft0
MaterialPassBase
 Inherited_smooth : Boolean = true
MaterialPassBase
  _specularLightSources : uint = 0x01
CompiledPass
  _tangentBufferIndex : int
CompiledPass
  _usesNormals : Boolean
CompiledPass
  _usingSpecularMethod : Boolean
CompiledPass
  _uvBufferIndex : int
CompiledPass
 Inherited_UVSource : String
MaterialPassBase
 Inherited_UVTarget : String
MaterialPassBase
  _uvTransformIndex : int
CompiledPass
  _vertexCode : String
CompiledPass
  _vertexConstantData : Vector.<Number>
CompiledPass
 Inherited_writeDepth : Boolean = true
MaterialPassBase
Public Methods
 MethodDefined By
  
Creates a new CompiledPass object.
CompiledPass
  
dispose():void
[override] Cleans up any resources used by the current object.
CompiledPass
 Inherited
setBlendMode(value:String):void
The blend mode to use when drawing this renderable.
MaterialPassBase
Protected Methods
 MethodDefined By
  
addPasses(passes:Vector.<MaterialPassBase>):void
Adds internal passes to the material.
CompiledPass
  
Adds any possible passes needed by the used methods.
CompiledPass
  
cleanUp():void
Cleans up the after compiling.
CompiledPass
  
Factory method to create a concrete compiler object for this pass.
CompiledPass
  
Initializes commonly required constant values.
CompiledPass
  
initCompiler(profile:String):void
Initializes the compiler for this pass.
CompiledPass
  
Initializes the default UV transformation matrix.
CompiledPass
  
Updates constant data render state used by the lights.
CompiledPass
 Inherited
Implemented by subclasses if the pass uses lights to update the shader.
MaterialPassBase
  
Updates method constants if they have changed.
CompiledPass
  
updateProbes(stage3DProxy:Stage3DProxy):void
Updates constant data render state used by the light probes.
CompiledPass
  
Updates the indices for various registers.
CompiledPass
  
Copies the shader's properties from the compiler.
CompiledPass
  
usesLights():Boolean
Indicates whether the shader uses any lights.
CompiledPass
  
usesProbes():Boolean
Indicates whether the shader uses any light probes.
CompiledPass
Property Detail
_ambientLightBproperty
protected var _ambientLightB:Number

_ambientLightGproperty 
protected var _ambientLightG:Number

_ambientLightRproperty 
protected var _ambientLightR:Number

_animateUVsproperty 
protected var _animateUVs:Boolean

_cameraPositionIndexproperty 
protected var _cameraPositionIndex:int

_commonsDataIndexproperty 
protected var _commonsDataIndex:int

_compilerproperty 
protected var _compiler:ShaderCompiler

_diffuseLightSourcesproperty 
protected var _diffuseLightSources:uint = 0x03

_enableLightFallOffproperty 
protected var _enableLightFallOff:Boolean = true

_fragmentConstantDataproperty 
protected var _fragmentConstantData:Vector.<Number>

_fragmentLightCodeproperty 
protected var _fragmentLightCode:String

_framentPostLightCodeproperty 
protected var _framentPostLightCode:String

_lightFragmentConstantIndexproperty 
protected var _lightFragmentConstantIndex:int

_lightProbeDiffuseIndicesproperty 
protected var _lightProbeDiffuseIndices:Vector.<uint>

_lightProbeSpecularIndicesproperty 
protected var _lightProbeSpecularIndices:Vector.<uint>

_methodSetupproperty 
protected var _methodSetup:ShaderMethodSetup

_normalBufferIndexproperty 
protected var _normalBufferIndex:int

_numDirectionalLightsproperty 
protected var _numDirectionalLights:uint

_numLightProbesproperty 
protected var _numLightProbes:uint

_numPointLightsproperty 
protected var _numPointLights:uint

_passesproperty 
arcane var _passes:Vector.<MaterialPassBase>

_passesDirtyproperty 
arcane var _passesDirty:Boolean

_preserveAlphaproperty 
protected var _preserveAlpha:Boolean = true

_probeWeightsIndexproperty 
protected var _probeWeightsIndex:int

_sceneMatrixIndexproperty 
protected var _sceneMatrixIndex:int

_sceneNormalMatrixIndexproperty 
protected var _sceneNormalMatrixIndex:int

_secondaryUVBufferIndexproperty 
protected var _secondaryUVBufferIndex:int

_specularLightSourcesproperty 
protected var _specularLightSources:uint = 0x01

_tangentBufferIndexproperty 
protected var _tangentBufferIndex:int

_usesNormalsproperty 
protected var _usesNormals:Boolean

_usingSpecularMethodproperty 
protected var _usingSpecularMethod:Boolean

_uvBufferIndexproperty 
protected var _uvBufferIndex:int

_uvTransformIndexproperty 
protected var _uvTransformIndex:int

_vertexCodeproperty 
protected var _vertexCode:String

_vertexConstantDataproperty 
protected var _vertexConstantData:Vector.<Number>

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
animateUVsproperty 
animateUVs:Boolean

Indicate whether UV coordinates need to be animated using the renderable's transformUV matrix.


Implementation
    public function get animateUVs():Boolean
    public function set animateUVs(value:Boolean):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
forceSeparateMVPproperty 
forceSeparateMVP:Boolean

Indicates whether the screen projection should be calculated by forcing a separate scene matrix and view-projection matrix. This is used to prevent rounding errors when using multiple passes with different projection code.


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

Defines whether any used textures should use mipmapping.


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
numDirectionalLightsproperty 
numDirectionalLights:uint  [read-only]

The amount of directional lights that need to be supported.


Implementation
    arcane function get numDirectionalLights():uint
numLightProbesproperty 
numLightProbes:uint  [read-only]

The amount of light probes that need to be supported.


Implementation
    arcane function get numLightProbes():uint
numPointLightsproperty 
numPointLights:uint  [read-only]

The amount of point lights that need to be supported.


Implementation
    arcane function get numPointLights():uint
preserveAlphaproperty 
preserveAlpha:Boolean

Indicates whether the output alpha value should remain unchanged compared to the material's original alpha.


Implementation
    public function get preserveAlpha():Boolean
    public function set preserveAlpha(value:Boolean):void
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
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

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
CompiledPass()Constructor
public function CompiledPass(material:MaterialBase)

Creates a new CompiledPass object.

Parameters
material:MaterialBase — The material to which this pass belongs.
Method Detail
activate()method
override arcane function activate(stage3DProxy:Stage3DProxy, camera:Camera3D):void

Parameters

stage3DProxy:Stage3DProxy
 
camera:Camera3D

addPasses()method 
protected function addPasses(passes:Vector.<MaterialPassBase>):void

Adds internal passes to the material.

Parameters

passes:Vector.<MaterialPassBase> — The passes to add.

addPassesFromMethods()method 
protected function addPassesFromMethods():void

Adds any possible passes needed by the used methods.

cleanUp()method 
protected function cleanUp():void

Cleans up the after compiling.

createCompiler()method 
protected function createCompiler(profile:String):ShaderCompiler

Factory method to create a concrete compiler object for this pass.

Parameters

profile:String — The compatibility profile used by the renderer.

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

Parameters

stage3DProxy:Stage3DProxy

dispose()method 
override public function dispose():void

Cleans up any resources used by the current object.

getFragmentCode()method 
override arcane function getFragmentCode(animatorCode:String):String

Returns the fragment AGAL code for the material.

Parameters

animatorCode:String

Returns
String
getVertexCode()method 
override arcane function getVertexCode():String

Returns the vertex AGAL code for the material.

Returns
String
initCommonsData()method 
protected function initCommonsData():void

Initializes commonly required constant values.

initCompiler()method 
protected function initCompiler(profile:String):void

Initializes the compiler for this pass.

Parameters

profile:String — The compatibility profile used by the renderer.

initUVTransformData()method 
protected function initUVTransformData():void

Initializes the default UV transformation matrix.

invalidateShaderProgram()method 
override arcane function invalidateShaderProgram(updateMaterial:Boolean = true):void

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

Parameters

updateMaterial:Boolean (default = true) — Indicates whether the invalidation should be performed on the entire material. Should always pass "true" unless it's called from the material itself.

render()method 
override arcane function render(renderable:IRenderable, stage3DProxy:Stage3DProxy, camera:Camera3D, viewProjection:Matrix3D):void

Parameters

renderable:IRenderable
 
stage3DProxy:Stage3DProxy
 
camera:Camera3D
 
viewProjection:Matrix3D

updateLightConstants()method 
protected function updateLightConstants():void

Updates constant data render state used by the lights. This method is optional for subclasses to implement.

updateMethodConstants()method 
protected function updateMethodConstants():void

Updates method constants if they have changed.

updateProbes()method 
protected function updateProbes(stage3DProxy:Stage3DProxy):void

Updates constant data render state used by the light probes. This method is optional for subclasses to implement.

Parameters

stage3DProxy:Stage3DProxy

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

Compiles the shader program.

Parameters

stage3DProxy:Stage3DProxy — An optional register that contains an amount by which to inflate the model (used in single object depth map rendering).

updateRegisterIndices()method 
protected function updateRegisterIndices():void

Updates the indices for various registers.

updateShaderProperties()method 
protected function updateShaderProperties():void

Copies the shader's properties from the compiler.

usesLights()method 
protected function usesLights():Boolean

Indicates whether the shader uses any lights.

Returns
Boolean
usesProbes()method 
protected function usesProbes():Boolean

Indicates whether the shader uses any light probes.

Returns
Boolean