Packageaway3d.materials.methods
Classpublic class CelDiffuseMethod
InheritanceCelDiffuseMethod Inheritance WrapDiffuseMethod Inheritance BasicDiffuseMethod Inheritance LightingMethodBase Inheritance ShadingMethodBase

CelDiffuseMethod provides a shading method to add specular cel (cartoon) shading.

Public Properties
 PropertyDefined by
 InheritedalphaThreshold : Number
WrapDiffuseMethod
 InheritedbitmapData : BitmapData
The bitmapData to use to define the diffuse reflection color per texel.
WrapDiffuseMethod
 InheriteddiffuseAlpha : Number
The alpha component of the diffuse reflection.
WrapDiffuseMethod
 InheriteddiffuseColor : uint
The color of the diffuse reflection when not using a texture.
WrapDiffuseMethod
  levels : uint
CelDiffuseMethod
 Inheritedpasses : Vector
Any passes required that render to a texture used by this method.
ShadingMethodBase
 InheritedshadowRegister : ShaderRegisterElement
WrapDiffuseMethod
  smoothness : Number
The smoothness of the edge between 2 shading levels.
CelDiffuseMethod
 Inherited_totalLightColorReg : ShaderRegisterElement
BasicDiffuseMethod
 InheritedviewDirVaryingReg : ShaderRegisterElement
WrapDiffuseMethod
Protected Properties
 PropertyDefined by
 Inherited_diffuseInputIndex : int
BasicDiffuseMethod
 Inherited_diffuseInputRegister : ShaderRegisterElement
BasicDiffuseMethod
 Inherited_globalPosVertexReg : ShaderRegisterElement
ShadingMethodBase
 Inherited_mipmap : Boolean = true
ShadingMethodBase
 Inherited_needsGlobalPos : Boolean
ShadingMethodBase
 Inherited_needsNormals : Boolean
ShadingMethodBase
 Inherited_needsProjection : Boolean
ShadingMethodBase
 Inherited_needsUV : Boolean
ShadingMethodBase
 Inherited_needsView : Boolean
ShadingMethodBase
 Inherited_normalFragmentReg : ShaderRegisterElement
ShadingMethodBase
 Inherited_numLights : int
ShadingMethodBase
 Inherited_passes : Vector
ShadingMethodBase
 Inherited_projectionReg : ShaderRegisterElement
ShadingMethodBase
 Inherited_repeat : Boolean
ShadingMethodBase
 Inherited_shadowRegister : ShaderRegisterElement
BasicDiffuseMethod
 Inherited_smooth : Boolean = true
ShadingMethodBase
 Inherited_useTexture : Boolean
BasicDiffuseMethod
 Inherited_uvFragmentReg : ShaderRegisterElement
ShadingMethodBase
 Inherited_viewDirFragmentReg : ShaderRegisterElement
ShadingMethodBase
 Inherited_viewDirVaryingReg : ShaderRegisterElement
ShadingMethodBase
Public Methods
 MethodDefined by
  
CelDiffuseMethod
(levels:uint = 3, baseDiffuseMethod:BasicDiffuseMethod = null)
Creates a new CelDiffuseMethod object.
CelDiffuseMethod
 Inherited
Copies the state from a BasicDiffuseMethod object into the current object.
BasicDiffuseMethod
 Inherited
dispose(deep:Boolean):void
Cleans up any resources used by the current object.
WrapDiffuseMethod
 Inherited
Marks the texture for update next on the next render.
WrapDiffuseMethod
Protected Methods
 MethodDefined by
 Inherited
A helper method that generates standard code for sampling from a texture using the normal uv coordinates.
ShadingMethodBase
 Inherited
Marks the shader program as invalid, so it will be recompiled before the next render.
ShadingMethodBase
Property detail
levelsproperty
levels:uint  [read-write]Implementation
    public function get levels():uint
    public function set levels(value:uint):void
smoothnessproperty 
smoothness:Number  [read-write]

The smoothness of the edge between 2 shading levels.

Implementation
    public function get smoothness():Number
    public function set smoothness(value:Number):void
Constructor detail
CelDiffuseMethod()constructor
public function CelDiffuseMethod(levels:uint = 3, baseDiffuseMethod:BasicDiffuseMethod = null)Parameters
levels:uint (default = 3) — The amount of shadow gradations.
 
baseDiffuseMethod:BasicDiffuseMethod (default = null) — An optional diffuse method on which the cartoon shading is based. If ommitted, BasicDiffuseMethod is used.
Init Parameters
Method detail
activate()method
arcane override function activate(context:Context3D, contextIndex:uint):void

Sets the render state for this method.

Parameters
context:Context3D — The Context3D currently used for rendering.
 
contextIndex:uint
getFragmentAGALPreLightingCode()method 
arcane override function getFragmentAGALPreLightingCode(regCache:ShaderRegisterCache):String

Get the fragment shader code that will be needed before any per-light code is added.

Parameters
regCache:ShaderRegisterCache — The register cache used during the compilation.

Returns
String
Wiki link
Click to go to the wiki page for 'away3d.materials.methods.CelDiffuseMethod'

Code examples

Comments