Packageaway3d.materials.methods
Classpublic class TerrainDiffuseMethod
InheritanceTerrainDiffuseMethod Inheritance BasicDiffuseMethod Inheritance LightingMethodBase Inheritance ShadingMethodBase Inheritance NamedAssetBase Inheritance flash.events.EventDispatcher

TerrainDiffuseMethod provides a diffuse method that uses different tiled textures with alpha masks to create a large surface with high detail and less apparent tiling.



Public Properties
 PropertyDefined By
  alphaThreshold : Number
[override] The minimum alpha value for which pixels should be drawn.
TerrainDiffuseMethod
 InheritedassetFullPath : Array
[read-only]
NamedAssetBase
 InheritedassetNamespace : String
[read-only]
NamedAssetBase
 InheriteddiffuseAlpha : Number
The alpha component of the diffuse reflection.
BasicDiffuseMethod
 InheriteddiffuseColor : uint
The color of the diffuse reflection when not using a texture.
BasicDiffuseMethod
 Inheritedid : String
NamedAssetBase
 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
 Inheritedtexture : Texture2DBase
The bitmapData to use to define the diffuse reflection color per texel.
BasicDiffuseMethod
 Inherited_totalLightColorReg : ShaderRegisterElement
BasicDiffuseMethod
Protected Properties
 PropertyDefined By
 Inherited_alphaThreshold : Number = 0
BasicDiffuseMethod
 Inherited_diffuseInputRegister : ShaderRegisterElement
BasicDiffuseMethod
 Inherited_isFirstLight : Boolean
BasicDiffuseMethod
 Inherited_passes : Vector.<MaterialPassBase>
ShadingMethodBase
 Inherited_shadowRegister : ShaderRegisterElement
BasicDiffuseMethod
 Inherited_sharedRegisters : ShaderRegisterData
ShadingMethodBase
 Inherited_useTexture : Boolean
BasicDiffuseMethod
Public Methods
 MethodDefined By
  
TerrainDiffuseMethod(splatTextures:Array, blendingTexture:Texture2DBase, tileData:Array)
Creates a new TerrainDiffuseMethod.
TerrainDiffuseMethod
 Inherited
assetPathEquals(name:String, ns:String):Boolean
NamedAssetBase
 Inherited
[override] Copies the state from a ShadingMethodBase object into the current object.
BasicDiffuseMethod
 Inherited
dispose():void
[override] Cleans up any resources used by the current object.
BasicDiffuseMethod
 Inherited
generateMip(stage3DProxy:Stage3DProxy):void
Forces the creation of the texture.
BasicDiffuseMethod
 Inherited
resetAssetPath(name:String, ns:String = null, overrideOriginal:Boolean = true):void
NamedAssetBase
Protected Methods
 MethodDefined By
 Inherited
Generate the code that applies the calculated shadow to the diffuse light
BasicDiffuseMethod
  
Gets the sample code for a single splat.
TerrainDiffuseMethod
 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
 InheritedDEFAULT_NAMESPACE : String = default
[static]
NamedAssetBase
Property Detail
alphaThresholdproperty
alphaThreshold:Number[override]

The minimum alpha value for which pixels should be drawn. This is used for transparency that is either invisible or entirely opaque, often used with textures for foliage, etc. Recommended values are 0 to disable alpha, or 0.5 to create smooth edges. Default value is 0 (disabled).


Implementation
    public function get alphaThreshold():Number
    public function set alphaThreshold(value:Number):void
Constructor Detail
TerrainDiffuseMethod()Constructor
public function TerrainDiffuseMethod(splatTextures:Array, blendingTexture:Texture2DBase, tileData:Array)

Creates a new TerrainDiffuseMethod.

Parameters
splatTextures:Array — An array of Texture2DProxyBase containing the detailed textures to be tiled.
 
blendingTexture:Texture2DBase — The texture containing the blending data. The red, green, and blue channels contain the blending values for each of the textures in splatTextures, respectively.
 
tileData:Array — The amount of times each splat texture needs to be tiled. The first entry in the array applies to the base texture, the others to the splats. If omitted, the default value of 50 is assumed for each.
Method Detail
activate()method
override arcane function activate(vo:MethodVO, stage3DProxy:Stage3DProxy):void

Parameters

vo:MethodVO
 
stage3DProxy:Stage3DProxy

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

Parameters

vo:MethodVO
 
regCache:ShaderRegisterCache
 
targetReg:ShaderRegisterElement

Returns
String
getSplatSampleCode()method 
protected function getSplatSampleCode(vo:MethodVO, targetReg:ShaderRegisterElement, inputReg:ShaderRegisterElement, texture:TextureProxyBase, uvReg:ShaderRegisterElement = null):String

Gets the sample code for a single splat.

Parameters

vo:MethodVO
 
targetReg:ShaderRegisterElement
 
inputReg:ShaderRegisterElement
 
texture:TextureProxyBase
 
uvReg:ShaderRegisterElement (default = null)

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.