Packageaway3d.materials.methods
Classpublic class BasicSpecularMethod
InheritanceBasicSpecularMethod Inheritance LightingMethodBase Inheritance ShadingMethodBase
SubclassesWrapSpecularMethod

BasicSpecularMethod provides the default shading method for Blinn-Phong specular highlights.

Public Properties
 PropertyDefined by
  bitmapData : BitmapData
The bitmapData that encodes the specular highlight strength per texel in the red channel, and the sharpness in the green channel.
BasicSpecularMethod
  gloss : Number
The sharpness of the specular highlight.
BasicSpecularMethod
 Inheritedpasses : Vector
Any passes required that render to a texture used by this method.
ShadingMethodBase
  shadowRegister : ShaderRegisterElement
[write-only]
BasicSpecularMethod
  specular : Number
The overall strength of the specular highlights.
BasicSpecularMethod
  specularColor : uint
The colour of the specular reflection of the surface.
BasicSpecularMethod
 InheritedviewDirVaryingReg : ShaderRegisterElement
ShadingMethodBase
Protected Properties
 PropertyDefined by
 Inherited_globalPosVertexReg : ShaderRegisterElement
ShadingMethodBase
 Inherited_mipmap : Boolean = true
ShadingMethodBase
  _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
  _specularData : Vector
BasicSpecularMethod
  _specularDataIndex : uint
BasicSpecularMethod
  _specularDataRegister : ShaderRegisterElement
BasicSpecularMethod
  _specularTexData : ShaderRegisterElement
BasicSpecularMethod
  _specularTexIndex : uint
BasicSpecularMethod
  _specularTextureRegister : ShaderRegisterElement
BasicSpecularMethod
  _totalLightColorReg : ShaderRegisterElement
BasicSpecularMethod
  _useTexture : Boolean
BasicSpecularMethod
 Inherited_uvFragmentReg : ShaderRegisterElement
ShadingMethodBase
 Inherited_viewDirFragmentReg : ShaderRegisterElement
ShadingMethodBase
 Inherited_viewDirVaryingReg : ShaderRegisterElement
ShadingMethodBase
Public Methods
 MethodDefined by
  
Creates a new BasicSpecularMethod object.
BasicSpecularMethod
  
Copies the state from a BasicSpecularMethod object into the current object.
BasicSpecularMethod
  
dispose(deep:Boolean):void
Cleans up any resources used by the current object.
BasicSpecularMethod
  
Marks the texture for update next on the next render.
BasicSpecularMethod
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
bitmapDataproperty
bitmapData:BitmapData  [read-write]

The bitmapData that encodes the specular highlight strength per texel in the red channel, and the sharpness in the green channel.

Implementation
    public function get bitmapData():BitmapData
    public function set bitmapData(value:BitmapData):void
glossproperty 
gloss:Number  [read-write]

The sharpness of the specular highlight.

Implementation
    public function get gloss():Number
    public function set gloss(value:Number):void
_mipmapBitmapproperty 
protected var _mipmapBitmap:BitmapData
needsUVproperty 
needsUV:Boolean  [read-only]

Indicates whether the material requires uv coordinates.

Implementation
    arcane function get needsUV():Boolean
needsViewproperty 
needsView:Boolean  [read-only]

Indicates whether the material requires the view direction.

Implementation
    arcane function get needsView():Boolean
numLightsproperty 
numLights:int  [read-write]

Implementation
    arcane function get numLights():int
    arcane function set numLights(value:int):void
shadowRegisterproperty 
shadowRegister:ShaderRegisterElement  [write-only]Implementation
    public function set shadowRegister(value:ShaderRegisterElement):void
specularproperty 
specular:Number  [read-write]

The overall strength of the specular highlights.

Implementation
    public function get specular():Number
    public function set specular(value:Number):void
specularColorproperty 
specularColor:uint  [read-write]

The colour of the specular reflection of the surface.

Implementation
    public function get specularColor():uint
    public function set specularColor(value:uint):void
_specularDataproperty 
protected var _specularData:Vector
_specularDataIndexproperty 
protected var _specularDataIndex:uint
_specularDataRegisterproperty 
protected var _specularDataRegister:ShaderRegisterElement
_specularRproperty 
arcane var _specularR:Number = 1
_specularTexDataproperty 
protected var _specularTexData:ShaderRegisterElement
_specularTexIndexproperty 
protected var _specularTexIndex:uint
_specularTextureRegisterproperty 
protected var _specularTextureRegister:ShaderRegisterElement
_totalLightColorRegproperty 
protected var _totalLightColorReg:ShaderRegisterElement
_useTextureproperty 
protected var _useTexture:Boolean
Constructor detail
BasicSpecularMethod()constructor
public function BasicSpecularMethod() 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
copyFrom()method 
public override function copyFrom(method:ShadingMethodBase):void

Copies the state from a BasicSpecularMethod object into the current object.

Parameters
method:ShadingMethodBase
deactivate()method 
arcane override function deactivate(context:Context3D):void Parameters
context:Context3D
dispose()method 
public override function dispose(deep:Boolean):void

Cleans up any resources used by the current object.

Parameters
deep:Boolean — Indicates whether other resources should be cleaned up, that could potentially be shared across different instances.
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
getFragmentCodePerLight()method 
arcane override function getFragmentCodePerLight(lightIndex:int, lightDirReg:ShaderRegisterElement, lightColReg:ShaderRegisterElement, regCache:ShaderRegisterCache):String

Get the fragment shader code that will generate the code relevant to a single light.

Parameters
lightIndex:int — The register cache used during the compilation.
 
lightDirReg:ShaderRegisterElement
 
lightColReg:ShaderRegisterElement
 
regCache:ShaderRegisterCache

Returns
String
getFragmentPostLightingCode()method 
arcane override function getFragmentPostLightingCode(regCache:ShaderRegisterCache, targetReg:ShaderRegisterElement):String

Get the fragment shader code that should be added after all per-light code. Usually composits everything to the target register.

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

Returns
String
invalidateBitmapData()method 
public function invalidateBitmapData():void

Marks the texture for update next on the next render.

reset()method 
arcane override function reset():void

Resets the method's state for compilation.

Wiki link
Click to go to the wiki page for 'away3d.materials.methods.BasicSpecularMethod'

Code examples

Comments