Cocos Creator
Manual
API Ref
Cocos2d-x
Manual
API Ref
Version: 3.1
Version: 3.5
Version: 3.4
Version: 3.3
Version: 3.2
Version: 3.0
Version: 2.4
Version: 2.3
Version: 2.2
Version: 2.1
Version: 2.0
Version: 1.10
Version: 1.9
Search
Preparing search index...
The search index is not available
CocosCreatorAPI
Options
All
Public
Public/Protected
All
Inherited
Externals
Only exported
Menu
Globals
gfx
Shader
Class Shader
GFX shader.
Hierarchy
Obj
Shader
Index
Constructors
constructor
Properties
_attributes
_blocks
_device
_gfx
Type
_id
_name
_samplers
_stages
_shader
IdGen
Accessors
attributes
blocks
gfx
Type
id
name
samplers
Methods
destroy
initialize
Constructors
constructor
new
Shader
(
device
:
Device
)
:
Shader
Parameters
device:
Device
Returns
Shader
Properties
Protected
_attributes
_attributes
:
Attribute
[]
= []
Protected
_blocks
_blocks
:
UniformBlock
[]
= []
Protected
_device
_device
:
Device
Protected
_gfx
Type
_gfx
Type
:
ObjectType
= ObjectType.UNKNOWN
Protected
_id
_id
:
number
Protected
_name
_name
:
string
= ""
Protected
_samplers
_samplers
:
UniformSampler
[]
= []
Protected
_stages
_stages
:
ShaderStage
[]
= []
Static
Private
_shader
IdGen
_shader
IdGen
:
number
= 0
Accessors
attributes
get
attributes
(
)
:
Attribute
[]
Returns
Attribute
[]
blocks
get
blocks
(
)
:
UniformBlock
[]
Returns
UniformBlock
[]
gfx
Type
get
gfxType
(
)
:
ObjectType
Returns
ObjectType
id
get
id
(
)
:
number
Get current shader id.
Returns
number
name
get
name
(
)
:
string
Get current shader name.
Returns
string
samplers
get
samplers
(
)
:
UniformSampler
[]
Returns
UniformSampler
[]
Methods
Abstract
destroy
destroy
(
)
:
void
Returns
void
Abstract
initialize
initialize
(
info
:
ShaderInfo
)
:
boolean
Parameters
info:
ShaderInfo
Returns
boolean
Globals
gfx
Shader
constructor
_attributes
_blocks
_device
_gfx
Type
_id
_name
_samplers
_stages
_shader
IdGen
attributes
blocks
gfx
Type
id
name
samplers
destroy
initialize
Generated using
TypeDoc
GFX shader.