Packagelaya.d3.core.material
Classpublic class WaterMaterial
InheritanceWaterMaterial Inheritance BaseMaterial Inheritance laya.resource.Resource



Public Properties
 PropertyDefined By
 InheritedalphaTest : Boolean
获取是否透明裁剪。
BaseMaterial
 InheritedalphaTestValue : Number
获取透明测试模式裁剪值。
BaseMaterial
 Inheritedblend : int
透明混合。
BaseMaterial
 InheritedblendConstColor : Vector4
混合常量颜色。
BaseMaterial
 InheritedblendEquation : int
混合方程。
BaseMaterial
 InheritedblendEquationAlpha : int
Alpha混合方程。
BaseMaterial
 InheritedblendEquationRGB : int
RGB混合方程。
BaseMaterial
 Inheritedcull : int
渲染剔除。
BaseMaterial
  currentTm : Number
WaterMaterial
  deepColorTexture : BaseTexture
WaterMaterial
  deepScale : Number
WaterMaterial
 InheriteddepthFunc : int
深度测试函数。
BaseMaterial
 InheriteddepthTest : Boolean
是否深度测试。
BaseMaterial
 InheriteddepthWrite : Boolean
是否深度写入。
BaseMaterial
  detailTexture : BaseTexture
WaterMaterial
  diffuseTexture : BaseTexture
获取漫反射贴图。
WaterMaterial
 InheriteddstBlend : int
目标混合参数,在blend为BLEND_ENABLE_ALL时生效。
BaseMaterial
 InheriteddstBlendAlpha : int
Alpha目标混合参数,在blend为BLEND_ENABLE_SEPERATE时生效。
BaseMaterial
 InheriteddstBlendRGB : int
RGB目标混合参数,在blend为BLEND_ENABLE_SEPERATE时生效。
BaseMaterial
  foamTexture : BaseTexture
WaterMaterial
  geoWaveUVScale : Number
WaterMaterial
  normalTexture : BaseTexture
获取法线贴图。
WaterMaterial
  renderMode : int
[write-only]
WaterMaterial
 InheritedrenderQueue : int
所属渲染队列.
BaseMaterial
  scrsize : Float32Array
[write-only]
WaterMaterial
  seaColor : Float32Array
WaterMaterial
  SHADERDEFINE_CUBE_ENV : int = 0
[static]
WaterMaterial
  SHADERDEFINE_HDR_ENV : int = 0
[static]
WaterMaterial
  SHADERDEFINE_SHOW_NORMAL : int = 0
[static]
WaterMaterial
  SHADERDEFINE_USE_FOAM : int = 0
[static]
WaterMaterial
  SHADERDEFINE_USE_REFRACT_TEX : int = 0
[static]
WaterMaterial
  SHADERDEFINE_USEVERTEXHEIGHT : int = 0
[static] 如果定义了这个宏,就不再使用深度纹理,可以提高速度,但是建模麻烦一些。
WaterMaterial
  skyTexture : BaseTexture
WaterMaterial
 InheritedsrcBlend : int
源混合参数,在blend为BLEND_ENABLE_ALL时生效。
BaseMaterial
 InheritedsrcBlendAlpha : int
Alpha源混合参数,在blend为BLEND_ENABLE_SEPERATE时生效。
BaseMaterial
 InheritedsrcBlendRGB : int
RGB源混合参数,在blend为BLEND_ENABLE_SEPERATE时生效。
BaseMaterial
  underWaterTexture : BaseTexture
WaterMaterial
  useFoam : Boolean
[write-only]
WaterMaterial
  useRefractTexture : Boolean
[write-only]
WaterMaterial
  useVertexDeep : Boolean
WaterMaterial
  vertexDispTexture : BaseTexture
对定点进行变换的纹理。现在不用
WaterMaterial
  waterInfoTexture : BaseTexture
WaterMaterial
  waveInfo : Float32Array
WaterMaterial
  waveInfoD : Float32Array
WaterMaterial
  waveMainDir : Number
WaterMaterial
  windDir : Number
WaterMaterial
  windSpeed : Number
WaterMaterial
Public Methods
 MethodDefined By
  
WaterMaterial
 Inherited
设置渲染相关状态。
BaseMaterial
 Inherited
_setRenderStateFrontFace(isTarget:Boolean, transform:Transform3D):void
设置渲染相关状态。
BaseMaterial
 Inherited
_upload():void
上传材质。
BaseMaterial
 Inherited
clone():*
克隆。
BaseMaterial
 Inherited
cloneTo(destObject:*):void
克隆。
BaseMaterial
  
disableFog():void
禁用雾化。
WaterMaterial
  
load(url:String):WaterMaterial
[static] 加载标准材质。
WaterMaterial
  
onAsynLoaded(url:String, data:*, params:Array):void
[override]
WaterMaterial
 Inherited
setShaderName(name:String):void
设置使用Shader名字。
BaseMaterial
Protected Methods
 MethodDefined By
 Inherited
增加禁用宏定义。
BaseMaterial
 Inherited
_addShaderDefine(value:int):void
增加Shader宏定义。
BaseMaterial
 Inherited
_getBool(shaderIndex:int):*
获取布尔。
BaseMaterial
 Inherited
_getBuffer(shaderIndex:int):*
获取Buffer。
BaseMaterial
 Inherited
_getColor(shaderIndex:int):*
获取颜色。
BaseMaterial
 Inherited
_getInt(shaderIndex:int):*
获取整形。
BaseMaterial
 Inherited
_getMatrix4x4(shaderIndex:int):*
获取矩阵。
BaseMaterial
 Inherited
_getNumber(shaderIndex:int):*
获取浮点。
BaseMaterial
 Inherited
_getTexture(shaderIndex:int):BaseTexture
获取纹理。
BaseMaterial
 Inherited
_getVector2(shaderIndex:int):*
获取二维向量。
BaseMaterial
 Inherited
移除禁用宏定义。
BaseMaterial
 Inherited
_removeShaderDefine(value:int):void
移除Shader宏定义。
BaseMaterial
 Inherited
_setBool(shaderIndex:int, b:Boolean):void
设置布尔。
BaseMaterial
 Inherited
_setBuffer(shaderIndex:int, buffer:Float32Array):void
设置Buffer。
BaseMaterial
 Inherited
_setColor(shaderIndex:int, color:*):void
设置颜色。
BaseMaterial
 Inherited
_setInt(shaderIndex:int, i:int):void
设置整型。
BaseMaterial
 Inherited
_setMatrix4x4(shaderIndex:int, matrix4x4:Matrix4x4):void
设置矩阵。
BaseMaterial
 Inherited
_setNumber(shaderIndex:int, number:Number):void
设置浮点。
BaseMaterial
 Inherited
_setTexture(shaderIndex:int, texture:BaseTexture):void
设置纹理。
BaseMaterial
 Inherited
_setVector2(shaderIndex:int, vector2:Vector2):void
设置二维向量。
BaseMaterial
Public Constants
 ConstantDefined By
 InheritedBLEND_DISABLE : int = 0
[static] 混合枚举_禁用。
BaseMaterial
 InheritedBLEND_ENABLE_ALL : int = 1
[static] 混合枚举_启用_RGB和Alpha统一混合。
BaseMaterial
 InheritedBLEND_ENABLE_SEPERATE : int = 2
[static] 混合枚举_启用_RGB和Alpha单独混合。
BaseMaterial
 InheritedBLENDEQUATION_ADD : int = 0
[static] 混合方程枚举_加法,例:source + destination
BaseMaterial
 InheritedBLENDEQUATION_REVERSE_SUBTRACT : int = 2
[static] 混合方程枚举_反序减法,例:destination - source
BaseMaterial
 InheritedBLENDEQUATION_SUBTRACT : int = 1
[static] 混合方程枚举_减法,例:source - destination
BaseMaterial
 InheritedBLENDPARAM_CONSTANT_ALPHA : int = 0x8003
[static] 混合参数枚举_常量阿尔法,例:RGB(Ac, Ac, Ac),Alpha(Ac)。
BaseMaterial
 InheritedBLENDPARAM_CONSTANT_COLOR : int = 0x8001
[static] 混合参数枚举_常量颜色,例:RGB(Rc, Gc, Bc),Alpha(Ac)。
BaseMaterial
 InheritedBLENDPARAM_DST_ALPHA : int = 0x0304
[static] 混合参数枚举_目标阿尔法,例:RGB(Ad, Ad, Ad),Alpha(Ad)。
BaseMaterial
 InheritedBLENDPARAM_DST_COLOR : int = 0x0306
[static] 混合参数枚举_目标颜色,例:RGB(Rd, Gd, Bd),Alpha(Ad)。
BaseMaterial
 InheritedBLENDPARAM_ONE : int = 1
[static] 混合参数枚举_一,例:RGB(1,1,1),Alpha:(1)。
BaseMaterial
 InheritedBLENDPARAM_ONE_MINUS_CONSTANT_ALPHA : int = 0x8004
[static] 混合参数枚举_一减常量阿尔法,例:RGB(1-Ac, 1-Ac, 1-Ac),Alpha(1-Ac)。
BaseMaterial
 InheritedBLENDPARAM_ONE_MINUS_CONSTANT_COLOR : int = 0x8002
[static] 混合参数枚举_一减常量颜色,例:RGB(1-Rc, 1-Gc, 1-Bc),Alpha(1-Ac)。
BaseMaterial
 InheritedBLENDPARAM_ONE_MINUS_DST_ALPHA : int = 0x0305
[static] 混合参数枚举_一减目标阿尔法,例:RGB(1-Ad, 1-Ad, 1-Ad),Alpha(Ad)。
BaseMaterial
 InheritedBLENDPARAM_ONE_MINUS_DST_COLOR : int = 0x0307
[static] 混合参数枚举_一减目标颜色,例:RGB(1-Rd, 1-Gd, 1-Bd),Alpha(1-Ad)。
BaseMaterial
 InheritedBLENDPARAM_ONE_MINUS_SRC_ALPHA : int = 0x0303
[static] 混合参数枚举_一减源阿尔法,例:RGB(1-As, 1-As, 1-As),Alpha(1-As)。
BaseMaterial
 InheritedBLENDPARAM_ONE_MINUS_SRC_COLOR : int = 0x0301
[static] 混合参数枚举_一减源颜色,例:RGB(1-Rs, 1-Gs, 1-Bs),Alpha(1-As)。
BaseMaterial
 InheritedBLENDPARAM_SRC_ALPHA : int = 0x0302
[static] 混合参数枚举_源透明,例:RGB(As, As, As),Alpha(1-As)。
BaseMaterial
 InheritedBLENDPARAM_SRC_ALPHA_SATURATE : int = 0x0308
[static] 混合参数枚举_阿尔法饱和,例:RGB(min(As, 1 - Ad), min(As, 1 - Ad), min(As, 1 - Ad)),Alpha(1)。
BaseMaterial
 InheritedBLENDPARAM_SRC_COLOR : int = 0x0300
[static] 混合参数枚举_源颜色,例:RGB(Rs, Gs, Bs),Alpha(As)。
BaseMaterial
 InheritedBLENDPARAM_ZERO : int = 0
[static] 混合参数枚举_零,例:RGB(0,0,0),Alpha:(1)。
BaseMaterial
 InheritedCULL_BACK : int = 2
[static] 剔除枚举_剔除背面。
BaseMaterial
 InheritedCULL_FRONT : int = 1
[static] 剔除枚举_剔除正面。
BaseMaterial
 InheritedCULL_NONE : int = 0
[static] 剔除枚举_不剔除。
BaseMaterial
  CURTM : int = 8
[static]
WaterMaterial
  DEEPCOLORTEXTURE : int = 10
[static]
WaterMaterial
  defaultMaterial : WaterMaterial
[static] 默认材质,禁止修改
WaterMaterial
 InheritedDEPTHFUNC_ALWAYS : int = 0x0207
[static] 深度测试函数枚举_总是通过。
BaseMaterial
 InheritedDEPTHFUNC_EQUAL : int = 0x0202
[static] 深度测试函数枚举_等于时通过。
BaseMaterial
 InheritedDEPTHFUNC_GEQUAL : int = 0x0206
[static] 深度测试函数枚举_大于等于时通过。
BaseMaterial
 InheritedDEPTHFUNC_GREATER : int = 0x0204
[static] 深度测试函数枚举_大于时通过。
BaseMaterial
 InheritedDEPTHFUNC_LEQUAL : int = 0x0203
[static] 深度测试函数枚举_小于等于时通过。
BaseMaterial
 InheritedDEPTHFUNC_LESS : int = 0x0201
[static] 深度测试函数枚举_小于时通过。
BaseMaterial
 InheritedDEPTHFUNC_NEVER : int = 0x0200
[static] 深度测试函数枚举_从不通过。
BaseMaterial
 InheritedDEPTHFUNC_NOTEQUAL : int = 0x0205
[static] 深度测试函数枚举_不等于时通过。
BaseMaterial
  DETAILTEXTURE : int = 9
[static]
WaterMaterial
  DIFFUSETEXTURE : int = 1
[static]
WaterMaterial
  FOAMTEXTURE : int = 17
[static]
WaterMaterial
  GEOWAVE_UV_SCALE : int = 18
[static]
WaterMaterial
  NORMALTEXTURE : int = 2
[static]
WaterMaterial
  RENDERMODE_CUTOUT : int = 3
[static] 渲染状态_透明测试。
WaterMaterial
  RENDERMODE_CUTOUTDOUBLEFACE : int = 4
[static] 渲染状态_透明测试_双面。
WaterMaterial
  RENDERMODE_OPAQUE : int = 1
[static] 渲染状态_不透明。
WaterMaterial
  RENDERMODE_OPAQUEDOUBLEFACE : int = 2
[static] 渲染状态_不透明_双面。
WaterMaterial
  RENDERMODE_TRANSPARENT : int = 13
[static] 渲染状态_透明混合。
WaterMaterial
  SCRSIZE : int = 15
[static]
WaterMaterial
  SEA_COLOR : int = 19
[static]
WaterMaterial
  SKYTEXTURE : int = 11
[static]
WaterMaterial
  UNDERWATERTEXTURE : int = 3
[static]
WaterMaterial
  UVAGE : int = 7
[static]
WaterMaterial
  UVANIAGE : int = 5
[static]
WaterMaterial
  UVMATRIX : int = 6
[static]
WaterMaterial
  VERTEXDISPTEXTURE : int = 4
[static]
WaterMaterial
  WATERINFO : int = 16
[static]
WaterMaterial
  WAVEINFO : int = 12
[static]
WaterMaterial
  WAVEINFOD : int = 13
[static]
WaterMaterial
  WAVEINFODEEPSCALE : int = 20
[static]
WaterMaterial
  WAVEMAINDIR : int = 14
[static]
WaterMaterial
Property Detail
currentTmproperty
currentTm:Number


Implementation
    public function get currentTm():Number
    public function set currentTm(value:Number):void
deepColorTextureproperty 
deepColorTexture:BaseTexture


Implementation
    public function get deepColorTexture():BaseTexture
    public function set deepColorTexture(value:BaseTexture):void
deepScaleproperty 
deepScale:Number


Implementation
    public function get deepScale():Number
    public function set deepScale(value:Number):void
detailTextureproperty 
detailTexture:BaseTexture


Implementation
    public function get detailTexture():BaseTexture
    public function set detailTexture(value:BaseTexture):void
diffuseTextureproperty 
diffuseTexture:BaseTexture

获取漫反射贴图。


Implementation
    public function get diffuseTexture():BaseTexture
    public function set diffuseTexture(value:BaseTexture):void
foamTextureproperty 
foamTexture:BaseTexture


Implementation
    public function get foamTexture():BaseTexture
    public function set foamTexture(value:BaseTexture):void
geoWaveUVScaleproperty 
geoWaveUVScale:Number


Implementation
    public function get geoWaveUVScale():Number
    public function set geoWaveUVScale(value:Number):void
normalTextureproperty 
normalTexture:BaseTexture

获取法线贴图。


Implementation
    public function get normalTexture():BaseTexture
    public function set normalTexture(value:BaseTexture):void
renderModeproperty 
renderMode:int  [write-only]


Implementation
    public function set renderMode(value:int):void
scrsizeproperty 
scrsize:Float32Array  [write-only]


Implementation
    public function set scrsize(value:Float32Array):void
seaColorproperty 
seaColor:Float32Array


Implementation
    public function get seaColor():Float32Array
    public function set seaColor(value:Float32Array):void
SHADERDEFINE_CUBE_ENVproperty 
public static var SHADERDEFINE_CUBE_ENV:int = 0

SHADERDEFINE_HDR_ENVproperty 
public static var SHADERDEFINE_HDR_ENV:int = 0

SHADERDEFINE_SHOW_NORMALproperty 
public static var SHADERDEFINE_SHOW_NORMAL:int = 0

SHADERDEFINE_USE_FOAMproperty 
public static var SHADERDEFINE_USE_FOAM:int = 0

SHADERDEFINE_USE_REFRACT_TEXproperty 
public static var SHADERDEFINE_USE_REFRACT_TEX:int = 0

SHADERDEFINE_USEVERTEXHEIGHTproperty 
public static var SHADERDEFINE_USEVERTEXHEIGHT:int = 0

如果定义了这个宏,就不再使用深度纹理,可以提高速度,但是建模麻烦一些。

skyTextureproperty 
skyTexture:BaseTexture


Implementation
    public function get skyTexture():BaseTexture
    public function set skyTexture(value:BaseTexture):void
underWaterTextureproperty 
underWaterTexture:BaseTexture


Implementation
    public function get underWaterTexture():BaseTexture
    public function set underWaterTexture(value:BaseTexture):void
useFoamproperty 
useFoam:Boolean  [write-only]


Implementation
    public function set useFoam(value:Boolean):void
useRefractTextureproperty 
useRefractTexture:Boolean  [write-only]


Implementation
    public function set useRefractTexture(value:Boolean):void
useVertexDeepproperty 
useVertexDeep:Boolean


Implementation
    public function get useVertexDeep():Boolean
    public function set useVertexDeep(value:Boolean):void
vertexDispTextureproperty 
vertexDispTexture:BaseTexture

对定点进行变换的纹理。现在不用


Implementation
    public function get vertexDispTexture():BaseTexture
    public function set vertexDispTexture(value:BaseTexture):void
waterInfoTextureproperty 
waterInfoTexture:BaseTexture


Implementation
    public function get waterInfoTexture():BaseTexture
    public function set waterInfoTexture(value:BaseTexture):void
waveInfoproperty 
waveInfo:Float32Array


Implementation
    public function get waveInfo():Float32Array
    public function set waveInfo(value:Float32Array):void
waveInfoDproperty 
waveInfoD:Float32Array


Implementation
    public function get waveInfoD():Float32Array
    public function set waveInfoD(value:Float32Array):void
waveMainDirproperty 
waveMainDir:Number


Implementation
    public function get waveMainDir():Number
    public function set waveMainDir(value:Number):void
windDirproperty 
windDir:Number


Implementation
    public function get windDir():Number
    public function set windDir(value:Number):void
windSpeedproperty 
windSpeed:Number


Implementation
    public function get windSpeed():Number
    public function set windSpeed(value:Number):void
Constructor Detail
WaterMaterial()Constructor
public function WaterMaterial()



Method Detail
disableFog()method
public function disableFog():void

禁用雾化。

load()method 
public static function load(url:String):WaterMaterial

加载标准材质。

Parameters

url:String — 标准材质地址。

Returns
WaterMaterial
onAsynLoaded()method 
override public function onAsynLoaded(url:String, data:*, params:Array):void

Parameters

url:String
 
data:*
 
params:Array

Constant Detail
CURTMConstant
public static const CURTM:int = 8

DEEPCOLORTEXTUREConstant 
public static const DEEPCOLORTEXTURE:int = 10

defaultMaterialConstant 
public static const defaultMaterial:WaterMaterial

默认材质,禁止修改

DETAILTEXTUREConstant 
public static const DETAILTEXTURE:int = 9

DIFFUSETEXTUREConstant 
public static const DIFFUSETEXTURE:int = 1

FOAMTEXTUREConstant 
public static const FOAMTEXTURE:int = 17

GEOWAVE_UV_SCALEConstant 
public static const GEOWAVE_UV_SCALE:int = 18

NORMALTEXTUREConstant 
public static const NORMALTEXTURE:int = 2

RENDERMODE_CUTOUTConstant 
public static const RENDERMODE_CUTOUT:int = 3

渲染状态_透明测试。

RENDERMODE_CUTOUTDOUBLEFACEConstant 
public static const RENDERMODE_CUTOUTDOUBLEFACE:int = 4

渲染状态_透明测试_双面。

RENDERMODE_OPAQUEConstant 
public static const RENDERMODE_OPAQUE:int = 1

渲染状态_不透明。

RENDERMODE_OPAQUEDOUBLEFACEConstant 
public static const RENDERMODE_OPAQUEDOUBLEFACE:int = 2

渲染状态_不透明_双面。

RENDERMODE_TRANSPARENTConstant 
public static const RENDERMODE_TRANSPARENT:int = 13

渲染状态_透明混合。

SCRSIZEConstant 
public static const SCRSIZE:int = 15

SEA_COLORConstant 
public static const SEA_COLOR:int = 19

SKYTEXTUREConstant 
public static const SKYTEXTURE:int = 11

UNDERWATERTEXTUREConstant 
public static const UNDERWATERTEXTURE:int = 3

UVAGEConstant 
public static const UVAGE:int = 7

UVANIAGEConstant 
public static const UVANIAGE:int = 5

UVMATRIXConstant 
public static const UVMATRIX:int = 6

VERTEXDISPTEXTUREConstant 
public static const VERTEXDISPTEXTURE:int = 4

WATERINFOConstant 
public static const WATERINFO:int = 16

WAVEINFOConstant 
public static const WAVEINFO:int = 12

WAVEINFODConstant 
public static const WAVEINFOD:int = 13

WAVEINFODEEPSCALEConstant 
public static const WAVEINFODEEPSCALE:int = 20

WAVEMAINDIRConstant 
public static const WAVEMAINDIR:int = 14