Packageaway3d.materials.methods
Classpublic class BasicSpecularMethod
InheritanceBasicSpecularMethod Inheritance LightingMethodBase Inheritance ShadingMethodBase Inheritance flash.events.EventDispatcher
Subclasses AnisotropicSpecularMethod, CompositeSpecularMethod

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



Public Properties
 PropertyDefined By
  gloss : Number
The sharpness of the specular highlight.
BasicSpecularMethod
 Inheritedpasses : Vector.<MaterialPassBase>
[read-only] Any passes required that render to a texture used by this method.
ShadingMethodBase
  shadingModel : String
The model used by the specular shader
BasicSpecularMethod
  specular : Number
The overall strength of the specular highlights.
BasicSpecularMethod
  specularColor : uint
The colour of the specular reflection of the surface.
BasicSpecularMethod
  texture : Texture2DBase
The bitmapData that encodes the specular highlight strength per texel in the red channel, and the sharpness in the green channel.
BasicSpecularMethod
 InheritedviewDirVaryingReg : ShaderRegisterElement
ShadingMethodBase
Protected Properties
 PropertyDefined By
 Inherited_globalPosReg : ShaderRegisterElement
ShadingMethodBase
 Inherited_normalFragmentReg : ShaderRegisterElement
ShadingMethodBase
 Inherited_passes : Vector.<MaterialPassBase>
ShadingMethodBase
 Inherited_projectionReg : ShaderRegisterElement
ShadingMethodBase
 Inherited_secondaryUVFragmentReg : ShaderRegisterElement
ShadingMethodBase
  _specularDataRegister : ShaderRegisterElement
BasicSpecularMethod
  _specularTexData : ShaderRegisterElement
BasicSpecularMethod
  _specularTextureRegister : ShaderRegisterElement
BasicSpecularMethod
 Inherited_tangentVaryingReg : ShaderRegisterElement
ShadingMethodBase
  _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
  
[override] Copies the state from a BasicSpecularMethod object into the current object.
BasicSpecularMethod
 Inherited
dispose():void
Cleans up any resources used by the current object.
ShadingMethodBase
Protected Methods
 MethodDefined By
 Inherited
getTexSampleCode(vo:MethodVO, targetReg:ShaderRegisterElement, inputReg:ShaderRegisterElement, 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
Marks the shader program as invalid, so it will be recompiled before the next render.
ShadingMethodBase
Property Detail
_specularDataRegisterproperty
protected var _specularDataRegister:ShaderRegisterElement

_specularRproperty 
arcane var _specularR:Number = 1

_specularTexDataproperty 
protected var _specularTexData:ShaderRegisterElement

_specularTextureRegisterproperty 
protected var _specularTextureRegister:ShaderRegisterElement

_totalLightColorRegproperty 
protected var _totalLightColorReg:ShaderRegisterElement

_useTextureproperty 
protected var _useTexture:Boolean

glossproperty 
gloss:Number

The sharpness of the specular highlight.


Implementation
    public function get gloss():Number
    public function set gloss(value:Number):void
shadingModelproperty 
shadingModel:String

The model used by the specular shader


Implementation
    public function get shadingModel():String
    public function set shadingModel(value:String):void

See also

shadowRegisterproperty 
shadowRegister:ShaderRegisterElement  [write-only]


Implementation
    arcane function set shadowRegister(value:ShaderRegisterElement):void
specularproperty 
specular:Number

The overall strength of the specular highlights.


Implementation
    public function get specular():Number
    public function set specular(value:Number):void
specularColorproperty 
specularColor:uint

The colour of the specular reflection of the surface.


Implementation
    public function get specularColor():uint
    public function set specularColor(value:uint):void
textureproperty 
texture:Texture2DBase

The bitmapData that encodes the specular highlight strength per texel in the red channel, and the sharpness in the green channel. You can use SpecularBitmapTexture if you want to easily set specular and gloss maps from greyscale images, but prepared images are preffered.


Implementation
    public function get texture():Texture2DBase
    public function set texture(value:Texture2DBase):void
Constructor Detail
BasicSpecularMethod()Constructor
public function BasicSpecularMethod()

Creates a new BasicSpecularMethod object.

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

copyFrom()method 
override public function copyFrom(method:ShadingMethodBase):void

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

Parameters

method:ShadingMethodBase

getFragmentCodePerLight()method 
override arcane function getFragmentCodePerLight(vo:MethodVO, 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

vo:MethodVO
 
lightIndex:int
 
lightDirReg:ShaderRegisterElement
 
lightColReg:ShaderRegisterElement
 
regCache:ShaderRegisterCache

Returns
String
getFragmentCodePerProbe()method 
override arcane function getFragmentCodePerProbe(vo:MethodVO, lightIndex:int, cubeMapReg:ShaderRegisterElement, weightRegister:String, regCache:ShaderRegisterCache):String

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

Parameters

vo:MethodVO — The index of the light currently processed. This is a continuation of the lightIndex parameter of the getFragmentCodePerLight method.
 
lightIndex:int — The register containing the cube map for the current probe
 
cubeMapReg:ShaderRegisterElement — A string representation of the register + component containing the current weight
 
weightRegister:String — The register cache providing any necessary registers to the shader
 
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
initVO()method 
override arcane function initVO(vo:MethodVO):void

Parameters

vo:MethodVO