Packageaway3d.materials.methods
Classpublic class WrapDiffuseMethod
InheritanceWrapDiffuseMethod Inheritance BasicDiffuseMethod Inheritance LightingMethodBase Inheritance ShadingMethodBase Inheritance flash.events.EventDispatcher

WrapDiffuseMethod is an alternative to BasicDiffuseMethod in which the light is allowed to be "wrapped around" the normally dark area, to some extent. It can be used as a crude approximation to Oren-Nayar or subsurface scattering.



Public Properties
 PropertyDefined By
 InheritedalphaThreshold : Number
The minimum alpha value for which pixels should be drawn.
BasicDiffuseMethod
 InheriteddiffuseAlpha : Number
The alpha component of the diffuse reflection.
BasicDiffuseMethod
 InheriteddiffuseColor : uint
The color of the diffuse reflection when not using a texture.
BasicDiffuseMethod
 Inheritedpasses : Vector.<MaterialPassBase>
[read-only] Any passes required that render to a texture used by this method.
ShadingMethodBase
  scatterTexture : Texture2DBase
WrapDiffuseMethod
 Inheritedtexture : Texture2DBase
The bitmapData to use to define the diffuse reflection color per texel.
BasicDiffuseMethod
 Inherited_totalLightColorReg : ShaderRegisterElement
BasicDiffuseMethod
  wrapFactor : Number
WrapDiffuseMethod
Protected Properties
 PropertyDefined By
 Inherited_alphaThreshold : Number = 0
BasicDiffuseMethod
 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
  
WrapDiffuseMethod(wrapFactor:Number = .5, scatterTexture:Texture2DBase = null)
Creates a new WrapDiffuseMethod object.
WrapDiffuseMethod
 Inherited
[override] Copies the state from a BasicDiffuseMethod object into the current object.
BasicDiffuseMethod
 Inherited
dispose():void
[override] Cleans up any resources used by the current object.
BasicDiffuseMethod
 Inherited
generateMip(stage3DProxy:Stage3DProxy):void
BasicDiffuseMethod
Protected Methods
 MethodDefined By
 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
ShadingMethodBase
 Inherited
Marks the shader program as invalid, so it will be recompiled before the next render.
ShadingMethodBase
Property Detail
scatterTextureproperty
scatterTexture:Texture2DBase


Implementation
    public function get scatterTexture():Texture2DBase
    public function set scatterTexture(value:Texture2DBase):void
wrapFactorproperty 
wrapFactor:Number


Implementation
    public function get wrapFactor():Number
    public function set wrapFactor(value:Number):void
Constructor Detail
WrapDiffuseMethod()Constructor
public function WrapDiffuseMethod(wrapFactor:Number = .5, scatterTexture:Texture2DBase = null)

Creates a new WrapDiffuseMethod object.

Parameters
wrapFactor:Number (default = .5) — A factor to indicate the amount by which the light is allowed to wrap
 
scatterTexture:Texture2DBase (default = null) — A texture that contains the light colour based on the angle. This can be used to change the light colour due to subsurface scattering when dot < 0
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

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

Parameters

vo:MethodVO
 
lightDirReg:ShaderRegisterElement
 
lightColReg:ShaderRegisterElement
 
regCache:ShaderRegisterCache

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

Parameters

vo:MethodVO
 
regCache:ShaderRegisterCache

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

Parameters

vo:MethodVO