Skip to content

Class: RenderShaderPass

Hierarchy

Constructors

Properties

Accessors

Methods

Constructors

constructor

new RenderShaderPass(vs, fs): RenderShaderPass

Parameters

NameType
vsstring
fsstring

Returns

RenderShaderPass

Overrides

ShaderPassBase.constructor

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

ShaderPassBase.instanceID

Defined in

src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:21


shaderVariant

shaderVariant: string

Shader variant value

Inherited from

ShaderPassBase.shaderVariant

Defined in

src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:26


vsEntryPoint

vsEntryPoint: string

Vertex stage entry point name

Inherited from

ShaderPassBase.vsEntryPoint

Defined in

src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:31


fsEntryPoint

fsEntryPoint: string

Fragment stage entry point name

Inherited from

ShaderPassBase.fsEntryPoint

Defined in

src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:36


bindGroups

bindGroups: GPUBindGroup[]

BindGroup collection

Inherited from

ShaderPassBase.bindGroups

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

ShaderPassBase.defineValue

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

ShaderPassBase.constValues

Defined in

src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:56


uniforms

uniforms: Object

Uniforms data collection

Index signature

▪ [name: string]: UniformNode

Inherited from

ShaderPassBase.uniforms

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

NameType
valuenumber

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

NameType
valueboolean

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

NameType
valueboolean

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

NameType
valueGPUCullMode

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

NameType
valueGPUFrontFace

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

NameType
valuenumber

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

NameType
valueGPUPrimitiveTopology

Returns

void

Defined in

src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:218


blendMode

get blendMode(): BlendMode

Blend mode

Returns

BlendMode

Defined in

src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:228

set blendMode(value): void

Parameters

NameType
valueBlendMode

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

NameType
valueGPUCompareFunction

Returns

void

Defined in

src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:249


baseColor

get baseColor(): Color

Returns

Color

Defined in

src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:301

set baseColor(value): void

Parameters

NameType
valueColor

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

NameTypeDefault value
vsEntryPointstring''
fsEntryPointstring''

Returns

void

Defined in

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


setUniform

setUniform(name, value): void

Parameters

NameType
namestring
valueany

Returns

void

Overrides

ShaderPassBase.setUniform

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

NameTypeDescription
namestringName in the shader code
textureTextureTexture 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

NameTypeDescription
namestringName in the shader code

Returns

Texture

Texture object

Defined in

src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:314


genRenderPipeline

genRenderPipeline(geometry, renderPassState): void

Create a rendering pipeline

Parameters

NameType
geometryGeometryBase
renderPassStateRendererPassState

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

NameType
geometryGeometryBase
rendererPassStateRendererPassState

Returns

void

Defined in

src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:333


apply

apply(geometry, rendererPassState, noticeFun?): void

Apply render shader state value

Parameters

NameType
geometryGeometryBase
rendererPassStateRendererPassState
noticeFun?Function

Returns

void

Defined in

src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:347


preCompile

preCompile(geometry): void

Precompile the shader code

Parameters

NameType
geometryGeometryBase

Returns

void

Defined in

src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:374


applyPostDefine

applyPostDefine(shader, renderPassState): string

Apply defines syntax values

Parameters

NameType
shaderstring
renderPassStateRendererPassState

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

NameType
groupIndexnumber
groupGPUBindGroup

Returns

void

Defined in

src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:415


destroy

destroy(force?): void

Destroy and release render shader related resources

Parameters

NameType
force?boolean

Returns

void

Overrides

ShaderPassBase.destroy

Defined in

src/gfx/graphics/webGpu/shader/RenderShaderPass.ts:949


destroyShader

destroyShader(instanceID): void

Destroy a RenderShader object

Parameters

NameTypeDescription
instanceIDstringinstance 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

NameTypeDescription
instanceIDstringinstance ID of the RenderShader

Returns

RenderShaderPass

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

NameTypeDescription
vsstringVertex shader name
fsstringFragment 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

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

NameType
Textends Struct

Parameters

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

NameType
namestring
bufferUniformGPUBuffer

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

NameType
defineNamestring
valueany

Returns

void

Inherited from

ShaderPassBase.setDefine

Defined in

src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:141


hasDefine

hasDefine(defineName): boolean

Whether there is a define key

Parameters

NameType
defineNamestring

Returns

boolean

Inherited from

ShaderPassBase.hasDefine

Defined in

src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:155


deleteDefine

deleteDefine(defineName): void

delete define value

Parameters

NameType
defineNamestring

Returns

void

Inherited from

ShaderPassBase.deleteDefine

Defined in

src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:163


setUniformFloat

setUniformFloat(name, value): void

set uniform float value

Parameters

NameType
namestring
valuenumber

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

NameType
namestring
valueVector2

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

NameType
namestring
valueVector3

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

NameType
namestring
valueVector4

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

NameType
namestring
valueColor

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

NameType
namestring
valueFloat32Array

Returns

void

Inherited from

ShaderPassBase.setUniformArray

Defined in

src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:240


getUniform

getUniform(name): any

Parameters

NameType
namestring

Returns

any

Inherited from

ShaderPassBase.getUniform

Defined in

src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:256


getUniformFloat

getUniformFloat(name): number

Parameters

NameType
namestring

Returns

number

Inherited from

ShaderPassBase.getUniformFloat

Defined in

src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:260


getUniformVector2

getUniformVector2(name): Vector2

Parameters

NameType
namestring

Returns

Vector2

Inherited from

ShaderPassBase.getUniformVector2

Defined in

src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:264


getUniformVector3

getUniformVector3(name): Vector3

Parameters

NameType
namestring

Returns

Vector3

Inherited from

ShaderPassBase.getUniformVector3

Defined in

src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:268


getUniformVector4

getUniformVector4(name): Vector4

Parameters

NameType
namestring

Returns

Vector4

Inherited from

ShaderPassBase.getUniformVector4

Defined in

src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:272


getUniformColor

getUniformColor(name): Color

Parameters

NameType
namestring

Returns

Color

Inherited from

ShaderPassBase.getUniformColor

Defined in

src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:276


getBuffer

getBuffer(name): GPUBufferBase

Parameters

NameType
namestring

Returns

GPUBufferBase

Inherited from

ShaderPassBase.getBuffer

Defined in

src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:280


applyUniform

applyUniform(): void

Returns

void

Inherited from

ShaderPassBase.applyUniform

Defined in

src/gfx/graphics/webGpu/shader/ShaderPassBase.ts:288

Released under the MIT License