Packageaway3d.materials.methods
Classpublic class SubsurfaceScatteringDiffuseMethod
InheritanceSubsurfaceScatteringDiffuseMethod Inheritance CompositeDiffuseMethod Inheritance BasicDiffuseMethod Inheritance LightingMethodBase Inheritance ShadingMethodBase Inheritance flash.events.EventDispatcher

SubsurfaceScatteringDiffuseMethod provides a depth map-based diffuse shading method that mimics the scattering of light inside translucent surfaces. It allows light to shine through an object and to soften the diffuse shading. It can be used for candle wax, ice, skin, ...



Public Properties
 PropertyDefined By
 InheritedalphaThreshold : Number
[override]
CompositeDiffuseMethod
 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
 Inheritedpasses : Vector.<MaterialPassBase>
[read-only] Any passes required that render to a texture used by this method.
ShadingMethodBase
  scatterColor : uint
The colour the light becomes inside the object.
SubsurfaceScatteringDiffuseMethod
  scattering : Number
The amount by which the light scatters.
SubsurfaceScatteringDiffuseMethod
 Inheritedtexture : Texture2DBase
[override] The bitmapData to use to define the diffuse reflection color per texel.
CompositeDiffuseMethod
 Inherited_totalLightColorReg : ShaderRegisterElement
BasicDiffuseMethod
  translucency : Number
The translucency of the object.
SubsurfaceScatteringDiffuseMethod
Protected Properties
 PropertyDefined By
 Inherited_alphaThreshold : Number = 0
BasicDiffuseMethod
 Inherited_baseDiffuseMethod : 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
  
SubsurfaceScatteringDiffuseMethod(depthMapSize:int = 512, depthMapOffset:Number = 15)
Creates a new SubsurfaceScatteringDiffuseMethod object.
SubsurfaceScatteringDiffuseMethod
 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.
CompositeDiffuseMethod
 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
scatterColorproperty
scatterColor:uint

The colour the light becomes inside the object.


Implementation
    public function get scatterColor():uint
    public function set scatterColor(value:uint):void
scatteringproperty 
scattering:Number

The amount by which the light scatters. It can be used to set the translucent surface's thickness. Use low values for skin.


Implementation
    public function get scattering():Number
    public function set scattering(value:Number):void
translucencyproperty 
translucency:Number

The translucency of the object.


Implementation
    public function get translucency():Number
    public function set translucency(value:Number):void
Constructor Detail
SubsurfaceScatteringDiffuseMethod()Constructor
public function SubsurfaceScatteringDiffuseMethod(depthMapSize:int = 512, depthMapOffset:Number = 15)

Creates a new SubsurfaceScatteringDiffuseMethod object.

Parameters
depthMapSize:int (default = 512) — The size of the depth map used.
 
depthMapOffset:Number (default = 15) — The amount by which the rendered object will be inflated, to prevent depth map rounding errors.
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
 
lightDirReg:ShaderRegisterElement
 
lightColReg:ShaderRegisterElement
 
regCache:ShaderRegisterCache

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

Parameters

vo:MethodVO
 
regCache:ShaderRegisterCache

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

Parameters

vo:MethodVO

setRenderState()method 
override arcane function setRenderState(vo:MethodVO, renderable:IRenderable, stage3DProxy:Stage3DProxy, camera:Camera3D):void

Parameters

vo:MethodVO
 
renderable:IRenderable
 
stage3DProxy:Stage3DProxy
 
camera:Camera3D