Packageaway3d.materials.methods
Classpublic class LightMapDiffuseMethod
InheritanceLightMapDiffuseMethod Inheritance CompositeDiffuseMethod Inheritance BasicDiffuseMethod Inheritance LightingMethodBase Inheritance ShadingMethodBase Inheritance NamedAssetBase Inheritance flash.events.EventDispatcher

LightMapDiffuseMethod provides a diffuse shading method that uses a light map to modulate the calculated diffuse lighting. It is different from LightMapMethod in that the latter modulates the entire calculated pixel color, rather than only the diffuse lighting value.



Public Properties
 PropertyDefined By
 InheritedalphaThreshold : Number
[override] The minimum alpha value for which pixels should be drawn.
CompositeDiffuseMethod
 InheritedassetFullPath : Array
[read-only]
NamedAssetBase
 InheritedassetNamespace : String
[read-only]
NamedAssetBase
 InheritedbaseMethod : BasicDiffuseMethod
The base diffuse method on which this method's shading is based.
CompositeDiffuseMethod
  blendMode : String
The blend mode with which the light map should be applied to the lighting result.
LightMapDiffuseMethod
 InheriteddiffuseAlpha : Number
[override] The alpha component of the diffuse reflection.
CompositeDiffuseMethod
 InheriteddiffuseColor : uint
[override] The color of the diffuse reflection when not using a texture.
CompositeDiffuseMethod
 Inheritedid : String
NamedAssetBase
  lightMapTexture : Texture2DBase
The texture containing the light map data.
LightMapDiffuseMethod
 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
 Inheritedtexture : Texture2DBase
[override] The bitmapData to use to define the diffuse reflection color per texel.
CompositeDiffuseMethod
 Inherited_totalLightColorReg : ShaderRegisterElement
BasicDiffuseMethod
Protected Properties
 PropertyDefined By
 Inherited_alphaThreshold : Number = 0
BasicDiffuseMethod
 Inherited_baseMethod : BasicDiffuseMethod
CompositeDiffuseMethod
 Inherited_diffuseInputRegister : ShaderRegisterElement
BasicDiffuseMethod
 Inherited_isFirstLight : Boolean
BasicDiffuseMethod
 Inherited_passes : Vector.<MaterialPassBase>
ShadingMethodBase
 Inherited_shadowRegister : ShaderRegisterElement
BasicDiffuseMethod
 Inherited_sharedRegisters : ShaderRegisterData
ShadingMethodBase
 Inherited_useTexture : Boolean
BasicDiffuseMethod
Public Methods
 MethodDefined By
  
LightMapDiffuseMethod(lightMap:Texture2DBase, blendMode:String = multiply, useSecondaryUV:Boolean = false, baseMethod:BasicDiffuseMethod = null)
Creates a new LightMapDiffuseMethod method.
LightMapDiffuseMethod
 Inherited
assetPathEquals(name:String, ns:String):Boolean
NamedAssetBase
 Inherited
[override] Copies the state from a ShadingMethodBase object into the current object.
BasicDiffuseMethod
 Inherited
dispose():void
[override] Cleans up any resources used by the current object.
CompositeDiffuseMethod
 Inherited
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
 Inherited
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
  ADD : String = add
[static] Indicates the light map should be added into the calculated shading result.
LightMapDiffuseMethod
 InheritedDEFAULT_NAMESPACE : String = default
[static]
NamedAssetBase
  MULTIPLY : String = multiply
[static] Indicates the light map should be multiplied with the calculated shading result.
LightMapDiffuseMethod
Property Detail
blendModeproperty
blendMode:String

The blend mode with which the light map should be applied to the lighting result.


Implementation
    public function get blendMode():String
    public function set blendMode(value:String):void

See also

LightMapDiffuseMethod.ADD
LightMapDiffuseMethod.MULTIPLY
lightMapTextureproperty 
lightMapTexture:Texture2DBase

The texture containing the light map data.


Implementation
    public function get lightMapTexture():Texture2DBase
    public function set lightMapTexture(value:Texture2DBase):void
Constructor Detail
LightMapDiffuseMethod()Constructor
public function LightMapDiffuseMethod(lightMap:Texture2DBase, blendMode:String = multiply, useSecondaryUV:Boolean = false, baseMethod:BasicDiffuseMethod = null)

Creates a new LightMapDiffuseMethod method.

Parameters
lightMap:Texture2DBase — The texture containing the light map.
 
blendMode:String (default = multiply) — The blend mode with which the light map should be applied to the lighting result.
 
useSecondaryUV:Boolean (default = false) — Indicates whether the secondary UV set should be used to map the light map.
 
baseMethod:BasicDiffuseMethod (default = null) — The diffuse method used to calculate the regular light-based lighting.
Method Detail
activate()method
override arcane function activate(vo:MethodVO, stage3DProxy:Stage3DProxy):void

Parameters

vo:MethodVO
 
stage3DProxy:Stage3DProxy

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

Parameters

vo:MethodVO
 
regCache:ShaderRegisterCache
 
targetReg:ShaderRegisterElement

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

Parameters

vo:MethodVO

Constant Detail
ADDConstant
public static const ADD:String = add

Indicates the light map should be added into the calculated shading result. This can be used to add pre-calculated lighting or global illumination.

MULTIPLYConstant 
public static const MULTIPLY:String = multiply

Indicates the light map should be multiplied with the calculated shading result. This can be used to add pre-calculated shadows or occlusion.