Class: RenderShaderPass
Hierarchy
↳
RenderShaderPass
Constructors
Properties
- passType
- useRz
- vsName
- fsName
- shaderState
- textures
- pipeline
- bindGroupLayouts
- envMap
- prefilterMap
- reflectionMap
- outBufferMask
- instanceID
- shaderVariant
- vsEntryPoint
- fsEntryPoint
- bindGroups
- shaderReflection
- defineValue
- constValues
- uniforms
- materialDataUniformBuffer
Accessors
- renderOrder
- doubleSide
- depthWriteEnabled
- cullMode
- frontFace
- depthBias
- topology
- blendMode
- depthCompare
- baseColor
Methods
- setShaderEntry
- setUniform
- setTexture
- getTexture
- genRenderPipeline
- reBuild
- apply
- preCompile
- applyPostDefine
- setBindGroup
- destroy
- destroyShader
- getShader
- createShader
- noticeShaderChange
- noticeValueChange
- setStorageBuffer
- setStructStorageBuffer
- setUniformBuffer
- setDefine
- hasDefine
- deleteDefine
- setUniformFloat
- setUniformVector2
- setUniformVector3
- setUniformVector4
- setUniformColor
- setUniformArray
- getUniform
- getUniformFloat
- getUniformVector2
- getUniformVector3
- getUniformVector4
- getUniformColor
- getBuffer
- applyUniform
Constructors
constructor
• new RenderShaderPass(vs
, fs
): RenderShaderPass
Parameters
Name | Type |
---|---|
vs | string |
fs | string |
Returns
Overrides
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:86
Properties
passType
• passType: PassType
= PassType.COLOR
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:34
useRz
• useRz: boolean
= false
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:36
vsName
• vsName: string
Vertex shader name
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:41
fsName
• fsName: string
Fragment shader name
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:46
shaderState
• shaderState: ShaderState
State of the shader
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:51
textures
• textures: Object
The collection of textures used in shading
Index signature
▪ [name: string
]: Texture
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:56
pipeline
• pipeline: GPURenderPipeline
Render pipeline
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:61
bindGroupLayouts
• bindGroupLayouts: GPUBindGroupLayout
[]
BindGroup layout
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:66
envMap
• envMap: Texture
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:70
prefilterMap
• prefilterMap: Texture
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:72
reflectionMap
• reflectionMap: Texture
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:73
outBufferMask
• outBufferMask: Vector4
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:84
instanceID
• Readonly
instanceID: string
Shader Unique instance id
Inherited from
Defined in
src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:21
shaderVariant
• shaderVariant: string
Shader variant value
Inherited from
Defined in
src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:26
vsEntryPoint
• vsEntryPoint: string
Vertex stage entry point name
Inherited from
Defined in
src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:31
fsEntryPoint
• fsEntryPoint: string
Fragment stage entry point name
Inherited from
Defined in
src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:36
bindGroups
• bindGroups: GPUBindGroup
[]
BindGroup collection
Inherited from
Defined in
src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:41
shaderReflection
• shaderReflection: ShaderReflection
Shader reflection info
Inherited from
ShaderPassBase.shaderReflection
Defined in
src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:46
defineValue
• defineValue: Object
The defined syntax value of the Shader when it is precompiled
Index signature
▪ [name: string
]: any
Inherited from
Defined in
src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:51
constValues
• constValues: Object
The constant value of the Shader when it is precompiled
Index signature
▪ [name: string
]: any
Inherited from
Defined in
src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:56
uniforms
• uniforms: Object
Uniforms data collection
Index signature
▪ [name: string
]: UniformNode
Inherited from
Defined in
src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:61
materialDataUniformBuffer
• materialDataUniformBuffer: MaterialDataUniformGPUBuffer
Uniform data for materials
Inherited from
ShaderPassBase.materialDataUniformBuffer
Defined in
src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:66
Accessors
renderOrder
• get
renderOrder(): number
Blend mode
Returns
number
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:121
• set
renderOrder(value
): void
Parameters
Name | Type |
---|---|
value | number |
Returns
void
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:125
doubleSide
• get
doubleSide(): boolean
Cull mode
Returns
boolean
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:135
• set
doubleSide(value
): void
Parameters
Name | Type |
---|---|
value | boolean |
Returns
void
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:139
depthWriteEnabled
• get
depthWriteEnabled(): boolean
depthWriteEnabled mode
Returns
boolean
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:150
• set
depthWriteEnabled(value
): void
Parameters
Name | Type |
---|---|
value | boolean |
Returns
void
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:154
cullMode
• get
cullMode(): GPUCullMode
get render face cull mode
Returns
GPUCullMode
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:164
• set
cullMode(value
): void
set render face cull mode
Parameters
Name | Type |
---|---|
value | GPUCullMode |
Returns
void
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:171
frontFace
• get
frontFace(): GPUFrontFace
get front face mode
Returns
GPUFrontFace
GPUFront Face
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:182
• set
frontFace(value
): void
set front face mode
Parameters
Name | Type |
---|---|
value | GPUFrontFace |
Returns
void
GPUFront Face
value
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:190
depthBias
• get
depthBias(): number
Depth bias
Returns
number
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:200
• set
depthBias(value
): void
Parameters
Name | Type |
---|---|
value | number |
Returns
void
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:204
topology
• get
topology(): GPUPrimitiveTopology
Primitive topology
Returns
GPUPrimitiveTopology
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:214
• set
topology(value
): void
Parameters
Name | Type |
---|---|
value | GPUPrimitiveTopology |
Returns
void
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:218
blendMode
• get
blendMode(): BlendMode
Blend mode
Returns
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:228
• set
blendMode(value
): void
Parameters
Name | Type |
---|---|
value | BlendMode |
Returns
void
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:232
depthCompare
• get
depthCompare(): GPUCompareFunction
Depth compare function
Returns
GPUCompareFunction
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:245
• set
depthCompare(value
): void
Parameters
Name | Type |
---|---|
value | GPUCompareFunction |
Returns
void
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:249
baseColor
• get
baseColor(): Color
Returns
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:301
• set
baseColor(value
): void
Parameters
Name | Type |
---|---|
value | Color |
Returns
void
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:305
Methods
setShaderEntry
▸ setShaderEntry(vsEntryPoint?
, fsEntryPoint?
): void
Sets the entry point names for the RenderShader vertex phase and fragment phase
Parameters
Name | Type | Default value |
---|---|---|
vsEntryPoint | string | '' |
fsEntryPoint | string | '' |
Returns
void
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:261
setUniform
▸ setUniform(name
, value
): void
Parameters
Name | Type |
---|---|
name | string |
value | any |
Returns
void
Overrides
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:271
setTexture
▸ setTexture(name
, texture
): void
Set the texture used in the Render Shader code
Parameters
Name | Type | Description |
---|---|---|
name | string | Name in the shader code |
texture | Texture | Texture object |
Returns
void
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:281
getTexture
▸ getTexture(name
): Texture
Get the texture used in the Render Shader code
Parameters
Name | Type | Description |
---|---|---|
name | string | Name in the shader code |
Returns
Texture object
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:314
genRenderPipeline
▸ genRenderPipeline(geometry
, renderPassState
): void
Create a rendering pipeline
Parameters
Name | Type |
---|---|
geometry | GeometryBase |
renderPassState | RendererPassState |
Returns
void
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:323
reBuild
▸ reBuild(geometry
, rendererPassState
): void
Recompile the shader and create the rendering pipeline
Parameters
Name | Type |
---|---|
geometry | GeometryBase |
rendererPassState | RendererPassState |
Returns
void
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:333
apply
▸ apply(geometry
, rendererPassState
, noticeFun?
): void
Apply render shader state value
Parameters
Name | Type |
---|---|
geometry | GeometryBase |
rendererPassState | RendererPassState |
noticeFun? | Function |
Returns
void
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:347
preCompile
▸ preCompile(geometry
): void
Precompile the shader code
Parameters
Name | Type |
---|---|
geometry | GeometryBase |
Returns
void
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:374
applyPostDefine
▸ applyPostDefine(shader
, renderPassState
): string
Apply defines syntax values
Parameters
Name | Type |
---|---|
shader | string |
renderPassState | RendererPassState |
Returns
string
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:387
setBindGroup
▸ setBindGroup(groupIndex
, group
): void
Set GPUBindGroup to the specified index slot
Parameters
Name | Type |
---|---|
groupIndex | number |
group | GPUBindGroup |
Returns
void
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:415
destroy
▸ destroy(force?
): void
Destroy and release render shader related resources
Parameters
Name | Type |
---|---|
force? | boolean |
Returns
void
Overrides
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:949
destroyShader
▸ destroyShader(instanceID
): void
Destroy a RenderShader object
Parameters
Name | Type | Description |
---|---|---|
instanceID | string | instance ID of the RenderShader |
Returns
void
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:992
getShader
▸ getShader(instanceID
): RenderShaderPass
Get the RenderShader object by specifying the RenderShader instance ID
Parameters
Name | Type | Description |
---|---|---|
instanceID | string | instance ID of the RenderShader |
Returns
RenderShader object
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:1005
createShader
▸ createShader(vs
, fs
): string
Create a RenderShader with vertex shaders and fragment shaders
Parameters
Name | Type | Description |
---|---|---|
vs | string | Vertex shader name |
fs | string | Fragment shader name |
Returns
string
Returns the instance ID of the RenderShader
Defined in
src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:1015
noticeShaderChange
▸ noticeShaderChange(): void
notice shader change
Returns
void
Inherited from
ShaderPassBase.noticeShaderChange
Defined in
src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:83
noticeValueChange
▸ noticeValueChange(): void
notice shader state change
Returns
void
Inherited from
ShaderPassBase.noticeValueChange
Defined in
src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:90
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
Inherited from
ShaderPassBase.setStorageBuffer
Defined in
src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:99
setStructStorageBuffer
▸ setStructStorageBuffer<T
>(name
, buffer
): void
set struct storage gpu buffer
Type parameters
Name | Type |
---|---|
T | extends Struct |
Parameters
Name | Type | Description |
---|---|---|
name | string | buffer name |
buffer | StructStorageGPUBuffer <T > | struct storage useAge gpu buffer |
Returns
void
Inherited from
ShaderPassBase.setStructStorageBuffer
Defined in
src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:113
setUniformBuffer
▸ setUniformBuffer(name
, buffer
): void
set uniform gpu buffer min size 256
Parameters
Name | Type |
---|---|
name | string |
buffer | UniformGPUBuffer |
Returns
void
Inherited from
ShaderPassBase.setUniformBuffer
Defined in
src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:127
setDefine
▸ setDefine(defineName
, value
): void
set define value
Parameters
Name | Type |
---|---|
defineName | string |
value | any |
Returns
void
Inherited from
Defined in
src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:141
hasDefine
▸ hasDefine(defineName
): boolean
Whether there is a define key
Parameters
Name | Type |
---|---|
defineName | string |
Returns
boolean
Inherited from
Defined in
src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:155
deleteDefine
▸ deleteDefine(defineName
): void
delete define value
Parameters
Name | Type |
---|---|
defineName | string |
Returns
void
Inherited from
Defined in
src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:163
setUniformFloat
▸ setUniformFloat(name
, value
): void
set uniform float value
Parameters
Name | Type |
---|---|
name | string |
value | number |
Returns
void
Inherited from
ShaderPassBase.setUniformFloat
Defined in
src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:173
setUniformVector2
▸ setUniformVector2(name
, value
): void
set uniform vector2 value
Parameters
Name | Type |
---|---|
name | string |
value | Vector2 |
Returns
void
Inherited from
ShaderPassBase.setUniformVector2
Defined in
src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:187
setUniformVector3
▸ setUniformVector3(name
, value
): void
set uniform vector3 value
Parameters
Name | Type |
---|---|
name | string |
value | Vector3 |
Returns
void
Inherited from
ShaderPassBase.setUniformVector3
Defined in
src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:201
setUniformVector4
▸ setUniformVector4(name
, value
): void
set uniform vector4 value
Parameters
Name | Type |
---|---|
name | string |
value | Vector4 |
Returns
void
Inherited from
ShaderPassBase.setUniformVector4
Defined in
src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:214
setUniformColor
▸ setUniformColor(name
, value
): void
set uniform color value
Parameters
Name | Type |
---|---|
name | string |
value | Color |
Returns
void
Inherited from
ShaderPassBase.setUniformColor
Defined in
src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:227
setUniformArray
▸ setUniformArray(name
, value
): void
set uniform array value
Parameters
Name | Type |
---|---|
name | string |
value | Float32Array |
Returns
void
Inherited from
ShaderPassBase.setUniformArray
Defined in
src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:240
getUniform
▸ getUniform(name
): any
Parameters
Name | Type |
---|---|
name | string |
Returns
any
Inherited from
Defined in
src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:256
getUniformFloat
▸ getUniformFloat(name
): number
Parameters
Name | Type |
---|---|
name | string |
Returns
number
Inherited from
ShaderPassBase.getUniformFloat
Defined in
src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:260
getUniformVector2
▸ getUniformVector2(name
): Vector2
Parameters
Name | Type |
---|---|
name | string |
Returns
Inherited from
ShaderPassBase.getUniformVector2
Defined in
src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:264
getUniformVector3
▸ getUniformVector3(name
): Vector3
Parameters
Name | Type |
---|---|
name | string |
Returns
Inherited from
ShaderPassBase.getUniformVector3
Defined in
src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:268
getUniformVector4
▸ getUniformVector4(name
): Vector4
Parameters
Name | Type |
---|---|
name | string |
Returns
Vector4
Inherited from
ShaderPassBase.getUniformVector4
Defined in
src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:272
getUniformColor
▸ getUniformColor(name
): Color
Parameters
Name | Type |
---|---|
name | string |
Returns
Inherited from
ShaderPassBase.getUniformColor
Defined in
src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:276
getBuffer
▸ getBuffer(name
): GPUBufferBase
Parameters
Name | Type |
---|---|
name | string |
Returns
GPUBufferBase
Inherited from
Defined in
src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:280
applyUniform
▸ applyUniform(): void
Returns
void