Packageaway3d.materials.methods
Classpublic class WrapDiffuseMethod
InheritanceWrapDiffuseMethod Inheritance BasicDiffuseMethod Inheritance LightingMethodBase Inheritance ShadingMethodBase Inheritance NamedAssetBase 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 simple subsurface scattering.



Public Properties
 PropertyDefined By
 InheritedalphaThreshold : Number
The minimum alpha value for which pixels should be drawn.
BasicDiffuseMethod
 InheritedassetFullPath : Array
[read-only]
NamedAssetBase
 InheritedassetNamespace : String
[read-only]
NamedAssetBase
 InheriteddiffuseAlpha : Number
The alpha component of the diffuse reflection.
BasicDiffuseMethod
 InheriteddiffuseColor : 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
 Inheritedtexture : Texture2DBase
The bitmapData to use to define the diffuse reflection color per texel.
BasicDiffuseMethod
 Inherited_totalLightColorReg : ShaderRegisterElement
BasicDiffuseMethod
  wrapFactor : Number
A factor to indicate the amount by which the light is allowed to wrap.
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)
Creates a new WrapDiffuseMethod object.
WrapDiffuseMethod
 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.
BasicDiffuseMethod
 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
 InheritedDEFAULT_NAMESPACE : String = default
[static]
NamedAssetBase
Property Detail
wrapFactorproperty
wrapFactor:Number

A factor to indicate the amount by which the light is allowed to wrap.


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

Creates a new WrapDiffuseMethod object.

Parameters
wrapFactor:Number (default = .5) — A factor to indicate the amount by which the light is allowed to wrap
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

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
getFragmentPreLightingCode()method 
override arcane function getFragmentPreLightingCode(vo:MethodVO, regCache:ShaderRegisterCache):String

Parameters

vo:MethodVO
 
regCache:ShaderRegisterCache

Returns
String