| Package | laya.d3.core.material |
| Class | public class BaseMaterial |
| Inheritance | BaseMaterial laya.resource.Resource |
| Implements | laya.d3.core.IClone |
| Subclasses | ExtendTerrainMaterial, GlitterMaterial, PBRMaterial, ShurikenParticleMaterial, StandardMaterial, TerrainMaterial, WaterDetailMaterial, WaterMaterial |
BaseMaterial 类用于创建材质,抽象类,不允许实例。
| Property | Defined By | ||
|---|---|---|---|
| alphaTest : Boolean
获取是否透明裁剪。
| BaseMaterial | ||
| alphaTestValue : Number
获取透明测试模式裁剪值。
| BaseMaterial | ||
| blend : int 透明混合。 | BaseMaterial | ||
| blendConstColor : Vector4 混合常量颜色。 | BaseMaterial | ||
| blendEquation : int 混合方程。 | BaseMaterial | ||
| blendEquationAlpha : int Alpha混合方程。 | BaseMaterial | ||
| blendEquationRGB : int RGB混合方程。 | BaseMaterial | ||
| cull : int 渲染剔除。 | BaseMaterial | ||
| depthFunc : int 深度测试函数。 | BaseMaterial | ||
| depthTest : Boolean 是否深度测试。 | BaseMaterial | ||
| depthWrite : Boolean 是否深度写入。 | BaseMaterial | ||
| dstBlend : int 目标混合参数,在blend为BLEND_ENABLE_ALL时生效。 | BaseMaterial | ||
| dstBlendAlpha : int Alpha目标混合参数,在blend为BLEND_ENABLE_SEPERATE时生效。 | BaseMaterial | ||
| dstBlendRGB : int RGB目标混合参数,在blend为BLEND_ENABLE_SEPERATE时生效。 | BaseMaterial | ||
| renderQueue : int 所属渲染队列. | BaseMaterial | ||
| srcBlend : int 源混合参数,在blend为BLEND_ENABLE_ALL时生效。 | BaseMaterial | ||
| srcBlendAlpha : int Alpha源混合参数,在blend为BLEND_ENABLE_SEPERATE时生效。 | BaseMaterial | ||
| srcBlendRGB : int RGB源混合参数,在blend为BLEND_ENABLE_SEPERATE时生效。 | BaseMaterial | ||
| Method | Defined By | ||
|---|---|---|---|
创建一个 BaseMaterial 实例。
| BaseMaterial | ||
_setRenderStateBlendDepth():void
设置渲染相关状态。
| BaseMaterial | ||
_setRenderStateFrontFace(isTarget:Boolean, transform:Transform3D):void
设置渲染相关状态。
| BaseMaterial | ||
_upload():void
上传材质。
| BaseMaterial | ||
clone():*
克隆。
| BaseMaterial | ||
cloneTo(destObject:*):void
克隆。
| BaseMaterial | ||
onAsynLoaded(url:String, data:*, params:Array):void [override]
private
| BaseMaterial | ||
setShaderName(name:String):void
设置使用Shader名字。
| BaseMaterial | ||
| Method | Defined By | ||
|---|---|---|---|
_addDisablePublicShaderDefine(value:int):void
增加禁用宏定义。
| BaseMaterial | ||
_addShaderDefine(value:int):void
增加Shader宏定义。
| BaseMaterial | ||
_getBool(shaderIndex:int):*
获取布尔。
| BaseMaterial | ||
_getBuffer(shaderIndex:int):*
获取Buffer。
| BaseMaterial | ||
_getColor(shaderIndex:int):*
获取颜色。
| BaseMaterial | ||
_getInt(shaderIndex:int):*
获取整形。
| BaseMaterial | ||
_getMatrix4x4(shaderIndex:int):*
获取矩阵。
| BaseMaterial | ||
_getNumber(shaderIndex:int):*
获取浮点。
| BaseMaterial | ||
_getTexture(shaderIndex:int):BaseTexture
获取纹理。
| BaseMaterial | ||
_getVector2(shaderIndex:int):*
获取二维向量。
| BaseMaterial | ||
_removeDisablePublicShaderDefine(value:int):void
移除禁用宏定义。
| BaseMaterial | ||
_removeShaderDefine(value:int):void
移除Shader宏定义。
| BaseMaterial | ||
_setBool(shaderIndex:int, b:Boolean):void
设置布尔。
| BaseMaterial | ||
_setBuffer(shaderIndex:int, buffer:Float32Array):void
设置Buffer。
| BaseMaterial | ||
_setColor(shaderIndex:int, color:*):void
设置颜色。
| BaseMaterial | ||
_setInt(shaderIndex:int, i:int):void
设置整型。
| BaseMaterial | ||
_setMatrix4x4(shaderIndex:int, matrix4x4:Matrix4x4):void
设置矩阵。
| BaseMaterial | ||
_setNumber(shaderIndex:int, number:Number):void
设置浮点。
| BaseMaterial | ||
_setTexture(shaderIndex:int, texture:BaseTexture):void
设置纹理。
| BaseMaterial | ||
_setVector2(shaderIndex:int, vector2:Vector2):void
设置二维向量。
| BaseMaterial | ||
| Constant | Defined By | ||
|---|---|---|---|
| BLEND_DISABLE : int = 0 [static] 混合枚举_禁用。 | BaseMaterial | ||
| BLEND_ENABLE_ALL : int = 1 [static] 混合枚举_启用_RGB和Alpha统一混合。 | BaseMaterial | ||
| BLEND_ENABLE_SEPERATE : int = 2 [static] 混合枚举_启用_RGB和Alpha单独混合。 | BaseMaterial | ||
| BLENDEQUATION_ADD : int = 0 [static] 混合方程枚举_加法,例:source + destination | BaseMaterial | ||
| BLENDEQUATION_REVERSE_SUBTRACT : int = 2 [static] 混合方程枚举_反序减法,例:destination - source | BaseMaterial | ||
| BLENDEQUATION_SUBTRACT : int = 1 [static] 混合方程枚举_减法,例:source - destination | BaseMaterial | ||
| BLENDPARAM_CONSTANT_ALPHA : int = 0x8003 [static] 混合参数枚举_常量阿尔法,例:RGB(Ac, Ac, Ac),Alpha(Ac)。 | BaseMaterial | ||
| BLENDPARAM_CONSTANT_COLOR : int = 0x8001 [static] 混合参数枚举_常量颜色,例:RGB(Rc, Gc, Bc),Alpha(Ac)。 | BaseMaterial | ||
| BLENDPARAM_DST_ALPHA : int = 0x0304 [static] 混合参数枚举_目标阿尔法,例:RGB(Ad, Ad, Ad),Alpha(Ad)。 | BaseMaterial | ||
| BLENDPARAM_DST_COLOR : int = 0x0306 [static] 混合参数枚举_目标颜色,例:RGB(Rd, Gd, Bd),Alpha(Ad)。 | BaseMaterial | ||
| BLENDPARAM_ONE : int = 1 [static] 混合参数枚举_一,例:RGB(1,1,1),Alpha:(1)。 | BaseMaterial | ||
| BLENDPARAM_ONE_MINUS_CONSTANT_ALPHA : int = 0x8004 [static] 混合参数枚举_一减常量阿尔法,例:RGB(1-Ac, 1-Ac, 1-Ac),Alpha(1-Ac)。 | BaseMaterial | ||
| BLENDPARAM_ONE_MINUS_CONSTANT_COLOR : int = 0x8002 [static] 混合参数枚举_一减常量颜色,例:RGB(1-Rc, 1-Gc, 1-Bc),Alpha(1-Ac)。 | BaseMaterial | ||
| BLENDPARAM_ONE_MINUS_DST_ALPHA : int = 0x0305 [static] 混合参数枚举_一减目标阿尔法,例:RGB(1-Ad, 1-Ad, 1-Ad),Alpha(Ad)。 | BaseMaterial | ||
| BLENDPARAM_ONE_MINUS_DST_COLOR : int = 0x0307 [static] 混合参数枚举_一减目标颜色,例:RGB(1-Rd, 1-Gd, 1-Bd),Alpha(1-Ad)。 | BaseMaterial | ||
| BLENDPARAM_ONE_MINUS_SRC_ALPHA : int = 0x0303 [static] 混合参数枚举_一减源阿尔法,例:RGB(1-As, 1-As, 1-As),Alpha(1-As)。 | BaseMaterial | ||
| BLENDPARAM_ONE_MINUS_SRC_COLOR : int = 0x0301 [static] 混合参数枚举_一减源颜色,例:RGB(1-Rs, 1-Gs, 1-Bs),Alpha(1-As)。 | BaseMaterial | ||
| BLENDPARAM_SRC_ALPHA : int = 0x0302 [static] 混合参数枚举_源透明,例:RGB(As, As, As),Alpha(1-As)。 | BaseMaterial | ||
| BLENDPARAM_SRC_ALPHA_SATURATE : int = 0x0308 [static] 混合参数枚举_阿尔法饱和,例:RGB(min(As, 1 - Ad), min(As, 1 - Ad), min(As, 1 - Ad)),Alpha(1)。 | BaseMaterial | ||
| BLENDPARAM_SRC_COLOR : int = 0x0300 [static] 混合参数枚举_源颜色,例:RGB(Rs, Gs, Bs),Alpha(As)。 | BaseMaterial | ||
| BLENDPARAM_ZERO : int = 0 [static] 混合参数枚举_零,例:RGB(0,0,0),Alpha:(1)。 | BaseMaterial | ||
| CULL_BACK : int = 2 [static] 剔除枚举_剔除背面。 | BaseMaterial | ||
| CULL_FRONT : int = 1 [static] 剔除枚举_剔除正面。 | BaseMaterial | ||
| CULL_NONE : int = 0 [static] 剔除枚举_不剔除。 | BaseMaterial | ||
| DEPTHFUNC_ALWAYS : int = 0x0207 [static] 深度测试函数枚举_总是通过。 | BaseMaterial | ||
| DEPTHFUNC_EQUAL : int = 0x0202 [static] 深度测试函数枚举_等于时通过。 | BaseMaterial | ||
| DEPTHFUNC_GEQUAL : int = 0x0206 [static] 深度测试函数枚举_大于等于时通过。 | BaseMaterial | ||
| DEPTHFUNC_GREATER : int = 0x0204 [static] 深度测试函数枚举_大于时通过。 | BaseMaterial | ||
| DEPTHFUNC_LEQUAL : int = 0x0203 [static] 深度测试函数枚举_小于等于时通过。 | BaseMaterial | ||
| DEPTHFUNC_LESS : int = 0x0201 [static] 深度测试函数枚举_小于时通过。 | BaseMaterial | ||
| DEPTHFUNC_NEVER : int = 0x0200 [static] 深度测试函数枚举_从不通过。 | BaseMaterial | ||
| DEPTHFUNC_NOTEQUAL : int = 0x0205 [static] 深度测试函数枚举_不等于时通过。 | BaseMaterial | ||
| alphaTest | property |
alphaTest:Boolean获取是否透明裁剪。
public function get alphaTest():Boolean public function set alphaTest(value:Boolean):void| alphaTestValue | property |
alphaTestValue:Number获取透明测试模式裁剪值。
public function get alphaTestValue():Number public function set alphaTestValue(value:Number):void| blend | property |
public var blend:int透明混合。
| blendConstColor | property |
public var blendConstColor:Vector4混合常量颜色。
| blendEquation | property |
public var blendEquation:int混合方程。
| blendEquationAlpha | property |
public var blendEquationAlpha:intAlpha混合方程。
| blendEquationRGB | property |
public var blendEquationRGB:intRGB混合方程。
| cull | property |
public var cull:int渲染剔除。
| depthFunc | property |
public var depthFunc:int深度测试函数。
| depthTest | property |
public var depthTest:Boolean是否深度测试。
| depthWrite | property |
public var depthWrite:Boolean是否深度写入。
| dstBlend | property |
public var dstBlend:int目标混合参数,在blend为BLEND_ENABLE_ALL时生效。
| dstBlendAlpha | property |
public var dstBlendAlpha:intAlpha目标混合参数,在blend为BLEND_ENABLE_SEPERATE时生效。
| dstBlendRGB | property |
public var dstBlendRGB:intRGB目标混合参数,在blend为BLEND_ENABLE_SEPERATE时生效。
| renderQueue | property |
public var renderQueue:int所属渲染队列.
| srcBlend | property |
public var srcBlend:int源混合参数,在blend为BLEND_ENABLE_ALL时生效。
| srcBlendAlpha | property |
public var srcBlendAlpha:intAlpha源混合参数,在blend为BLEND_ENABLE_SEPERATE时生效。
| srcBlendRGB | property |
public var srcBlendRGB:intRGB源混合参数,在blend为BLEND_ENABLE_SEPERATE时生效。
| BaseMaterial | () | Constructor |
public function BaseMaterial()
创建一个 BaseMaterial 实例。
| _addDisablePublicShaderDefine | () | method |
protected function _addDisablePublicShaderDefine(value:int):void增加禁用宏定义。
Parameters
value:int — 宏定义。
|
| _addShaderDefine | () | method |
protected function _addShaderDefine(value:int):void增加Shader宏定义。
Parameters
value:int — 宏定义。
|
| _getBool | () | method |
protected function _getBool(shaderIndex:int):*获取布尔。
Parameters
shaderIndex:int — shader索引。
|
* — 布尔。
|
| _getBuffer | () | method |
protected function _getBuffer(shaderIndex:int):*获取Buffer。
Parameters
shaderIndex:int — shader索引。
|
* —
|
| _getColor | () | method |
protected function _getColor(shaderIndex:int):*获取颜色。
Parameters
shaderIndex:int — shader索引。
|
* — 颜色向量。
|
| _getInt | () | method |
protected function _getInt(shaderIndex:int):*获取整形。
Parameters
shaderIndex:int — shader索引。
|
* — 整形。
|
| _getMatrix4x4 | () | method |
protected function _getMatrix4x4(shaderIndex:int):*获取矩阵。
Parameters
shaderIndex:int — shader索引。
|
* — 矩阵。
|
| _getNumber | () | method |
protected function _getNumber(shaderIndex:int):*获取浮点。
Parameters
shaderIndex:int — shader索引。
|
* — 浮点。
|
| _getTexture | () | method |
protected function _getTexture(shaderIndex:int):BaseTexture获取纹理。
Parameters
shaderIndex:int — shader索引。
|
BaseTexture — 纹理。
|
| _getVector2 | () | method |
protected function _getVector2(shaderIndex:int):*获取二维向量。
Parameters
shaderIndex:int — shader索引。
|
* — 二维向量。
|
| _removeDisablePublicShaderDefine | () | method |
protected function _removeDisablePublicShaderDefine(value:int):void移除禁用宏定义。
Parameters
value:int — 宏定义。
|
| _removeShaderDefine | () | method |
protected function _removeShaderDefine(value:int):void移除Shader宏定义。
Parameters
value:int — 宏定义。
|
| _setBool | () | method |
protected function _setBool(shaderIndex:int, b:Boolean):void设置布尔。
Parameters
shaderIndex:int — shader索引。
| |
b:Boolean — 布尔。
|
| _setBuffer | () | method |
protected function _setBuffer(shaderIndex:int, buffer:Float32Array):void设置Buffer。
Parameters
shaderIndex:int — shader索引。
| |
buffer:Float32Array — buffer数据。
|
| _setColor | () | method |
protected function _setColor(shaderIndex:int, color:*):void设置颜色。
Parameters
shaderIndex:int — shader索引。
| |
color:* — 颜色向量。
|
| _setInt | () | method |
protected function _setInt(shaderIndex:int, i:int):void设置整型。
Parameters
shaderIndex:int — shader索引。
| |
i:int — 整形。
|
| _setMatrix4x4 | () | method |
protected function _setMatrix4x4(shaderIndex:int, matrix4x4:Matrix4x4):void设置矩阵。
Parameters
shaderIndex:int — shader索引。
| |
matrix4x4:Matrix4x4 — 矩阵。
|
| _setNumber | () | method |
protected function _setNumber(shaderIndex:int, number:Number):void设置浮点。
Parameters
shaderIndex:int — shader索引。
| |
number:Number — 浮点。
|
| _setRenderStateBlendDepth | () | method |
public function _setRenderStateBlendDepth():void设置渲染相关状态。
| _setRenderStateFrontFace | () | method |
public function _setRenderStateFrontFace(isTarget:Boolean, transform:Transform3D):void设置渲染相关状态。
Parameters
isTarget:Boolean | |
transform:Transform3D |
| _setTexture | () | method |
protected function _setTexture(shaderIndex:int, texture:BaseTexture):void设置纹理。
Parameters
shaderIndex:int — shader索引。
| |
texture:BaseTexture — 纹理。
|
| _setVector2 | () | method |
protected function _setVector2(shaderIndex:int, vector2:Vector2):void设置二维向量。
Parameters
shaderIndex:int — shader索引。
| |
vector2:Vector2 — 二维向量。
|
| _upload | () | method |
public function _upload():void上传材质。
| clone | () | method |
public function clone():*克隆。
Returns* — 克隆副本。
|
| cloneTo | () | method |
public function cloneTo(destObject:*):void克隆。
Parameters
destObject:* — 克隆源。
|
| onAsynLoaded | () | method |
override public function onAsynLoaded(url:String, data:*, params:Array):voidprivate
Parameters
url:String | |
data:* | |
params:Array |
| setShaderName | () | method |
public function setShaderName(name:String):void设置使用Shader名字。
Parameters
name:String — 名称。
|
| BLEND_DISABLE | Constant |
public static const BLEND_DISABLE:int = 0混合枚举_禁用。
| BLEND_ENABLE_ALL | Constant |
public static const BLEND_ENABLE_ALL:int = 1混合枚举_启用_RGB和Alpha统一混合。
| BLEND_ENABLE_SEPERATE | Constant |
public static const BLEND_ENABLE_SEPERATE:int = 2混合枚举_启用_RGB和Alpha单独混合。
| BLENDEQUATION_ADD | Constant |
public static const BLENDEQUATION_ADD:int = 0混合方程枚举_加法,例:source + destination
| BLENDEQUATION_REVERSE_SUBTRACT | Constant |
public static const BLENDEQUATION_REVERSE_SUBTRACT:int = 2混合方程枚举_反序减法,例:destination - source
| BLENDEQUATION_SUBTRACT | Constant |
public static const BLENDEQUATION_SUBTRACT:int = 1混合方程枚举_减法,例:source - destination
| BLENDPARAM_CONSTANT_ALPHA | Constant |
public static const BLENDPARAM_CONSTANT_ALPHA:int = 0x8003混合参数枚举_常量阿尔法,例:RGB(Ac, Ac, Ac),Alpha(Ac)。
| BLENDPARAM_CONSTANT_COLOR | Constant |
public static const BLENDPARAM_CONSTANT_COLOR:int = 0x8001混合参数枚举_常量颜色,例:RGB(Rc, Gc, Bc),Alpha(Ac)。
| BLENDPARAM_DST_ALPHA | Constant |
public static const BLENDPARAM_DST_ALPHA:int = 0x0304混合参数枚举_目标阿尔法,例:RGB(Ad, Ad, Ad),Alpha(Ad)。
| BLENDPARAM_DST_COLOR | Constant |
public static const BLENDPARAM_DST_COLOR:int = 0x0306混合参数枚举_目标颜色,例:RGB(Rd, Gd, Bd),Alpha(Ad)。
| BLENDPARAM_ONE | Constant |
public static const BLENDPARAM_ONE:int = 1混合参数枚举_一,例:RGB(1,1,1),Alpha:(1)。
| BLENDPARAM_ONE_MINUS_CONSTANT_ALPHA | Constant |
public static const BLENDPARAM_ONE_MINUS_CONSTANT_ALPHA:int = 0x8004混合参数枚举_一减常量阿尔法,例:RGB(1-Ac, 1-Ac, 1-Ac),Alpha(1-Ac)。
| BLENDPARAM_ONE_MINUS_CONSTANT_COLOR | Constant |
public static const BLENDPARAM_ONE_MINUS_CONSTANT_COLOR:int = 0x8002混合参数枚举_一减常量颜色,例:RGB(1-Rc, 1-Gc, 1-Bc),Alpha(1-Ac)。
| BLENDPARAM_ONE_MINUS_DST_ALPHA | Constant |
public static const BLENDPARAM_ONE_MINUS_DST_ALPHA:int = 0x0305混合参数枚举_一减目标阿尔法,例:RGB(1-Ad, 1-Ad, 1-Ad),Alpha(Ad)。
| BLENDPARAM_ONE_MINUS_DST_COLOR | Constant |
public static const BLENDPARAM_ONE_MINUS_DST_COLOR:int = 0x0307混合参数枚举_一减目标颜色,例:RGB(1-Rd, 1-Gd, 1-Bd),Alpha(1-Ad)。
| BLENDPARAM_ONE_MINUS_SRC_ALPHA | Constant |
public static const BLENDPARAM_ONE_MINUS_SRC_ALPHA:int = 0x0303混合参数枚举_一减源阿尔法,例:RGB(1-As, 1-As, 1-As),Alpha(1-As)。
| BLENDPARAM_ONE_MINUS_SRC_COLOR | Constant |
public static const BLENDPARAM_ONE_MINUS_SRC_COLOR:int = 0x0301混合参数枚举_一减源颜色,例:RGB(1-Rs, 1-Gs, 1-Bs),Alpha(1-As)。
| BLENDPARAM_SRC_ALPHA | Constant |
public static const BLENDPARAM_SRC_ALPHA:int = 0x0302混合参数枚举_源透明,例:RGB(As, As, As),Alpha(1-As)。
| BLENDPARAM_SRC_ALPHA_SATURATE | Constant |
public static const BLENDPARAM_SRC_ALPHA_SATURATE:int = 0x0308混合参数枚举_阿尔法饱和,例:RGB(min(As, 1 - Ad), min(As, 1 - Ad), min(As, 1 - Ad)),Alpha(1)。
| BLENDPARAM_SRC_COLOR | Constant |
public static const BLENDPARAM_SRC_COLOR:int = 0x0300混合参数枚举_源颜色,例:RGB(Rs, Gs, Bs),Alpha(As)。
| BLENDPARAM_ZERO | Constant |
public static const BLENDPARAM_ZERO:int = 0混合参数枚举_零,例:RGB(0,0,0),Alpha:(1)。
| CULL_BACK | Constant |
public static const CULL_BACK:int = 2剔除枚举_剔除背面。
| CULL_FRONT | Constant |
public static const CULL_FRONT:int = 1剔除枚举_剔除正面。
| CULL_NONE | Constant |
public static const CULL_NONE:int = 0剔除枚举_不剔除。
| DEPTHFUNC_ALWAYS | Constant |
public static const DEPTHFUNC_ALWAYS:int = 0x0207深度测试函数枚举_总是通过。
| DEPTHFUNC_EQUAL | Constant |
public static const DEPTHFUNC_EQUAL:int = 0x0202深度测试函数枚举_等于时通过。
| DEPTHFUNC_GEQUAL | Constant |
public static const DEPTHFUNC_GEQUAL:int = 0x0206深度测试函数枚举_大于等于时通过。
| DEPTHFUNC_GREATER | Constant |
public static const DEPTHFUNC_GREATER:int = 0x0204深度测试函数枚举_大于时通过。
| DEPTHFUNC_LEQUAL | Constant |
public static const DEPTHFUNC_LEQUAL:int = 0x0203深度测试函数枚举_小于等于时通过。
| DEPTHFUNC_LESS | Constant |
public static const DEPTHFUNC_LESS:int = 0x0201深度测试函数枚举_小于时通过。
| DEPTHFUNC_NEVER | Constant |
public static const DEPTHFUNC_NEVER:int = 0x0200深度测试函数枚举_从不通过。
| DEPTHFUNC_NOTEQUAL | Constant |
public static const DEPTHFUNC_NOTEQUAL:int = 0x0205深度测试函数枚举_不等于时通过。