Packageaway3d.materials.passes
Classpublic class MaterialPassBase
InheritanceMaterialPassBase Inheritance flash.events.EventDispatcher
Subclasses CompiledPass, DepthMapPass, DistanceMapPass, OutlinePass, SegmentPass, SingleObjectDepthPass, SkyBoxPass

MaterialPassBase provides an abstract base class for material shader passes. A material pass constitutes at least a render call per required renderable.



Public Properties
 PropertyDefined By
  alphaPremultiplied : Boolean
Indicates whether visible textures (or other pixels) used by this material have already been premultiplied.
MaterialPassBase
  animationRegisterCache : AnimationRegisterCache
MaterialPassBase
  animationSet : IAnimationSet
Returns the animation data set adding animations to the material.
MaterialPassBase
  bothSides : Boolean
Defines whether or not the material should perform backface culling.
MaterialPassBase
  depthCompareMode : String
The depth compare mode used to render the renderables using this material.
MaterialPassBase
  material : MaterialBase
The material to which this pass belongs.
MaterialPassBase
  mipmap : Boolean
Defines whether any used textures should use mipmapping.
MaterialPassBase
  needFragmentAnimation : Boolean
[read-only]
MaterialPassBase
  needUVAnimation : Boolean
[read-only] Indicates whether the pass requires any UV animatin code.
MaterialPassBase
  numUsedFragmentConstants : uint
[read-only] The amount of used fragment constants in the fragment code.
MaterialPassBase
  numUsedStreams : uint
[read-only] The amount of used vertex streams in the vertex code.
MaterialPassBase
  numUsedVaryings : uint
[read-only]
MaterialPassBase
  numUsedVertexConstants : uint
[read-only] The amount of used vertex constants in the vertex code.
MaterialPassBase
  renderToTexture : Boolean
[read-only] Specifies whether this pass renders to texture
MaterialPassBase
  repeat : Boolean
Defines whether textures should be tiled.
MaterialPassBase
  smooth : Boolean
Defines whether smoothing should be applied to any used textures.
MaterialPassBase
  writeDepth : Boolean
Indicate whether this pass should write to the depth buffer or not.
MaterialPassBase
Protected Properties
 PropertyDefined By
  _alphaPremultiplied : Boolean
MaterialPassBase
  _animatableAttributes : Vector.<String>
MaterialPassBase
  _animationSet : IAnimationSet
MaterialPassBase
  _animationTargetRegisters : Vector.<String>
MaterialPassBase
  _blendFactorDest : String = zero
MaterialPassBase
  _blendFactorSource : String = one
MaterialPassBase
  _defaultCulling : String = back
MaterialPassBase
  _depthCompareMode : String = lessEqual
MaterialPassBase
  _enableBlending : Boolean
MaterialPassBase
  _lightPicker : LightPickerBase
MaterialPassBase
  _material : MaterialBase
MaterialPassBase
  _mipmap : Boolean = true
MaterialPassBase
  _needFragmentAnimation : Boolean
MaterialPassBase
  _needUVAnimation : Boolean
MaterialPassBase
  _numUsedFragmentConstants : uint
MaterialPassBase
  _numUsedStreams : uint
MaterialPassBase
  _numUsedTextures : uint
MaterialPassBase
  _numUsedVaryings : uint
MaterialPassBase
  _numUsedVertexConstants : uint
MaterialPassBase
  _repeat : Boolean = false
MaterialPassBase
  _shadedTarget : String = ft0
MaterialPassBase
  _smooth : Boolean = true
MaterialPassBase
  _UVSource : String
MaterialPassBase
  _UVTarget : String
MaterialPassBase
  _writeDepth : Boolean = true
MaterialPassBase
Public Methods
 MethodDefined By
  
MaterialPassBase(renderToTexture:Boolean = false)
Creates a new MaterialPassBase object.
MaterialPassBase
  
dispose():void
Cleans up any resources used by the current object.
MaterialPassBase
  
setBlendMode(value:String):void
The blend mode to use when drawing this renderable.
MaterialPassBase
Protected Methods
 MethodDefined By
  
Implemented by subclasses if the pass uses lights to update the shader.
MaterialPassBase
Property Detail
_alphaPremultipliedproperty
protected var _alphaPremultiplied:Boolean

_animatableAttributesproperty 
protected var _animatableAttributes:Vector.<String>

_animationSetproperty 
protected var _animationSet:IAnimationSet

_animationTargetRegistersproperty 
protected var _animationTargetRegisters:Vector.<String>

_blendFactorDestproperty 
protected var _blendFactorDest:String = zero

_blendFactorSourceproperty 
protected var _blendFactorSource:String = one

_defaultCullingproperty 
protected var _defaultCulling:String = back

_depthCompareModeproperty 
protected var _depthCompareMode:String = lessEqual

_enableBlendingproperty 
protected var _enableBlending:Boolean

_lightPickerproperty 
protected var _lightPicker:LightPickerBase

_materialproperty 
protected var _material:MaterialBase

_mipmapproperty 
protected var _mipmap:Boolean = true

_needFragmentAnimationproperty 
protected var _needFragmentAnimation:Boolean

_needUVAnimationproperty 
protected var _needUVAnimation:Boolean

_numUsedFragmentConstantsproperty 
protected var _numUsedFragmentConstants:uint

_numUsedStreamsproperty 
protected var _numUsedStreams:uint

_numUsedTexturesproperty 
protected var _numUsedTextures:uint

_numUsedVaryingsproperty 
protected var _numUsedVaryings:uint

_numUsedVertexConstantsproperty 
protected var _numUsedVertexConstants:uint

_program3Didsproperty 
arcane var _program3Dids:Vector.<int>

_program3Dsproperty 
arcane var _program3Ds:Vector.<Program3D>

_repeatproperty 
protected var _repeat:Boolean = false

_shadedTargetproperty 
protected var _shadedTarget:String = ft0

_smoothproperty 
protected var _smooth:Boolean = true

_UVSourceproperty 
protected var _UVSource:String

_UVTargetproperty 
protected var _UVTarget:String

_writeDepthproperty 
protected var _writeDepth:Boolean = true

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
animationRegisterCacheproperty 
public var animationRegisterCache:AnimationRegisterCache

animationSetproperty 
animationSet:IAnimationSet

Returns the animation data set adding animations to the material.


Implementation
    public function get animationSet():IAnimationSet
    public function set animationSet(value:IAnimationSet):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

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

See also

flash.display3D.Context3DCompareMode
lightPickerproperty 
lightPicker:LightPickerBase

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


Implementation
    arcane function get lightPicker():LightPickerBase
    arcane function set lightPicker(value:LightPickerBase):void

See also

materialproperty 
material:MaterialBase

The material to which this pass belongs.


Implementation
    public function get material():MaterialBase
    public function set material(value:MaterialBase):void
mipmapproperty 
mipmap:Boolean

Defines whether any used textures should use mipmapping.


Implementation
    public function get mipmap():Boolean
    public function set mipmap(value:Boolean):void
needFragmentAnimationproperty 
needFragmentAnimation:Boolean  [read-only]


Implementation
    public function get needFragmentAnimation():Boolean
needUVAnimationproperty 
needUVAnimation:Boolean  [read-only]

Indicates whether the pass requires any UV animatin code.


Implementation
    public function get needUVAnimation():Boolean
numUsedFragmentConstantsproperty 
numUsedFragmentConstants:uint  [read-only]

The amount of used fragment constants in the fragment code. Used by the animation code generation to know from which index on registers are available.


Implementation
    public function get numUsedFragmentConstants():uint
numUsedStreamsproperty 
numUsedStreams:uint  [read-only]

The amount of used vertex streams in the vertex code. Used by the animation code generation to know from which index on streams are available.


Implementation
    public function get numUsedStreams():uint
numUsedVaryingsproperty 
numUsedVaryings:uint  [read-only]


Implementation
    public function get numUsedVaryings():uint
numUsedVertexConstantsproperty 
numUsedVertexConstants:uint  [read-only]

The amount of used vertex constants in the vertex code. Used by the animation code generation to know from which index on registers are available.


Implementation
    public function get numUsedVertexConstants():uint
renderToTextureproperty 
renderToTexture:Boolean  [read-only]

Specifies whether this pass renders to texture


Implementation
    public function get renderToTexture():Boolean
repeatproperty 
repeat:Boolean

Defines whether textures should be tiled.


Implementation
    public function get repeat():Boolean
    public function set repeat(value:Boolean):void
smoothproperty 
smooth:Boolean

Defines whether smoothing should be applied to any used textures.


Implementation
    public function get smooth():Boolean
    public function set smooth(value:Boolean):void
writeDepthproperty 
writeDepth:Boolean

Indicate whether this pass should write to the depth buffer or not. Ignored when blending is enabled.


Implementation
    public function get writeDepth():Boolean
    public function set writeDepth(value:Boolean):void
Constructor Detail
MaterialPassBase()Constructor
public function MaterialPassBase(renderToTexture:Boolean = false)

Creates a new MaterialPassBase object.

Parameters
renderToTexture:Boolean (default = false) — Indicates whether this pass is a render-to-texture pass.
Method Detail
dispose()method
public function dispose():void

Cleans up any resources used by the current object.

getFragmentCode()method 
arcane function getFragmentCode(fragmentAnimatorCode:String):String

Returns the fragment AGAL code for the material.

Parameters

fragmentAnimatorCode:String

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

Returns the vertex AGAL code for the material.

Returns
String
invalidateShaderProgram()method 
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.

setBlendMode()method 
public function setBlendMode(value:String):void

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

Parameters

value:String

updateLights()method 
protected function updateLights():void

Implemented by subclasses if the pass uses lights to update the shader.

updateProgram()method 
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).