Packageaway3d.materials.methods
Classpublic class NearShadowMapMethod
InheritanceNearShadowMapMethod Inheritance SimpleShadowMapMethodBase Inheritance ShadowMapMethodBase Inheritance ShadingMethodBase Inheritance NamedAssetBase Inheritance flash.events.EventDispatcher

NearShadowMapMethod provides a shadow map method that restricts the shadowed area near the camera to optimize shadow map usage. This method needs to be used in conjunction with a NearDirectionalShadowMapper.

See also

away3d.lights.shadowmaps.NearDirectionalShadowMapper


Public Properties
 PropertyDefined By
  alpha : Number
[override] The "transparency" of the shadows.
NearShadowMapMethod
 InheritedassetFullPath : Array
[read-only]
NamedAssetBase
 InheritedassetNamespace : String
[read-only]
NamedAssetBase
 InheritedassetType : String
[read-only] The type of the asset.
ShadowMapMethodBase
  baseMethod : SimpleShadowMapMethodBase
The base shadow map method on which this method's shading is based.
NearShadowMapMethod
 InheritedcastingLight : LightBase
[read-only] The light casting the shadows.
ShadowMapMethodBase
  epsilon : Number
[override] A small value to counter floating point precision errors when comparing values in the shadow map with the calculated depth value.
NearShadowMapMethod
  fadeRatio : Number
The amount of shadow fading to the outer shadow area.
NearShadowMapMethod
 Inheritedid : String
NamedAssetBase
 Inheritedname : String
NamedAssetBase
 InheritedoriginalName : String
[read-only] The original name used for this asset in the resource (e.g.
NamedAssetBase
 Inheritedpasses : Vector.<MaterialPassBase>
[read-only] Any passes required that render to a texture used by this method.
ShadingMethodBase
Protected Properties
 PropertyDefined By
 Inherited_alpha : Number = 1
ShadowMapMethodBase
 Inherited_castingLight : LightBase
ShadowMapMethodBase
 Inherited_depthMapCoordReg : ShaderRegisterElement
SimpleShadowMapMethodBase
 Inherited_epsilon : Number = .02
ShadowMapMethodBase
 Inherited_passes : Vector.<MaterialPassBase>
ShadingMethodBase
 Inherited_shadowMapper : ShadowMapperBase
ShadowMapMethodBase
 Inherited_sharedRegisters : ShaderRegisterData
ShadingMethodBase
 Inherited_usePoint : Boolean
SimpleShadowMapMethodBase
Public Methods
 MethodDefined By
  
NearShadowMapMethod(baseMethod:SimpleShadowMapMethodBase, fadeRatio:Number = .1)
Creates a new NearShadowMapMethod object.
NearShadowMapMethod
 Inherited
assetPathEquals(name:String, ns:String):Boolean
NamedAssetBase
 Inherited
Copies the state from a ShadingMethodBase object into the current object.
ShadingMethodBase
  
dispose():void
[override] Cleans up resources used by this asset.
NearShadowMapMethod
 Inherited
resetAssetPath(name:String, ns:String = null, overrideOriginal:Boolean = true):void
NamedAssetBase
Protected Methods
 MethodDefined By
 Inherited
Gets the fragment code for shadow mapping with a planar shadow map.
SimpleShadowMapMethodBase
 Inherited
Gets the vertex code for shadow mapping with a planar shadow map (fe: directional lights).
SimpleShadowMapMethodBase
 Inherited
Gets the fragment code for shadow mapping with a point light.
SimpleShadowMapMethodBase
 Inherited
Gets the vertex code for shadow mapping with a point light.
SimpleShadowMapMethodBase
 Inherited
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
 Inherited
A helper method that generates standard code for sampling from a cube texture.
ShadingMethodBase
 Inherited
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
alphaproperty
alpha:Number[override]

The "transparency" of the shadows. This allows making shadows less strong.


Implementation
    public function get alpha():Number
    public function set alpha(value:Number):void
baseMethodproperty 
baseMethod:SimpleShadowMapMethodBase

The base shadow map method on which this method's shading is based.


Implementation
    public function get baseMethod():SimpleShadowMapMethodBase
    public function set baseMethod(value:SimpleShadowMapMethodBase):void
epsilonproperty 
epsilon:Number[override]

A small value to counter floating point precision errors when comparing values in the shadow map with the calculated depth value. Increase this if shadow banding occurs, decrease it if the shadow seems to be too detached.


Implementation
    public function get epsilon():Number
    public function set epsilon(value:Number):void
fadeRatioproperty 
fadeRatio:Number

The amount of shadow fading to the outer shadow area. A value of 1 would mean the shadows start fading from the camera's near plane.


Implementation
    public function get fadeRatio():Number
    public function set fadeRatio(value:Number):void
sharedRegistersproperty 
sharedRegisters:ShaderRegisterData[override]

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
NearShadowMapMethod()Constructor
public function NearShadowMapMethod(baseMethod:SimpleShadowMapMethodBase, fadeRatio:Number = .1)

Creates a new NearShadowMapMethod object.

Parameters
baseMethod:SimpleShadowMapMethodBase — The shadow map sampling method used to sample individual cascades (fe: HardShadowMapMethod, SoftShadowMapMethod)
 
fadeRatio:Number (default = .1) — The amount of shadow fading to the outer shadow area. A value of 1 would mean the shadows start fading from the camera's near plane.
Method Detail
activate()method
override arcane function activate(vo:MethodVO, stage3DProxy:Stage3DProxy):void

Parameters

vo:MethodVO
 
stage3DProxy:Stage3DProxy

cleanCompilationData()method 
override arcane function cleanCompilationData():void

deactivate()method 
override 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 
override public function dispose():void

Cleans up resources used by this asset.

getFragmentCode()method 
override arcane function getFragmentCode(vo:MethodVO, regCache:ShaderRegisterCache, targetReg:ShaderRegisterElement):String

Parameters

vo:MethodVO
 
regCache:ShaderRegisterCache
 
targetReg:ShaderRegisterElement

Returns
String
getVertexCode()method 
override arcane function getVertexCode(vo:MethodVO, regCache:ShaderRegisterCache):String

Parameters

vo:MethodVO
 
regCache:ShaderRegisterCache

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

reset()method 
override arcane function reset():void

Resets the compilation state of the method.

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