Packageaway3d.materials.methods
Classpublic class DitheredShadowMapMethod
InheritanceDitheredShadowMapMethod Inheritance SimpleShadowMapMethodBase Inheritance ShadowMapMethodBase Inheritance ShadingMethodBase Inheritance NamedAssetBase Inheritance flash.events.EventDispatcher

DitheredShadowMapMethod provides a soft shadowing technique by randomly distributing sample points differently for each fragment.



Public Properties
 PropertyDefined By
 Inheritedalpha : Number
The "transparency" of the shadows.
ShadowMapMethodBase
 InheritedassetFullPath : Array
[read-only]
NamedAssetBase
 InheritedassetNamespace : String
[read-only]
NamedAssetBase
 InheritedassetType : String
[read-only] The type of the asset.
ShadowMapMethodBase
 InheritedcastingLight : LightBase
[read-only] The light casting the shadows.
ShadowMapMethodBase
 Inheritedepsilon : Number
A small value to counter floating point precision errors when comparing values in the shadow map with the calculated depth value.
ShadowMapMethodBase
 Inheritedid : String
NamedAssetBase
 Inheritedname : String
NamedAssetBase
  numSamples : int
The amount of samples to take for dithering.
DitheredShadowMapMethod
 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
  range : Number
The range in the shadow map in which to distribute the samples.
DitheredShadowMapMethod
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
  
DitheredShadowMapMethod(castingLight:DirectionalLight, numSamples:int = 4)
Creates a new DitheredShadowMapMethod object.
DitheredShadowMapMethod
 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.
DitheredShadowMapMethod
 Inherited
resetAssetPath(name:String, ns:String = null, overrideOriginal:Boolean = true):void
NamedAssetBase
Protected Methods
 MethodDefined By
  
[override] Gets the fragment code for shadow mapping with a planar shadow map.
DitheredShadowMapMethod
 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
numSamplesproperty
numSamples:int

The amount of samples to take for dithering. Minimum 1, maximum 24. The actual maximum may depend on the complexity of the shader.


Implementation
    public function get numSamples():int
    public function set numSamples(value:int):void
rangeproperty 
range:Number

The range in the shadow map in which to distribute the samples.


Implementation
    public function get range():Number
    public function set range(value:Number):void
Constructor Detail
DitheredShadowMapMethod()Constructor
public function DitheredShadowMapMethod(castingLight:DirectionalLight, numSamples:int = 4)

Creates a new DitheredShadowMapMethod object.

Parameters
castingLight:DirectionalLight — The light casting the shadows
 
numSamples:int (default = 4) — The amount of samples to take for dithering. Minimum 1, maximum 24.
Method Detail
activate()method
override arcane function activate(vo:MethodVO, stage3DProxy:Stage3DProxy):void

Parameters

vo:MethodVO
 
stage3DProxy:Stage3DProxy

activateForCascade()method 
override arcane function activateForCascade(vo:MethodVO, stage3DProxy:Stage3DProxy):void

Sets the method state for cascade shadow mapping.

Parameters

vo:MethodVO
 
stage3DProxy:Stage3DProxy

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

Cleans up resources used by this asset.

getCascadeFragmentCode()method 
override arcane function getCascadeFragmentCode(vo:MethodVO, regCache:ShaderRegisterCache, decodeRegister:ShaderRegisterElement, depthTexture:ShaderRegisterElement, depthProjection:ShaderRegisterElement, targetRegister:ShaderRegisterElement):String

Gets the fragment code for combining this method with a cascaded shadow map method.

Parameters

vo:MethodVO — The MethodVO object linking this method with the pass currently being compiled.
 
regCache:ShaderRegisterCache — The register cache used during the compilation.
 
decodeRegister:ShaderRegisterElement — The register containing the data to decode the shadow map depth value.
 
depthTexture:ShaderRegisterElement — The texture containing the shadow map.
 
depthProjection:ShaderRegisterElement — The projection of the fragment relative to the light.
 
targetRegister:ShaderRegisterElement — The register to contain the shadow coverage

Returns
String
getPlanarFragmentCode()method 
override protected function getPlanarFragmentCode(vo:MethodVO, regCache:ShaderRegisterCache, targetReg:ShaderRegisterElement):String

Gets the fragment code for shadow mapping with a planar shadow map.

Parameters

vo:MethodVO — The MethodVO object linking this method with the pass currently being compiled.
 
regCache:ShaderRegisterCache — The register cache used during the compilation.
 
targetReg:ShaderRegisterElement — The register to contain the shadow coverage

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.