Packageaway3d.materials.methods
Classpublic class ShadingMethodBase
SubclassesBasicAmbientMethod, ColorTransformMethod, EnvMapMethod, FilteredShadowMapMethod, FogMethod, HardShadowMapMethod, LightingMethodBase, ProjectiveTextureMethod, RimLightMethod, SlowFilteredShadowMapMethod, SoftShadowMapMethod

ShadingMethodBase provides an abstract base method for shading methods, used by DefaultScreenPass to compile the final shading program.

Public Properties
 PropertyDefined by
  passes : Vector
[read-only] Any passes required that render to a texture used by this method.
ShadingMethodBase
  viewDirVaryingReg : ShaderRegisterElement
ShadingMethodBase
Protected Properties
 PropertyDefined by
  _globalPosVertexReg : ShaderRegisterElement
ShadingMethodBase
  _mipmap : Boolean = true
ShadingMethodBase
  _needsGlobalPos : Boolean
ShadingMethodBase
  _needsNormals : Boolean
ShadingMethodBase
  _needsProjection : Boolean
ShadingMethodBase
  _needsUV : Boolean
ShadingMethodBase
  _needsView : Boolean
ShadingMethodBase
  _normalFragmentReg : ShaderRegisterElement
ShadingMethodBase
  _numLights : int
ShadingMethodBase
  _passes : Vector
ShadingMethodBase
  _projectionReg : ShaderRegisterElement
ShadingMethodBase
  _repeat : Boolean
ShadingMethodBase
  _smooth : Boolean = true
ShadingMethodBase
  _uvFragmentReg : ShaderRegisterElement
ShadingMethodBase
  _viewDirFragmentReg : ShaderRegisterElement
ShadingMethodBase
  _viewDirVaryingReg : ShaderRegisterElement
ShadingMethodBase
Public Methods
 MethodDefined by
  
ShadingMethodBase
(needsNormals:Boolean, needsView:Boolean, needsGlobalPos:Boolean)
Create a new ShadingMethodBase object.
ShadingMethodBase
  
Copies the state from a ShadingMethodBase object into the current object.
ShadingMethodBase
  
dispose(deep:Boolean):void
Cleans up any resources used by the current object.
ShadingMethodBase
Protected Methods
 MethodDefined by
  
A helper method that generates standard code for sampling from a texture using the normal uv coordinates.
ShadingMethodBase
  
Marks the shader program as invalid, so it will be recompiled before the next render.
ShadingMethodBase
Property detail
_globalPosVertexRegproperty
protected var _globalPosVertexReg:ShaderRegisterElement
globalPosVertexRegproperty 
globalPosVertexReg:ShaderRegisterElement  [read-write]Implementation
    arcane function get globalPosVertexReg():ShaderRegisterElement
    arcane function set globalPosVertexReg(value:ShaderRegisterElement):void
_mipmapproperty 
protected var _mipmap:Boolean = true
mipmapproperty 
mipmap:Boolean  [read-write]Implementation
    arcane function get mipmap():Boolean
    arcane function set mipmap(value:Boolean):void
_needsGlobalPosproperty 
protected var _needsGlobalPos:Boolean
needsGlobalPosproperty 
needsGlobalPos:Boolean  [read-only]Implementation
    arcane function get needsGlobalPos():Boolean
_needsNormalsproperty 
protected var _needsNormals:Boolean
_needsProjectionproperty 
protected var _needsProjection:Boolean
needsProjectionproperty 
needsProjection:Boolean  [read-only]Implementation
    arcane function get needsProjection():Boolean
_needsUVproperty 
protected var _needsUV:Boolean
_needsViewproperty 
protected var _needsView:Boolean
_normalFragmentRegproperty 
protected var _normalFragmentReg:ShaderRegisterElement
normalFragmentRegproperty 
normalFragmentReg:ShaderRegisterElement  [read-write]Implementation
    arcane function get normalFragmentReg():ShaderRegisterElement
    arcane function set normalFragmentReg(value:ShaderRegisterElement):void
_numLightsproperty 
protected var _numLights:int
numLightsproperty 
numLights:int  [read-write]Implementation
    arcane function get numLights():int
    arcane function set numLights(value:int):void
parentPassproperty 
parentPass:MaterialPassBase  [read-write]Implementation
    arcane function get parentPass():MaterialPassBase
    arcane function set parentPass(value:MaterialPassBase):void
_passesproperty 
protected var _passes:Vector
passesproperty 
passes:Vector  [read-only]

Any passes required that render to a texture used by this method.

Implementation
    public function get passes():Vector
_projectionRegproperty 
protected var _projectionReg:ShaderRegisterElement
projectionRegproperty 
projectionReg:ShaderRegisterElement  [read-write]Implementation
    arcane function get projectionReg():ShaderRegisterElement
    arcane function set projectionReg(value:ShaderRegisterElement):void
_repeatproperty 
protected var _repeat:Boolean
repeatproperty 
repeat:Boolean  [read-write]Implementation
    arcane function get repeat():Boolean
    arcane function set repeat(value:Boolean):void
_smoothproperty 
protected var _smooth:Boolean = true
smoothproperty 
smooth:Boolean  [read-write]Implementation
    arcane function get smooth():Boolean
    arcane function set smooth(value:Boolean):void
_uvFragmentRegproperty 
protected var _uvFragmentReg:ShaderRegisterElement
UVFragmentRegproperty 
UVFragmentReg:ShaderRegisterElement  [read-write]Implementation
    arcane function get UVFragmentReg():ShaderRegisterElement
    arcane function set UVFragmentReg(value:ShaderRegisterElement):void
_viewDirFragmentRegproperty 
protected var _viewDirFragmentReg:ShaderRegisterElement
viewDirFragmentRegproperty 
viewDirFragmentReg:ShaderRegisterElement  [read-write]Implementation
    arcane function get viewDirFragmentReg():ShaderRegisterElement
    arcane function set viewDirFragmentReg(value:ShaderRegisterElement):void
_viewDirVaryingRegproperty 
protected var _viewDirVaryingReg:ShaderRegisterElement
viewDirVaryingRegproperty 
viewDirVaryingReg:ShaderRegisterElement  [read-write]Implementation
    public function get viewDirVaryingReg():ShaderRegisterElement
    public function set viewDirVaryingReg(value:ShaderRegisterElement):void
Constructor detail
ShadingMethodBase()constructor
public function ShadingMethodBase(needsNormals:Boolean, needsView:Boolean, needsGlobalPos:Boolean)Parameters
needsNormals:Boolean — Defines whether or not the method requires normals.
 
needsView:Boolean — Defines whether or not the method requires the view direction.
 
needsGlobalPos:Boolean
Init Parameters
Method detail
copyFrom()method
public function copyFrom(method:ShadingMethodBase):void

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

Parameters
method:ShadingMethodBase
dispose()method 
public 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.
getTexSampleCode()method 
protected function getTexSampleCode(targetReg:ShaderRegisterElement, inputReg:ShaderRegisterElement, uvReg:ShaderRegisterElement = null):String

A helper method that generates standard code for sampling from a texture using the normal uv coordinates.

Parameters
targetReg:ShaderRegisterElement — The register in which to store the sampled colour.
 
inputReg:ShaderRegisterElement — The texture stream register.
 
uvReg:ShaderRegisterElement (default = null)

Returns
String — The fragment code that performs the sampling.
invalidateShaderProgram()method 
protected function invalidateShaderProgram():void

Marks the shader program as invalid, so it will be recompiled before the next render.

setRenderState()method 
arcane function setRenderState(renderable:IRenderable, context:Context3D, contextIndex:uint, camera:Camera3D, lights:Vector):void

Sets the render state for a single renderable.

Parameters
renderable:IRenderable
 
context:Context3D
 
contextIndex:uint
 
camera:Camera3D
 
lights:Vector
Wiki link
Click to go to the wiki page for 'away3d.materials.methods.ShadingMethodBase'

Code examples

Comments