Packageaway3d.materials.methods
Classpublic class CelSpecularMethod
InheritanceCelSpecularMethod Inheritance WrapSpecularMethod Inheritance BasicSpecularMethod Inheritance LightingMethodBase Inheritance ShadingMethodBase

CelSpecularMethod provides a shading method to add diffuse cel (cartoon) shading.

Public Properties
 PropertyDefined by
 InheritedbitmapData : BitmapData
The bitmapData that encodes the specular highlight strength per texel in the red channel, and the sharpness in the green channel.
WrapSpecularMethod
 Inheritedgloss : Number
The sharpness of the specular highlight.
BasicSpecularMethod
 Inheritedpasses : Vector
Any passes required that render to a texture used by this method.
WrapSpecularMethod
 InheritedshadowRegister : ShaderRegisterElement
WrapSpecularMethod
  smoothness : Number
The smoothness of the highlight edge.
CelSpecularMethod
 Inheritedspecular : Number
The overall strength of the specular highlights.
BasicSpecularMethod
 InheritedspecularColor : uint
The colour of the specular reflection of the surface.
BasicSpecularMethod
  specularCutOff : Number
The threshold at which the specular highlight should be shown.
CelSpecularMethod
 InheritedviewDirVaryingReg : ShaderRegisterElement
WrapSpecularMethod
Protected Properties
 PropertyDefined by
 Inherited_globalPosVertexReg : ShaderRegisterElement
ShadingMethodBase
 Inherited_mipmap : Boolean = true
ShadingMethodBase
 Inherited_mipmapBitmap : BitmapData
BasicSpecularMethod
 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_smooth : Boolean = true
ShadingMethodBase
 Inherited_specularData : Vector
BasicSpecularMethod
 Inherited_specularDataIndex : uint
BasicSpecularMethod
 Inherited_specularDataRegister : ShaderRegisterElement
BasicSpecularMethod
 Inherited_specularTexData : ShaderRegisterElement
BasicSpecularMethod
 Inherited_specularTexIndex : uint
BasicSpecularMethod
 Inherited_specularTextureRegister : ShaderRegisterElement
BasicSpecularMethod
 Inherited_totalLightColorReg : ShaderRegisterElement
BasicSpecularMethod
 Inherited_useTexture : Boolean
BasicSpecularMethod
 Inherited_uvFragmentReg : ShaderRegisterElement
ShadingMethodBase
 Inherited_viewDirFragmentReg : ShaderRegisterElement
ShadingMethodBase
 Inherited_viewDirVaryingReg : ShaderRegisterElement
ShadingMethodBase
Public Methods
 MethodDefined by
  
CelSpecularMethod
(specularCutOff:Number = .5, baseSpecularMethod:BasicSpecularMethod = null)
Creates a new CelSpecularMethod object.
CelSpecularMethod
 Inherited
Copies the state from a BasicSpecularMethod object into the current object.
BasicSpecularMethod
 Inherited
dispose(deep:Boolean):void
Cleans up any resources used by the current object.
WrapSpecularMethod
 Inherited
Marks the texture for update next on the next render.
WrapSpecularMethod
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
smoothnessproperty
smoothness:Number  [read-write]

The smoothness of the highlight edge.

Implementation
    public function get smoothness():Number
    public function set smoothness(value:Number):void
specularCutOffproperty 
specularCutOff:Number  [read-write]

The threshold at which the specular highlight should be shown.

Implementation
    public function get specularCutOff():Number
    public function set specularCutOff(value:Number):void
Constructor detail
CelSpecularMethod()constructor
public function CelSpecularMethod(specularCutOff:Number = .5, baseSpecularMethod:BasicSpecularMethod = null)Parameters
specularCutOff:Number (default = .5) — The threshold at which the specular highlight should be shown.
 
baseSpecularMethod:BasicSpecularMethod (default = null) — An optional specular method on which the cartoon shading is based. If ommitted, BasicSpecularMethod 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.CelSpecularMethod'

Code examples

Comments