Packageaway3d.materials.methods
Classpublic class ProjectiveTextureMethod
InheritanceProjectiveTextureMethod Inheritance EffectMethodBase Inheritance ShadingMethodBase Inheritance NamedAssetBase Inheritance flash.events.EventDispatcher

ProjectiveTextureMethod is a material method used to project a texture unto the surface of an object. This can be used for various effects apart from acting like a normal projector, such as projecting fake shadows unto a surface, the impact of light coming through a stained glass window, ...



Public Properties
 PropertyDefined By
 InheritedassetFullPath : Array
[read-only]
NamedAssetBase
 InheritedassetNamespace : String
[read-only]
NamedAssetBase
 InheritedassetType : String
[read-only] The type of the asset.
EffectMethodBase
 Inheritedid : String
NamedAssetBase
  mode : String
The blend mode with which the texture is blended unto the object.
ProjectiveTextureMethod
 Inheritedname : String
NamedAssetBase
 InheritedoriginalName : String
[read-only] The original name used for this asset in the resource (e.g.
NamedAssetBase
 Inheritedpasses : Vector.<MaterialPassBase>
[read-only] Any passes required that render to a texture used by this method.
ShadingMethodBase
  projector : TextureProjector
The TextureProjector object that defines the projection properties as well as the texture.
ProjectiveTextureMethod
Protected Properties
 PropertyDefined By
 Inherited_passes : Vector.<MaterialPassBase>
ShadingMethodBase
 Inherited_sharedRegisters : ShaderRegisterData
ShadingMethodBase
Public Methods
 MethodDefined By
  
ProjectiveTextureMethod(projector:TextureProjector, mode:String = multiply)
Creates a new ProjectiveTextureMethod object.
ProjectiveTextureMethod
 Inherited
assetPathEquals(name:String, ns:String):Boolean
NamedAssetBase
 Inherited
Copies the state from a ShadingMethodBase object into the current object.
ShadingMethodBase
 Inherited
dispose():void
Cleans up any resources used by the current object.
ShadingMethodBase
 Inherited
resetAssetPath(name:String, ns:String = null, overrideOriginal:Boolean = true):void
NamedAssetBase
Protected Methods
 MethodDefined By
 Inherited
getTex2DSampleCode(vo:MethodVO, targetReg:ShaderRegisterElement, inputReg:ShaderRegisterElement, texture:TextureProxyBase, 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
A helper method that generates standard code for sampling from a cube texture.
ShadingMethodBase
 Inherited
Marks the shader program as invalid, so it will be recompiled before the next render.
ShadingMethodBase
Public Constants
 ConstantDefined By
  ADD : String = add
[static]
ProjectiveTextureMethod
 InheritedDEFAULT_NAMESPACE : String = default
[static]
NamedAssetBase
  MIX : String = mix
[static]
ProjectiveTextureMethod
  MULTIPLY : String = multiply
[static]
ProjectiveTextureMethod
Property Detail
modeproperty
mode:String

The blend mode with which the texture is blended unto the object. ProjectiveTextureMethod.MULTIPLY can be used to project shadows. To prevent clamping, the texture's alpha should be white! ProjectiveTextureMethod.ADD can be used to project light, such as a slide projector or light coming through stained glass. To prevent clamping, the texture's alpha should be black! ProjectiveTextureMethod.MIX provides normal alpha blending. To prevent clamping, the texture's alpha should be transparent!


Implementation
    public function get mode():String
    public function set mode(value:String):void
projectorproperty 
projector:TextureProjector

The TextureProjector object that defines the projection properties as well as the texture.


Implementation
    public function get projector():TextureProjector
    public function set projector(value:TextureProjector):void

See also

Constructor Detail
ProjectiveTextureMethod()Constructor
public function ProjectiveTextureMethod(projector:TextureProjector, mode:String = multiply)

Creates a new ProjectiveTextureMethod object.

Parameters
projector:TextureProjector — The TextureProjector object that defines the projection properties as well as the texture.
 
mode:String (default = multiply) — The blend mode with which the texture is blended unto the surface.

See also

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

getFragmentCode()method 
override arcane function getFragmentCode(vo:MethodVO, regCache:ShaderRegisterCache, targetReg:ShaderRegisterElement):String

Parameters

vo:MethodVO
 
regCache:ShaderRegisterCache
 
targetReg:ShaderRegisterElement

Returns
String
getVertexCode()method 
override arcane function getVertexCode(vo:MethodVO, regCache:ShaderRegisterCache):String

Parameters

vo:MethodVO
 
regCache:ShaderRegisterCache

Returns
String
initConstants()method 
override arcane function initConstants(vo:MethodVO):void

Initializes unchanging shader constants using the data from a MethodVO.

Parameters

vo:MethodVO — The MethodVO object linking this method with the pass currently being compiled.

setRenderState()method 
override arcane function setRenderState(vo:MethodVO, renderable:IRenderable, stage3DProxy:Stage3DProxy, camera:Camera3D):void

Sets the render state for a single renderable.

Parameters

vo:MethodVO — The MethodVO object linking this method with the pass currently being compiled.
 
renderable:IRenderable — The renderable currently being rendered.
 
stage3DProxy:Stage3DProxy — The Stage3DProxy object currently used for rendering.
 
camera:Camera3D — The camera from which the scene is currently rendered.

Constant Detail
ADDConstant
public static const ADD:String = add

MIXConstant 
public static const MIX:String = mix

MULTIPLYConstant 
public static const MULTIPLY:String = multiply