Packageaway3d.materials.methods
Classpublic class BasicDiffuseMethod
InheritanceBasicDiffuseMethod Inheritance LightingMethodBase Inheritance ShadingMethodBase Inheritance NamedAssetBase Inheritance flash.events.EventDispatcher
Subclasses CompositeDiffuseMethod, DepthDiffuseMethod, GradientDiffuseMethod, TerrainDiffuseMethod, WrapDiffuseMethod

BasicDiffuseMethod provides the default shading method for Lambert (dot3) diffuse lighting.



Public Properties
 PropertyDefined By
  alphaThreshold : Number
The minimum alpha value for which pixels should be drawn.
BasicDiffuseMethod
 InheritedassetFullPath : Array
[read-only]
NamedAssetBase
 InheritedassetNamespace : String
[read-only]
NamedAssetBase
  diffuseAlpha : Number
The alpha component of the diffuse reflection.
BasicDiffuseMethod
  diffuseColor : uint
The color of the diffuse reflection when not using a texture.
BasicDiffuseMethod
 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
  texture : Texture2DBase
The bitmapData to use to define the diffuse reflection color per texel.
BasicDiffuseMethod
  _totalLightColorReg : ShaderRegisterElement
BasicDiffuseMethod
Protected Properties
 PropertyDefined By
  _alphaThreshold : Number = 0
BasicDiffuseMethod
  _diffuseInputRegister : ShaderRegisterElement
BasicDiffuseMethod
  _isFirstLight : Boolean
BasicDiffuseMethod
 Inherited_passes : Vector.<MaterialPassBase>
ShadingMethodBase
  _shadowRegister : ShaderRegisterElement
BasicDiffuseMethod
 Inherited_sharedRegisters : ShaderRegisterData
ShadingMethodBase
  _useTexture : Boolean
BasicDiffuseMethod
Public Methods
 MethodDefined By
  
Creates a new BasicDiffuseMethod object.
BasicDiffuseMethod
 Inherited
assetPathEquals(name:String, ns:String):Boolean
NamedAssetBase
  
[override] Copies the state from a ShadingMethodBase object into the current object.
BasicDiffuseMethod
  
dispose():void
[override] Cleans up any resources used by the current object.
BasicDiffuseMethod
  
generateMip(stage3DProxy:Stage3DProxy):void
Forces the creation of the texture.
BasicDiffuseMethod
 Inherited
resetAssetPath(name:String, ns:String = null, overrideOriginal:Boolean = true):void
NamedAssetBase
Protected Methods
 MethodDefined By
  
Generate the code that applies the calculated shadow to the diffuse light
BasicDiffuseMethod
 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
_alphaThresholdproperty
protected var _alphaThreshold:Number = 0

_diffuseInputRegisterproperty 
protected var _diffuseInputRegister:ShaderRegisterElement

_isFirstLightproperty 
protected var _isFirstLight:Boolean

_shadowRegisterproperty 
protected var _shadowRegister:ShaderRegisterElement

_totalLightColorRegproperty 
public var _totalLightColorReg:ShaderRegisterElement

_useTextureproperty 
protected var _useTexture:Boolean

alphaThresholdproperty 
alphaThreshold:Number

The minimum alpha value for which pixels should be drawn. This is used for transparency that is either invisible or entirely opaque, often used with textures for foliage, etc. Recommended values are 0 to disable alpha, or 0.5 to create smooth edges. Default value is 0 (disabled).


Implementation
    public function get alphaThreshold():Number
    public function set alphaThreshold(value:Number):void
diffuseAlphaproperty 
diffuseAlpha:Number

The alpha component of the diffuse reflection.


Implementation
    public function get diffuseAlpha():Number
    public function set diffuseAlpha(value:Number):void
diffuseColorproperty 
diffuseColor:uint

The color of the diffuse reflection when not using a texture.


Implementation
    public function get diffuseColor():uint
    public function set diffuseColor(value:uint):void
shadowRegisterproperty 
shadowRegister:ShaderRegisterElement  [write-only]

Set internally by the compiler, so the method knows the register containing the shadow calculation.


Implementation
    arcane function set shadowRegister(value:ShaderRegisterElement):void
textureproperty 
texture:Texture2DBase

The bitmapData to use to define the diffuse reflection color per texel.


Implementation
    public function get texture():Texture2DBase
    public function set texture(value:Texture2DBase):void
useAmbientTextureproperty 
useAmbientTexture:Boolean

Set internally if the ambient method uses a texture.


Implementation
    arcane function get useAmbientTexture():Boolean
    arcane function set useAmbientTexture(value:Boolean):void
Constructor Detail
BasicDiffuseMethod()Constructor
public function BasicDiffuseMethod()

Creates a new BasicDiffuseMethod object.

Method Detail
activate()method
override arcane function activate(vo:MethodVO, stage3DProxy:Stage3DProxy):void

Parameters

vo:MethodVO
 
stage3DProxy:Stage3DProxy

applyShadow()method 
protected function applyShadow(vo:MethodVO, regCache:ShaderRegisterCache):String

Generate the code that applies the calculated shadow to the diffuse light

Parameters

vo:MethodVO — The MethodVO object for which the compilation is currently happening.
 
regCache:ShaderRegisterCache — The register cache the compiler is currently using for the register management.

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

copyFrom()method 
override public function copyFrom(method:ShadingMethodBase):void

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

Parameters

method:ShadingMethodBase

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

Cleans up any resources used by the current object.

generateMip()method 
public function generateMip(stage3DProxy:Stage3DProxy):void

Forces the creation of the texture.

Parameters

stage3DProxy:Stage3DProxy — The Stage3DProxy used by the renderer

getFragmentCodePerLight()method 
override arcane function getFragmentCodePerLight(vo:MethodVO, lightDirReg:ShaderRegisterElement, lightColReg:ShaderRegisterElement, regCache:ShaderRegisterCache):String

Get the fragment shader code that will generate the code relevant to a single light.

Parameters

vo:MethodVO — The MethodVO object containing the method data for the currently compiled material pass.
 
lightDirReg:ShaderRegisterElement — The register containing the light direction vector.
 
lightColReg:ShaderRegisterElement — The register containing the light colour.
 
regCache:ShaderRegisterCache — The register cache used during the compilation.

Returns
String
getFragmentCodePerProbe()method 
override arcane function getFragmentCodePerProbe(vo:MethodVO, cubeMapReg:ShaderRegisterElement, weightRegister:String, regCache:ShaderRegisterCache):String

Get the fragment shader code that will generate the code relevant to a single light probe object.

Parameters

vo:MethodVO — The MethodVO object containing the method data for the currently compiled material pass.
 
cubeMapReg:ShaderRegisterElement — The register containing the cube map for the current probe
 
weightRegister:String — A string representation of the register + component containing the current weight
 
regCache:ShaderRegisterCache — The register cache providing any necessary registers to the shader

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

Parameters

vo:MethodVO
 
regCache:ShaderRegisterCache
 
targetReg:ShaderRegisterElement

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

Parameters

vo:MethodVO
 
regCache:ShaderRegisterCache

Returns
String
initVO()method 
override arcane function initVO(vo:MethodVO):void

Parameters

vo:MethodVO