Packageaway3d.materials.methods
Classpublic class BasicDiffuseMethod
InheritanceBasicDiffuseMethod Inheritance LightingMethodBase Inheritance ShadingMethodBase
SubclassesEnvMapDiffuseMethod, TerrainDiffuseMethod, WrapDiffuseMethod

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

Public Properties
 PropertyDefined by
  alphaThreshold : Number
BasicDiffuseMethod
  bitmapData : BitmapData
The bitmapData to use to define the diffuse reflection color per texel.
BasicDiffuseMethod
  diffuseAlpha : Number
The alpha component of the diffuse reflection.
BasicDiffuseMethod
  diffuseColor : uint
The color of the diffuse reflection when not using a texture.
BasicDiffuseMethod
 Inheritedpasses : Vector
Any passes required that render to a texture used by this method.
ShadingMethodBase
  shadowRegister : ShaderRegisterElement
[write-only]
BasicDiffuseMethod
  _totalLightColorReg : ShaderRegisterElement
BasicDiffuseMethod
 InheritedviewDirVaryingReg : ShaderRegisterElement
ShadingMethodBase
Protected Properties
 PropertyDefined by
  _diffuseInputIndex : int
BasicDiffuseMethod
  _diffuseInputRegister : ShaderRegisterElement
BasicDiffuseMethod
 Inherited_globalPosVertexReg : ShaderRegisterElement
ShadingMethodBase
 Inherited_mipmap : Boolean = true
ShadingMethodBase
 Inherited_needsGlobalPos : Boolean
ShadingMethodBase
 Inherited_needsNormals : Boolean
ShadingMethodBase
 Inherited_needsProjection : Boolean
ShadingMethodBase
 Inherited_needsUV : Boolean
ShadingMethodBase
 Inherited_needsView : Boolean
ShadingMethodBase
 Inherited_normalFragmentReg : ShaderRegisterElement
ShadingMethodBase
 Inherited_numLights : int
ShadingMethodBase
 Inherited_passes : Vector
ShadingMethodBase
 Inherited_projectionReg : ShaderRegisterElement
ShadingMethodBase
 Inherited_repeat : Boolean
ShadingMethodBase
  _shadowRegister : ShaderRegisterElement
BasicDiffuseMethod
 Inherited_smooth : Boolean = true
ShadingMethodBase
  _useTexture : Boolean
BasicDiffuseMethod
 Inherited_uvFragmentReg : ShaderRegisterElement
ShadingMethodBase
 Inherited_viewDirFragmentReg : ShaderRegisterElement
ShadingMethodBase
 Inherited_viewDirVaryingReg : ShaderRegisterElement
ShadingMethodBase
Public Methods
 MethodDefined by
  
Creates a new BasicDiffuseMethod object.
BasicDiffuseMethod
  
Copies the state from a BasicDiffuseMethod object into the current object.
BasicDiffuseMethod
  
dispose(deep:Boolean):void
Cleans up any resources used by the current object.
BasicDiffuseMethod
  
Marks the texture for update next on the next render.
BasicDiffuseMethod
Protected Methods
 MethodDefined by
 Inherited
A helper method that generates standard code for sampling from a texture using the normal uv coordinates.
ShadingMethodBase
 Inherited
Marks the shader program as invalid, so it will be recompiled before the next render.
ShadingMethodBase
Property detail
alphaThresholdproperty
alphaThreshold:Number  [read-write]Implementation
    public function get alphaThreshold():Number
    public function set alphaThreshold(value:Number):void
bitmapDataproperty 
bitmapData:BitmapData  [read-write]

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

Implementation
    public function get bitmapData():BitmapData
    public function set bitmapData(value:BitmapData):void
diffuseAlphaproperty 
diffuseAlpha:Number  [read-write]

The alpha component of the diffuse reflection.

Implementation
    public function get diffuseAlpha():Number
    public function set diffuseAlpha(value:Number):void
diffuseColorproperty 
diffuseColor:uint  [read-write]

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

Implementation
    public function get diffuseColor():uint
    public function set diffuseColor(value:uint):void
_diffuseInputIndexproperty 
protected var _diffuseInputIndex:int
_diffuseInputRegisterproperty 
protected var _diffuseInputRegister:ShaderRegisterElement
needsUVproperty 
needsUV:Boolean  [read-only]

Indicates whether the material requires uv coordinates.

Implementation
    arcane function get needsUV():Boolean
numLightsproperty 
numLights:int  [read-write]

Implementation
    arcane function get numLights():int
    arcane function set numLights(value:int):void
_shadowRegisterproperty 
protected var _shadowRegister:ShaderRegisterElement
shadowRegisterproperty 
shadowRegister:ShaderRegisterElement  [write-only]Implementation
    public function set shadowRegister(value:ShaderRegisterElement):void
_totalLightColorRegproperty 
public var _totalLightColorReg:ShaderRegisterElement
_useTextureproperty 
protected var _useTexture:Boolean
Constructor detail
BasicDiffuseMethod()constructor
public function BasicDiffuseMethod() Init Parameters
Method detail
activate()method
arcane override function activate(context:Context3D, contextIndex:uint):void

Sets the render state for this method.

Parameters
context:Context3D — The Context3D currently used for rendering.
 
contextIndex:uint
copyFrom()method 
public override function copyFrom(method:ShadingMethodBase):void

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

Parameters
method:ShadingMethodBase
deactivate()method 
arcane override function deactivate(context:Context3D):void Parameters
context:Context3D
dispose()method 
public override function dispose(deep:Boolean):void

Cleans up any resources used by the current object.

Parameters
deep:Boolean — Indicates whether other resources should be cleaned up, that could potentially be shared across different instances.
getFragmentAGALPreLightingCode()method 
arcane override function getFragmentAGALPreLightingCode(regCache:ShaderRegisterCache):String

Get the fragment shader code that will be needed before any per-light code is added.

Parameters
regCache:ShaderRegisterCache — The register cache used during the compilation.

Returns
String
getFragmentCodePerLight()method 
arcane override function getFragmentCodePerLight(lightIndex:int, lightDirReg:ShaderRegisterElement, lightColReg:ShaderRegisterElement, regCache:ShaderRegisterCache):String

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

Parameters
lightIndex:int — The register cache used during the compilation.
 
lightDirReg:ShaderRegisterElement
 
lightColReg:ShaderRegisterElement
 
regCache:ShaderRegisterCache

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

Get the fragment shader code that should be added after all per-light code. Usually composits everything to the target register.

Parameters
regCache:ShaderRegisterCache — The register cache used during the compilation.
 
targetReg:ShaderRegisterElement

Returns
String
invalidateBitmapData()method 
public function invalidateBitmapData():void

Marks the texture for update next on the next render.

reset()method 
arcane override function reset():void
Wiki link
Click to go to the wiki page for 'away3d.materials.methods.BasicDiffuseMethod'

Code examples

Comments