Packageaway3d.materials.methods
Classpublic class SubsurfaceScatteringDiffuseMethod
InheritanceSubsurfaceScatteringDiffuseMethod Inheritance CompositeDiffuseMethod Inheritance BasicDiffuseMethod Inheritance LightingMethodBase Inheritance ShadingMethodBase Inheritance NamedAssetBase 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] 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
 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
 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
  scatterColor : uint
The colour of the "insides" of the object, ie: the colour the light becomes after leaving 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_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
  
SubsurfaceScatteringDiffuseMethod(depthMapSize:int = 512, depthMapOffset:Number = 15)
Creates a new SubsurfaceScatteringDiffuseMethod object.
SubsurfaceScatteringDiffuseMethod
 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
 InheritedDEFAULT_NAMESPACE : String = default
[static]
NamedAssetBase
Property Detail
scatterColorproperty
scatterColor:uint

The colour of the "insides" of the object, ie: the colour the light becomes after leaving 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 — 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
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

Initializes unchanging shader constants using the data from a MethodVO.

Parameters

vo:MethodVO — The MethodVO object linking this method with the pass currently being compiled.

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

Sets the render state for a single renderable.

Parameters

vo:MethodVO — The MethodVO object linking this method with the pass currently being compiled.
 
renderable:IRenderable — The renderable currently being rendered.
 
stage3DProxy:Stage3DProxy — The Stage3DProxy object currently used for rendering.
 
camera:Camera3D — The camera from which the scene is currently rendered.