Skip to content

Class: RenderShader

Hierarchy

Constructors

Properties

Accessors

Methods

Constructors

constructor

new RenderShader(vs, fs)

Parameters

NameType
vsstring
fsstring

Overrides

ShaderBase.constructor

Defined in

src/gfx/graphics/webGpu/shader/RenderShader.ts:83

Properties

useRz

useRz: boolean = false

Defined in

src/gfx/graphics/webGpu/shader/RenderShader.ts:32


vsName

vsName: string

Vertex shader name

Defined in

src/gfx/graphics/webGpu/shader/RenderShader.ts:37


fsName

fsName: string

Fragment shader name

Defined in

src/gfx/graphics/webGpu/shader/RenderShader.ts:42


shaderState

shaderState: ShaderState

State of the shader

Defined in

src/gfx/graphics/webGpu/shader/RenderShader.ts:47


textures

textures: Object

The collection of textures used in shading

Index signature

▪ [name: string]: Texture

Defined in

src/gfx/graphics/webGpu/shader/RenderShader.ts:52


pipeline

pipeline: GPURenderPipeline

Render pipeline

Defined in

src/gfx/graphics/webGpu/shader/RenderShader.ts:57


bindGroupLayouts

bindGroupLayouts: GPUBindGroupLayout[]

BindGroup layout

Defined in

src/gfx/graphics/webGpu/shader/RenderShader.ts:62


materialDataUniformBuffer

materialDataUniformBuffer: MaterialDataUniformGPUBuffer

Uniform data for materials

Defined in

src/gfx/graphics/webGpu/shader/RenderShader.ts:67


envMap

envMap: Texture

Defined in

src/gfx/graphics/webGpu/shader/RenderShader.ts:69


prefilterMap

prefilterMap: Texture

Defined in

src/gfx/graphics/webGpu/shader/RenderShader.ts:71


instanceID

Readonly instanceID: string

Shader Unique instance id

Inherited from

ShaderBase.instanceID

Defined in

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


shaderVariant

shaderVariant: string

Shader variant value

Inherited from

ShaderBase.shaderVariant

Defined in

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


vsEntryPoint

vsEntryPoint: string

Vertex stage entry point name

Inherited from

ShaderBase.vsEntryPoint

Defined in

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


fsEntryPoint

fsEntryPoint: string

Fragment stage entry point name

Inherited from

ShaderBase.fsEntryPoint

Defined in

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


bindGroups

bindGroups: GPUBindGroup[]

BindGroup collection

Inherited from

ShaderBase.bindGroups

Defined in

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


shaderReflection

shaderReflection: ShaderReflection

Shader reflection info

Inherited from

ShaderBase.shaderReflection

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

Inherited from

ShaderBase.defineValue

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

Inherited from

ShaderBase.constValues

Defined in

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


uniforms

uniforms: Object

Uniforms data collection

Index signature

▪ [name: string]: UniformNode

Inherited from

ShaderBase.uniforms

Defined in

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

Accessors

renderOrder

get renderOrder(): number

Blend mode

Returns

number

Defined in

src/gfx/graphics/webGpu/shader/RenderShader.ts:119

set renderOrder(value): void

Parameters

NameType
valuenumber

Returns

void

Defined in

src/gfx/graphics/webGpu/shader/RenderShader.ts:123


doubleSide

get doubleSide(): boolean

Cull mode

Returns

boolean

Defined in

src/gfx/graphics/webGpu/shader/RenderShader.ts:133

set doubleSide(value): void

Parameters

NameType
valueboolean

Returns

void

Defined in

src/gfx/graphics/webGpu/shader/RenderShader.ts:137


cullMode

get cullMode(): GPUCullMode

get render face cull mode

Returns

GPUCullMode

Defined in

src/gfx/graphics/webGpu/shader/RenderShader.ts:148

set cullMode(value): void

set render face cull mode

Parameters

NameType
valueGPUCullMode

Returns

void

Defined in

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


frontFace

get frontFace(): GPUFrontFace

get front face mode

GPUFront Face

Returns

GPUFrontFace

Defined in

src/gfx/graphics/webGpu/shader/RenderShader.ts:166

set frontFace(value): void

set front face mode

GPUFront Face

value

Parameters

NameType
valueGPUFrontFace

Returns

void

Defined in

src/gfx/graphics/webGpu/shader/RenderShader.ts:174


depthBias

get depthBias(): number

Depth bias

Returns

number

Defined in

src/gfx/graphics/webGpu/shader/RenderShader.ts:184

set depthBias(value): void

Parameters

NameType
valuenumber

Returns

void

Defined in

src/gfx/graphics/webGpu/shader/RenderShader.ts:188


topology

get topology(): GPUPrimitiveTopology

Primitive topology

Returns

GPUPrimitiveTopology

Defined in

src/gfx/graphics/webGpu/shader/RenderShader.ts:198

set topology(value): void

Parameters

NameType
valueGPUPrimitiveTopology

Returns

void

Defined in

src/gfx/graphics/webGpu/shader/RenderShader.ts:202


blendMode

get blendMode(): BlendMode

Blend mode

Returns

BlendMode

Defined in

src/gfx/graphics/webGpu/shader/RenderShader.ts:212

set blendMode(value): void

Parameters

NameType
valueBlendMode

Returns

void

Defined in

src/gfx/graphics/webGpu/shader/RenderShader.ts:216


depthCompare

get depthCompare(): GPUCompareFunction

Depth compare function

Returns

GPUCompareFunction

Defined in

src/gfx/graphics/webGpu/shader/RenderShader.ts:229

set depthCompare(value): void

Parameters

NameType
valueGPUCompareFunction

Returns

void

Defined in

src/gfx/graphics/webGpu/shader/RenderShader.ts:233


baseColor

get baseColor(): Color

Returns

Color

Defined in

src/gfx/graphics/webGpu/shader/RenderShader.ts:283

set baseColor(value): void

Parameters

NameType
valueColor

Returns

void

Defined in

src/gfx/graphics/webGpu/shader/RenderShader.ts:287

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/RenderShader.ts:245


setUniform

setUniform(name, value): void

Parameters

NameType
namestring
valueany

Returns

void

Overrides

ShaderBase.setUniform

Defined in

src/gfx/graphics/webGpu/shader/RenderShader.ts:255


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/RenderShader.ts:265


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/RenderShader.ts:296


genRenderPipeline

genRenderPipeline(geometry, renderPassState): void

Create a rendering pipeline

Parameters

NameType
geometryGeometryBase
renderPassStateRendererPassState

Returns

void

Defined in

src/gfx/graphics/webGpu/shader/RenderShader.ts:305


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/RenderShader.ts:315


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/RenderShader.ts:329


preCompile

preCompile(geometry): void

Precompile the shader code

Parameters

NameType
geometryGeometryBase

Returns

void

Defined in

src/gfx/graphics/webGpu/shader/RenderShader.ts:356


applyPostDefine

applyPostDefine(shader, renderPassState): string

Apply defines syntax values

Parameters

NameType
shaderstring
renderPassStateRendererPassState

Returns

string

Defined in

src/gfx/graphics/webGpu/shader/RenderShader.ts:369


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/RenderShader.ts:392


destroy

destroy(force?): void

Destroy and release render shader related resources

Parameters

NameType
force?boolean

Returns

void

Overrides

ShaderBase.destroy

Defined in

src/gfx/graphics/webGpu/shader/RenderShader.ts:901


destroyShader

Static destroyShader(instanceID): void

Destroy a RenderShader object

Parameters

NameTypeDescription
instanceIDstringinstance ID of the RenderShader

Returns

void

Defined in

src/gfx/graphics/webGpu/shader/RenderShader.ts:942


getShader

Static getShader(instanceID): RenderShader

Get the RenderShader object by specifying the RenderShader instance ID

Parameters

NameTypeDescription
instanceIDstringinstance ID of the RenderShader

Returns

RenderShader

RenderShader object

Defined in

src/gfx/graphics/webGpu/shader/RenderShader.ts:955


createShader

Static 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/RenderShader.ts:965


noticeShaderChange

noticeShaderChange(): void

notice shader change

Returns

void

Inherited from

ShaderBase.noticeShaderChange

Defined in

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


noticeValueChange

noticeValueChange(): void

notice shader state change

Returns

void

Inherited from

ShaderBase.noticeValueChange

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

Inherited from

ShaderBase.setStorageBuffer

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

Inherited from

ShaderBase.setStructStorageBuffer

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

Inherited from

ShaderBase.setUniformBuffer

Defined in

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


setDefine

setDefine(defineName, value): void

set define value

Parameters

NameType
defineNamestring
valueany

Returns

void

Inherited from

ShaderBase.setDefine

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

Inherited from

ShaderBase.hasDefine

Defined in

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


deleteDefine

deleteDefine(defineName): void

delete define value

Parameters

NameType
defineNamestring

Returns

void

Inherited from

ShaderBase.deleteDefine

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

Inherited from

ShaderBase.setUniformFloat

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

Inherited from

ShaderBase.setUniformVector2

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

Inherited from

ShaderBase.setUniformVector3

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

Inherited from

ShaderBase.setUniformVector4

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

Inherited from

ShaderBase.setUniformColor

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

Inherited from

ShaderBase.setUniformArray

Defined in

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


getUniform

getUniform(name): any

Parameters

NameType
namestring

Returns

any

Inherited from

ShaderBase.getUniform

Defined in

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