Package | laya.d3.shader |
Class | public class Shader3D |
Inheritance | Shader3D BaseShader laya.resource.Resource |
Property | Defined By | ||
---|---|---|---|
activeShader : BaseShader [static] | BaseShader | ||
_attributeParams : Array = null | Shader3D | ||
_attributeParamsMap : Array | Shader3D | ||
bindShader : BaseShader [static] | BaseShader | ||
_cameraUniformParamsMap : Array | Shader3D | ||
_id : int | Shader3D | ||
_includeFiles : * [static] | Shader3D | ||
_materialUniformParamsMap : Array | Shader3D | ||
nameKey : StringKey [static] | Shader3D | ||
_program : * = null | Shader3D | ||
_pshader : * | Shader3D | ||
_renderElementUniformParamsMap : Array | Shader3D | ||
_sceneUniformParamsMap : Array | Shader3D | ||
_spriteUniformParamsMap : Array | Shader3D | ||
_uniformParams : Array = null | Shader3D | ||
_vshader : * | Shader3D |
Property | Defined By | ||
---|---|---|---|
shaderParamsMap : Object [static] | Shader3D |
Method | Defined By | ||
---|---|---|---|
Shader3D(vs:String, ps:String, attributeMap:Object, sceneUniformMap:Object, cameraUniformMap:Object, spriteUniformMap:Object, materialUniformMap:Object, renderElementUniformMap:Object)
根据vs和ps信息生成shader对象
| Shader3D | ||
addInclude(fileName:String, txt:String):void [static] | Shader3D | ||
bind():Boolean | Shader3D | ||
create(vs:String, ps:String, attributeMap:Object, sceneUniformMap:Object, cameraUniformMap:Object, spriteUniformMap:Object, materialUniformMap:Object, renderElementUniformMap:Object):Shader3D [static] | Shader3D | ||
uploadAttributes(attributeShaderValue:Array, _bufferUsage:*):void
按数组的定义提交
| Shader3D | ||
uploadCameraUniforms(shaderValue:Array):void
按数组的定义提交
| Shader3D | ||
uploadMaterialUniforms(shaderValue:Array):void
按数组的定义提交
| Shader3D | ||
uploadRenderElementUniforms(shaderValue:Array):void
按数组的定义提交
| Shader3D | ||
uploadSceneUniforms(shaderValue:Array):void
按数组的定义提交
| Shader3D | ||
uploadSpriteUniforms(shaderValue:Array):void
按数组的定义提交
| Shader3D | ||
uploadTexture2D(value:*):void | Shader3D |
Method | Defined By | ||
---|---|---|---|
_preGetParams(vs:String, ps:String):Object | Shader3D | ||
detoryResource():void [override] | Shader3D | ||
recreateResource():void [override] | Shader3D |
Constant | Defined By | ||
---|---|---|---|
PERIOD_CAMERA : int = 3 [static] shader变量提交周期,逐相机。 | Shader3D | ||
PERIOD_MATERIAL : int = 1 [static] shader变量提交周期,逐材质。 | Shader3D | ||
PERIOD_RENDERELEMENT : int = 0 [static] shader变量提交周期,逐渲染单元。 | Shader3D | ||
PERIOD_SCENE : int = 4 [static] shader变量提交周期,逐场景。 | Shader3D | ||
PERIOD_SPRITE : int = 2 [static] shader变量提交周期,逐精灵和相机,注:因为精灵包含MVP矩阵,为复合属性,所以摄像机发生变化时也应提交。 | Shader3D |
_attributeParams | property |
public var _attributeParams:Array = null
_attributeParamsMap | property |
public var _attributeParamsMap:Array
_cameraUniformParamsMap | property |
public var _cameraUniformParamsMap:Array
_id | property |
public var _id:int
_includeFiles | property |
public static var _includeFiles:*
_materialUniformParamsMap | property |
public var _materialUniformParamsMap:Array
_program | property |
public var _program:* = null
_pshader | property |
public var _pshader:*
_renderElementUniformParamsMap | property |
public var _renderElementUniformParamsMap:Array
_sceneUniformParamsMap | property |
public var _sceneUniformParamsMap:Array
_spriteUniformParamsMap | property |
public var _spriteUniformParamsMap:Array
_uniformParams | property |
public var _uniformParams:Array = null
_vshader | property |
public var _vshader:*
nameKey | property |
public static var nameKey:StringKey
shaderParamsMap | property |
protected static var shaderParamsMap:Object
Shader3D | () | Constructor |
public function Shader3D(vs:String, ps:String, attributeMap:Object, sceneUniformMap:Object, cameraUniformMap:Object, spriteUniformMap:Object, materialUniformMap:Object, renderElementUniformMap:Object)
根据vs和ps信息生成shader对象
Parametersvs:String | |
ps:String | |
attributeMap:Object | |
sceneUniformMap:Object — 帮助里要详细解释为什么需要nameMap
| |
cameraUniformMap:Object | |
spriteUniformMap:Object | |
materialUniformMap:Object | |
renderElementUniformMap:Object |
_preGetParams | () | method |
protected function _preGetParams(vs:String, ps:String):Object
Parameters
vs:String | |
ps:String |
Object |
addInclude | () | method |
public static function addInclude(fileName:String, txt:String):void
Parameters
fileName:String | |
txt:String |
bind | () | method |
public function bind():Boolean
ReturnsBoolean |
create | () | method |
public static function create(vs:String, ps:String, attributeMap:Object, sceneUniformMap:Object, cameraUniformMap:Object, spriteUniformMap:Object, materialUniformMap:Object, renderElementUniformMap:Object):Shader3D
Parameters
vs:String | |
ps:String | |
attributeMap:Object | |
sceneUniformMap:Object | |
cameraUniformMap:Object | |
spriteUniformMap:Object | |
materialUniformMap:Object | |
renderElementUniformMap:Object |
Shader3D |
detoryResource | () | method |
override protected function detoryResource():void
recreateResource | () | method |
override protected function recreateResource():void
uploadAttributes | () | method |
public function uploadAttributes(attributeShaderValue:Array, _bufferUsage:*):void
按数组的定义提交
Parameters
attributeShaderValue:Array — 数组格式[name,value,...]
| |
_bufferUsage:* |
uploadCameraUniforms | () | method |
public function uploadCameraUniforms(shaderValue:Array):void
按数组的定义提交
Parameters
shaderValue:Array — 数组格式[name,value,...]
|
uploadMaterialUniforms | () | method |
public function uploadMaterialUniforms(shaderValue:Array):void
按数组的定义提交
Parameters
shaderValue:Array — 数组格式[name,value,...]
|
uploadRenderElementUniforms | () | method |
public function uploadRenderElementUniforms(shaderValue:Array):void
按数组的定义提交
Parameters
shaderValue:Array — 数组格式[name,value,...]
|
uploadSceneUniforms | () | method |
public function uploadSceneUniforms(shaderValue:Array):void
按数组的定义提交
Parameters
shaderValue:Array — 数组格式[name,value,...]
|
uploadSpriteUniforms | () | method |
public function uploadSpriteUniforms(shaderValue:Array):void
按数组的定义提交
Parameters
shaderValue:Array — 数组格式[name,value,...]
|
uploadTexture2D | () | method |
public function uploadTexture2D(value:*):void
Parameters
value:* |
PERIOD_CAMERA | Constant |
public static const PERIOD_CAMERA:int = 3
shader变量提交周期,逐相机。
PERIOD_MATERIAL | Constant |
public static const PERIOD_MATERIAL:int = 1
shader变量提交周期,逐材质。
PERIOD_RENDERELEMENT | Constant |
public static const PERIOD_RENDERELEMENT:int = 0
shader变量提交周期,逐渲染单元。
PERIOD_SCENE | Constant |
public static const PERIOD_SCENE:int = 4
shader变量提交周期,逐场景。
PERIOD_SPRITE | Constant |
public static const PERIOD_SPRITE:int = 2
shader变量提交周期,逐精灵和相机,注:因为精灵包含MVP矩阵,为复合属性,所以摄像机发生变化时也应提交。