Packagelaya.d3.shader
Classpublic class ShaderCompile3D
InheritanceShaderCompile3D Inheritance Object



Public Properties
 PropertyDefined By
  _conchShader : *
ShaderCompile3D
  debugMode : Boolean = false
[static] 是否开启调试模式。
ShaderCompile3D
  _materialInt2name : Array
ShaderCompile3D
  _materialName2Int : Object
ShaderCompile3D
  _preCompileShader : Object
[static]
ShaderCompile3D
  SAHDERDEFINE_DEPTHFOG : int = 0x20000
[static]
ShaderCompile3D
  SHADERDEFINE_COLOR : int = 0x80
[static]
ShaderCompile3D
  SHADERDEFINE_DIRECTIONLIGHT : int = 0x8
[static]
ShaderCompile3D
  SHADERDEFINE_FOG : int = 0x4
[static]
ShaderCompile3D
  SHADERDEFINE_HIGHPRECISION : int = 0x1
[static]
ShaderCompile3D
  SHADERDEFINE_POINTLIGHT : int = 0x10
[static]
ShaderCompile3D
  SHADERDEFINE_SPOTLIGHT : int = 0x20
[static]
ShaderCompile3D
  SHADERDEFINE_UV0 : int = 0x40
[static]
ShaderCompile3D
  SHADERDEFINE_UV1 : int = 0x100
[static]
ShaderCompile3D
  sharders : Array
ShaderCompile3D
  _spriteInt2name : Array
ShaderCompile3D
Public Methods
 MethodDefined By
  
ShaderCompile3D(name:Number, vs:String, ps:String, attributeMap:Object, uniformMap:Object, includeFiles:*)
ShaderCompile3D
  
add(nameID:int, vs:String, ps:String, attributeMap:Object, uniformMap:Object):ShaderCompile3D
[static] 添加预编译shader文件,主要是处理宏定义
ShaderCompile3D
  
createShader(publicDefine:Object, spriteDefine:Object, materialDefine:Object):Shader3D
ShaderCompile3D
  
get(name:String):ShaderCompile3D
[static] 获取ShaderCompile3D。
ShaderCompile3D
  
getMaterialDefineByName(name:String):int
通过名称获取宏定义值。
ShaderCompile3D
  
precompileShaderWithShaderDefine(publicDefine:int, spriteDefine:int, materialDefine:int):void
通过宏定义预编译shader。
ShaderCompile3D
  
registerMaterialDefine(name:String):int
注册材质宏定义。
ShaderCompile3D
  
registerSpriteDefine(name:String):int
注册精灵宏定义。
ShaderCompile3D
  
withCompile(publicDefine:int, spriteDefine:int, materialDefine:int):Shader3D
根据宏动态生成shader文件,支持#include?COLOR_FILTER "parts/ColorFilter_ps_logic.glsl";条件嵌入文件
ShaderCompile3D
Public Constants
 ConstantDefined By
  IFDEF_ELSE : int = 2
[static]
ShaderCompile3D
  IFDEF_NO : int = 0
[static]
ShaderCompile3D
  IFDEF_YES : int = 1
[static]
ShaderCompile3D
Property Detail
_conchShaderproperty
public var _conchShader:*

_materialInt2nameproperty 
public var _materialInt2name:Array

_materialName2Intproperty 
public var _materialName2Int:Object

_preCompileShaderproperty 
public static var _preCompileShader:Object

_spriteInt2nameproperty 
public var _spriteInt2name:Array

debugModeproperty 
public static var debugMode:Boolean = false

是否开启调试模式。

SAHDERDEFINE_DEPTHFOGproperty 
public static var SAHDERDEFINE_DEPTHFOG:int = 0x20000

SHADERDEFINE_COLORproperty 
public static var SHADERDEFINE_COLOR:int = 0x80

SHADERDEFINE_DIRECTIONLIGHTproperty 
public static var SHADERDEFINE_DIRECTIONLIGHT:int = 0x8

SHADERDEFINE_FOGproperty 
public static var SHADERDEFINE_FOG:int = 0x4

SHADERDEFINE_HIGHPRECISIONproperty 
public static var SHADERDEFINE_HIGHPRECISION:int = 0x1

SHADERDEFINE_POINTLIGHTproperty 
public static var SHADERDEFINE_POINTLIGHT:int = 0x10

SHADERDEFINE_SPOTLIGHTproperty 
public static var SHADERDEFINE_SPOTLIGHT:int = 0x20

SHADERDEFINE_UV0property 
public static var SHADERDEFINE_UV0:int = 0x40

SHADERDEFINE_UV1property 
public static var SHADERDEFINE_UV1:int = 0x100

shardersproperty 
public var sharders:Array

Constructor Detail
ShaderCompile3D()Constructor
public function ShaderCompile3D(name:Number, vs:String, ps:String, attributeMap:Object, uniformMap:Object, includeFiles:*)



Parameters
name:Number
 
vs:String
 
ps:String
 
attributeMap:Object
 
uniformMap:Object
 
includeFiles:*
Method Detail
add()method
public static function add(nameID:int, vs:String, ps:String, attributeMap:Object, uniformMap:Object):ShaderCompile3D

添加预编译shader文件,主要是处理宏定义

Parameters

nameID:int
 
vs:String
 
ps:String
 
attributeMap:Object
 
uniformMap:Object

Returns
ShaderCompile3D
createShader()method 
public function createShader(publicDefine:Object, spriteDefine:Object, materialDefine:Object):Shader3D

Parameters

publicDefine:Object
 
spriteDefine:Object
 
materialDefine:Object

Returns
Shader3D
get()method 
public static function get(name:String):ShaderCompile3D

获取ShaderCompile3D。

Parameters

name:String

Returns
ShaderCompile3D — ShaderCompile3D。
getMaterialDefineByName()method 
public function getMaterialDefineByName(name:String):int

通过名称获取宏定义值。

Parameters

name:String — 名称。

Returns
int — 宏定义值。
precompileShaderWithShaderDefine()method 
public function precompileShaderWithShaderDefine(publicDefine:int, spriteDefine:int, materialDefine:int):void

通过宏定义预编译shader。

Parameters

publicDefine:int — 精灵宏定义数组。
 
spriteDefine:int — 公共宏定义值。
 
materialDefine:int — 精灵宏定义值。

registerMaterialDefine()method 
public function registerMaterialDefine(name:String):int

注册材质宏定义。

Parameters

name:String — 宏定义名称。

Returns
int
registerSpriteDefine()method 
public function registerSpriteDefine(name:String):int

注册精灵宏定义。

Parameters

name:String — 宏定义名称。

Returns
int
withCompile()method 
public function withCompile(publicDefine:int, spriteDefine:int, materialDefine:int):Shader3D

根据宏动态生成shader文件,支持#include?COLOR_FILTER "parts/ColorFilter_ps_logic.glsl";条件嵌入文件

Parameters

publicDefine:int
 
spriteDefine:int
 
materialDefine:int

Returns
Shader3D
Constant Detail
IFDEF_ELSEConstant
public static const IFDEF_ELSE:int = 2

IFDEF_NOConstant 
public static const IFDEF_NO:int = 0

IFDEF_YESConstant 
public static const IFDEF_YES:int = 1