Class: ShaderBase
Hierarchy
ShaderBase
Constructors
Properties
- instanceID
- shaderVariant
- vsEntryPoint
- fsEntryPoint
- bindGroups
- shaderReflection
- defineValue
- constValues
- uniforms
Methods
- noticeShaderChange
- noticeValueChange
- setStorageBuffer
- setStructStorageBuffer
- setUniformBuffer
- setDefine
- hasDefine
- deleteDefine
- setUniformFloat
- setUniformVector2
- setUniformVector3
- setUniformVector4
- setUniformColor
- setUniformArray
- setUniform
- getUniform
- destroy
Constructors
constructor
• new ShaderBase()
Defined in
src/gfx/graphics/webGpu/shader/ShaderBase.ts:66
Properties
instanceID
• Readonly
instanceID: string
Shader Unique instance id
Defined in
src/gfx/graphics/webGpu/shader/ShaderBase.ts:20
shaderVariant
• shaderVariant: string
Shader variant value
Defined in
src/gfx/graphics/webGpu/shader/ShaderBase.ts:25
vsEntryPoint
• vsEntryPoint: string
Vertex stage entry point name
Defined in
src/gfx/graphics/webGpu/shader/ShaderBase.ts:30
fsEntryPoint
• fsEntryPoint: string
Fragment stage entry point name
Defined in
src/gfx/graphics/webGpu/shader/ShaderBase.ts:35
bindGroups
• bindGroups: GPUBindGroup
[]
BindGroup collection
Defined in
src/gfx/graphics/webGpu/shader/ShaderBase.ts:40
shaderReflection
• shaderReflection: ShaderReflection
Shader reflection info
Defined in
src/gfx/graphics/webGpu/shader/ShaderBase.ts:45
defineValue
• defineValue: Object
The defined syntax value of the Shader when it is precompiled
Index signature
▪ [name: string
]: any
Defined in
src/gfx/graphics/webGpu/shader/ShaderBase.ts:50
constValues
• constValues: Object
The constant value of the Shader when it is precompiled
Index signature
▪ [name: string
]: any
Defined in
src/gfx/graphics/webGpu/shader/ShaderBase.ts:55
uniforms
• uniforms: Object
Uniforms data collection
Index signature
▪ [name: string
]: UniformNode
Defined in
src/gfx/graphics/webGpu/shader/ShaderBase.ts:60
Methods
noticeShaderChange
▸ noticeShaderChange(): void
notice shader change
Returns
void
Defined in
src/gfx/graphics/webGpu/shader/ShaderBase.ts:77
noticeValueChange
▸ noticeValueChange(): void
notice shader state change
Returns
void
Defined in
src/gfx/graphics/webGpu/shader/ShaderBase.ts:84
setStorageBuffer
▸ setStorageBuffer(name
, buffer
): void
set storage gpu buffer
Parameters
Name | Type | Description |
---|---|---|
name | string | buffer name |
buffer | StorageGPUBuffer | storage useAge gpu buffer |
Returns
void
Defined in
src/gfx/graphics/webGpu/shader/ShaderBase.ts:93
setStructStorageBuffer
▸ setStructStorageBuffer<T
>(name
, buffer
): void
set struct storage gpu buffer
Type parameters
Name | Type |
---|---|
T | extends Struct <T > |
Parameters
Name | Type | Description |
---|---|---|
name | string | buffer name |
buffer | StructStorageGPUBuffer <T > | struct storage useAge gpu buffer |
Returns
void
Defined in
src/gfx/graphics/webGpu/shader/ShaderBase.ts:107
setUniformBuffer
▸ setUniformBuffer(name
, buffer
): void
set uniform gpu buffer min size 256
Parameters
Name | Type |
---|---|
name | string |
buffer | UniformGPUBuffer |
Returns
void
Defined in
src/gfx/graphics/webGpu/shader/ShaderBase.ts:121
setDefine
▸ setDefine(defineName
, value
): void
set define value
Parameters
Name | Type |
---|---|
defineName | string |
value | any |
Returns
void
Defined in
src/gfx/graphics/webGpu/shader/ShaderBase.ts:135
hasDefine
▸ hasDefine(defineName
): boolean
Whether there is a define key
Parameters
Name | Type |
---|---|
defineName | string |
Returns
boolean
Defined in
src/gfx/graphics/webGpu/shader/ShaderBase.ts:149
deleteDefine
▸ deleteDefine(defineName
): void
delete define value
Parameters
Name | Type |
---|---|
defineName | string |
Returns
void
Defined in
src/gfx/graphics/webGpu/shader/ShaderBase.ts:157
setUniformFloat
▸ setUniformFloat(name
, value
): void
set uniform float value
Parameters
Name | Type |
---|---|
name | string |
value | number |
Returns
void
Defined in
src/gfx/graphics/webGpu/shader/ShaderBase.ts:167
setUniformVector2
▸ setUniformVector2(name
, value
): void
set uniform vector2 value
Parameters
Name | Type |
---|---|
name | string |
value | Vector2 |
Returns
void
Defined in
src/gfx/graphics/webGpu/shader/ShaderBase.ts:181
setUniformVector3
▸ setUniformVector3(name
, value
): void
set uniform vector3 value
Parameters
Name | Type |
---|---|
name | string |
value | Vector3 |
Returns
void
Defined in
src/gfx/graphics/webGpu/shader/ShaderBase.ts:195
setUniformVector4
▸ setUniformVector4(name
, value
): void
set uniform vector4 value
Parameters
Name | Type |
---|---|
name | string |
value | Vector4 |
Returns
void
Defined in
src/gfx/graphics/webGpu/shader/ShaderBase.ts:208
setUniformColor
▸ setUniformColor(name
, value
): void
set uniform color value
Parameters
Name | Type |
---|---|
name | string |
value | Color |
Returns
void
Defined in
src/gfx/graphics/webGpu/shader/ShaderBase.ts:221
setUniformArray
▸ setUniformArray(name
, value
): void
set uniform array value
Parameters
Name | Type |
---|---|
name | string |
value | Float32Array |
Returns
void
Defined in
src/gfx/graphics/webGpu/shader/ShaderBase.ts:234
setUniform
▸ setUniform(name
, value
): void
Parameters
Name | Type |
---|---|
name | string |
value | any |
Returns
void
Defined in
src/gfx/graphics/webGpu/shader/ShaderBase.ts:242
getUniform
▸ getUniform(name
): any
Parameters
Name | Type |
---|---|
name | string |
Returns
any
Defined in
src/gfx/graphics/webGpu/shader/ShaderBase.ts:250
destroy
▸ destroy(force?
): void
destroy
Parameters
Name | Type |
---|---|
force? | boolean |
Returns
void