Packageaway3d.materials.methods
Classpublic class ShadingMethodBase
InheritanceShadingMethodBase Inheritance NamedAssetBase Inheritance flash.events.EventDispatcher
Subclasses BasicAmbientMethod, BasicNormalMethod, EffectMethodBase, LightingMethodBase, ShadowMapMethodBase

ShadingMethodBase provides an abstract base method for shading methods, used by compiled passes to compile the final shading program.



Public Properties
 PropertyDefined By
 InheritedassetFullPath : Array
[read-only]
NamedAssetBase
 InheritedassetNamespace : String
[read-only]
NamedAssetBase
 Inheritedid : String
NamedAssetBase
 Inheritedname : String
NamedAssetBase
 InheritedoriginalName : String
[read-only] The original name used for this asset in the resource (e.g.
NamedAssetBase
  passes : Vector.<MaterialPassBase>
[read-only] Any passes required that render to a texture used by this method.
ShadingMethodBase
Protected Properties
 PropertyDefined By
  _passes : Vector.<MaterialPassBase>
ShadingMethodBase
  _sharedRegisters : ShaderRegisterData
ShadingMethodBase
Public Methods
 MethodDefined By
  
Create a new ShadingMethodBase object.
ShadingMethodBase
 Inherited
assetPathEquals(name:String, ns:String):Boolean
NamedAssetBase
  
Copies the state from a ShadingMethodBase object into the current object.
ShadingMethodBase
  
dispose():void
Cleans up any resources used by the current object.
ShadingMethodBase
 Inherited
resetAssetPath(name:String, ns:String = null, overrideOriginal:Boolean = true):void
NamedAssetBase
Protected Methods
 MethodDefined By
  
getTex2DSampleCode(vo:MethodVO, targetReg:ShaderRegisterElement, inputReg:ShaderRegisterElement, texture:TextureProxyBase, uvReg:ShaderRegisterElement = null, forceWrap:String = null):String
A helper method that generates standard code for sampling from a texture using the normal uv coordinates.
ShadingMethodBase
  
A helper method that generates standard code for sampling from a cube texture.
ShadingMethodBase
  
Marks the shader program as invalid, so it will be recompiled before the next render.
ShadingMethodBase
Public Constants
 ConstantDefined By
 InheritedDEFAULT_NAMESPACE : String = default
[static]
NamedAssetBase
Property Detail
_passesproperty
protected var _passes:Vector.<MaterialPassBase>

_sharedRegistersproperty 
protected var _sharedRegisters:ShaderRegisterData

passesproperty 
passes:Vector.<MaterialPassBase>  [read-only]

Any passes required that render to a texture used by this method.


Implementation
    public function get passes():Vector.<MaterialPassBase>
sharedRegistersproperty 
sharedRegisters:ShaderRegisterData

The shared registers created by the compiler and possibly used by methods.


Implementation
    arcane function get sharedRegisters():ShaderRegisterData
    arcane function set sharedRegisters(value:ShaderRegisterData):void
Constructor Detail
ShadingMethodBase()Constructor
public function ShadingMethodBase()

Create a new ShadingMethodBase object.

Method Detail
copyFrom()method
public function copyFrom(method:ShadingMethodBase):void

Copies the state from a ShadingMethodBase object into the current object.

Parameters

method:ShadingMethodBase

createMethodVO()method 
arcane function createMethodVO():MethodVO

Creates a data container that contains material-dependent data. Provided as a factory method so a custom subtype can be overridden when needed.

Returns
MethodVO
deactivate()method 
arcane function deactivate(vo:MethodVO, stage3DProxy:Stage3DProxy):void

Clears the render state for this method.

Parameters

vo:MethodVO — The MethodVO object linking this method with the pass currently being compiled.
 
stage3DProxy:Stage3DProxy — The Stage3DProxy object currently used for rendering.

dispose()method 
public function dispose():void

Cleans up any resources used by the current object.

getTex2DSampleCode()method 
protected function getTex2DSampleCode(vo:MethodVO, targetReg:ShaderRegisterElement, inputReg:ShaderRegisterElement, texture:TextureProxyBase, uvReg:ShaderRegisterElement = null, forceWrap:String = null):String

A helper method that generates standard code for sampling from a texture using the normal uv coordinates.

Parameters

vo:MethodVO — The MethodVO object linking this method with the pass currently being compiled.
 
targetReg:ShaderRegisterElement — The register in which to store the sampled colour.
 
inputReg:ShaderRegisterElement — The texture stream register.
 
texture:TextureProxyBase — The texture which will be assigned to the given slot.
 
uvReg:ShaderRegisterElement (default = null) — An optional uv register if coordinates different from the primary uv coordinates are to be used.
 
forceWrap:String (default = null) — If true, texture wrapping is enabled regardless of the material setting.

Returns
String — The fragment code that performs the sampling.
getTexCubeSampleCode()method 
protected function getTexCubeSampleCode(vo:MethodVO, targetReg:ShaderRegisterElement, inputReg:ShaderRegisterElement, texture:TextureProxyBase, uvReg:ShaderRegisterElement):String

A helper method that generates standard code for sampling from a cube texture.

Parameters

vo:MethodVO — The MethodVO object linking this method with the pass currently being compiled.
 
targetReg:ShaderRegisterElement — The register in which to store the sampled colour.
 
inputReg:ShaderRegisterElement — The texture stream register.
 
texture:TextureProxyBase — The cube map which will be assigned to the given slot.
 
uvReg:ShaderRegisterElement — The direction vector with which to sample the cube map.

Returns
String
initConstants()method 
arcane function initConstants(vo:MethodVO):void

Initializes unchanging shader constants using the data from a MethodVO.

Parameters

vo:MethodVO — The MethodVO object linking this method with the pass currently being compiled.

initVO()method 
arcane function initVO(vo:MethodVO):void

Initializes the properties for a MethodVO, including register and texture indices.

Parameters

vo:MethodVO — The MethodVO object linking this method with the pass currently being compiled.

invalidateShaderProgram()method 
protected function invalidateShaderProgram():void

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

reset()method 
arcane function reset():void

Resets the compilation state of the method.

setRenderState()method 
arcane function setRenderState(vo:MethodVO, renderable:IRenderable, stage3DProxy:Stage3DProxy, camera:Camera3D):void

Sets the render state for a single renderable.

Parameters

vo:MethodVO — The MethodVO object linking this method with the pass currently being compiled.
 
renderable:IRenderable — The renderable currently being rendered.
 
stage3DProxy:Stage3DProxy — The Stage3DProxy object currently used for rendering.
 
camera:Camera3D — The camera from which the scene is currently rendered.