Skip to content

Class: ShaderBase

Hierarchy

Constructors

Properties

Methods

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

NameTypeDescription
namestringbuffer name
bufferStorageGPUBufferstorage 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

NameType
Textends Struct<T>

Parameters

NameTypeDescription
namestringbuffer name
bufferStructStorageGPUBuffer<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

NameType
namestring
bufferUniformGPUBuffer

Returns

void

Defined in

src/gfx/graphics/webGpu/shader/ShaderBase.ts:121


setDefine

setDefine(defineName, value): void

set define value

Parameters

NameType
defineNamestring
valueany

Returns

void

Defined in

src/gfx/graphics/webGpu/shader/ShaderBase.ts:135


hasDefine

hasDefine(defineName): boolean

Whether there is a define key

Parameters

NameType
defineNamestring

Returns

boolean

Defined in

src/gfx/graphics/webGpu/shader/ShaderBase.ts:149


deleteDefine

deleteDefine(defineName): void

delete define value

Parameters

NameType
defineNamestring

Returns

void

Defined in

src/gfx/graphics/webGpu/shader/ShaderBase.ts:157


setUniformFloat

setUniformFloat(name, value): void

set uniform float value

Parameters

NameType
namestring
valuenumber

Returns

void

Defined in

src/gfx/graphics/webGpu/shader/ShaderBase.ts:167


setUniformVector2

setUniformVector2(name, value): void

set uniform vector2 value

Parameters

NameType
namestring
valueVector2

Returns

void

Defined in

src/gfx/graphics/webGpu/shader/ShaderBase.ts:181


setUniformVector3

setUniformVector3(name, value): void

set uniform vector3 value

Parameters

NameType
namestring
valueVector3

Returns

void

Defined in

src/gfx/graphics/webGpu/shader/ShaderBase.ts:195


setUniformVector4

setUniformVector4(name, value): void

set uniform vector4 value

Parameters

NameType
namestring
valueVector4

Returns

void

Defined in

src/gfx/graphics/webGpu/shader/ShaderBase.ts:208


setUniformColor

setUniformColor(name, value): void

set uniform color value

Parameters

NameType
namestring
valueColor

Returns

void

Defined in

src/gfx/graphics/webGpu/shader/ShaderBase.ts:221


setUniformArray

setUniformArray(name, value): void

set uniform array value

Parameters

NameType
namestring
valueFloat32Array

Returns

void

Defined in

src/gfx/graphics/webGpu/shader/ShaderBase.ts:234


setUniform

setUniform(name, value): void

Parameters

NameType
namestring
valueany

Returns

void

Defined in

src/gfx/graphics/webGpu/shader/ShaderBase.ts:242


getUniform

getUniform(name): any

Parameters

NameType
namestring

Returns

any

Defined in

src/gfx/graphics/webGpu/shader/ShaderBase.ts:250


destroy

destroy(force?): void

destroy

Parameters

NameType
force?boolean

Returns

void

Defined in

src/gfx/graphics/webGpu/shader/ShaderBase.ts:261