Documentation / scene / ParticleMaterial
Class: ParticleMaterial
Defined in: libs/scene/src/material/particle.ts:27
Particle material.
- Specializes
MeshMaterialfor billboard/sprite-style particles. - Provides optional alpha map (coverage/shape) and ramp map (color/alpha over lifetime or scalar).
- Uses blended transparency by default and disables face culling.
- Supports per-particle attributes via vertex inputs (position, params, velocity).
Features:
FEATURE_ALPHA_MAP: enables sampling an alpha coverage texture.FEATURE_RAMP_MAP: enables sampling a ramp/gradient texture.
Default states:
cullMode = 'none'blendMode = 'blend'
Extends
Implements
Clonable<ParticleMaterial>
Constructors
Constructor
new ParticleMaterial():
ParticleMaterial
Defined in: libs/scene/src/material/particle.ts:33
Returns
ParticleMaterial
Overrides
Accessors
disposed
Get Signature
get disposed():
boolean
Defined in: libs/base/dist/index.d.ts:6065
Returns
boolean
Inherited from
changeTag
Get Signature
get changeTag():
number
Defined in: libs/scene/src/material/material.ts:164
Incremented when the material’s GPU-relevant state changes and render bundles may need to be rebuilt.
Returns
number
Inherited from
instanceId
Get Signature
get instanceId():
number
Defined in: libs/scene/src/material/material.ts:170
Runtime-unique numeric identifier for the material instance.
Returns
number
Inherited from
numPasses
Get Signature
get numPasses():
number
Defined in: libs/scene/src/material/material.ts:180
Number of rendering passes this material uses.
Increasing this will expand the per-pass hash cache; make sure to implement createHash(pass), _createProgram(pb, ctx, pass), and updateRenderStates(pass, ...) accordingly for each pass.
Returns
number
Set Signature
set numPasses(
val):void
Defined in: libs/scene/src/material/material.ts:183
Parameters
val
number
Returns
void
Inherited from
coreMaterial
Get Signature
get coreMaterial():
this
Defined in: libs/scene/src/material/material.ts:264
Returns the core material that owns GPU state.
Instances may delegate to a shared core to reuse compiled programs and caches.
Returns
this
Inherited from
drawContext
Get Signature
get drawContext():
DrawContext
Defined in: libs/scene/src/material/meshmaterial.ts:508
Draw context captured during program creation, available inside shader hooks.
Returns
The last DrawContext used to build or apply this material.
Inherited from
pass
Get Signature
get pass():
number
Defined in: libs/scene/src/material/meshmaterial.ts:517
Current material pass index during program building. Typically used inside shader hooks to select per-pass logic.
Returns
number
The active pass index while building the program, or -1 when idle.
Inherited from
alphaCutoff
Get Signature
get alphaCutoff():
number
Defined in: libs/scene/src/material/meshmaterial.ts:526
Alpha test cutoff in [0, 1].
- 0 disables alpha testing.
- > 0 discards fragments with alpha < cutoff. Changing this marks uniforms dirty (no shader rebuild).
Returns
number
Set Signature
set alphaCutoff(
val):void
Defined in: libs/scene/src/material/meshmaterial.ts:529
Parameters
val
number
Returns
void
Inherited from
alphaDither
Get Signature
get alphaDither():
boolean
Defined in: libs/scene/src/material/meshmaterial.ts:541
Whether alpha clipping uses frame-varying dither coverage.
- Effective only when alpha cutoff is enabled.
- Intended for masked materials (blendMode='none') to emulate soft transparency with TAA.
Returns
boolean
Set Signature
set alphaDither(
val):void
Defined in: libs/scene/src/material/meshmaterial.ts:544
Parameters
val
boolean
Returns
void
Inherited from
TAADisabled
Get Signature
get TAADisabled():
boolean
Defined in: libs/scene/src/material/meshmaterial.ts:555
Whether TAA is disabled for this material.
- When true, motion vectors encode a large sentinel to skip TAA accumulation.
- Managed via an internal feature toggle.
Returns
boolean
Set Signature
set TAADisabled(
val):void
Defined in: libs/scene/src/material/meshmaterial.ts:558
Parameters
val
boolean
Returns
void
Inherited from
TAAStrength
Get Signature
get TAAStrength():
number
Defined in: libs/scene/src/material/meshmaterial.ts:566
TAA strength in [0, 1].
- Higher values generally imply stronger accumulation.
- The value is mapped when writing motion-vector outputs during depth pass.
Returns
number
Set Signature
set TAAStrength(
val):void
Defined in: libs/scene/src/material/meshmaterial.ts:569
Parameters
val
number
Returns
void
Inherited from
alphaToCoverage
Get Signature
get alphaToCoverage():
boolean
Defined in: libs/scene/src/material/meshmaterial.ts:581
Alpha-to-coverage toggle.
- Useful to approximate transparency for MSAA targets.
- Managed as a shader feature; toggling rebuilds variants.
Returns
boolean
Set Signature
set alphaToCoverage(
val):void
Defined in: libs/scene/src/material/meshmaterial.ts:584
Parameters
val
boolean
Returns
void
Inherited from
blendMode
Get Signature
get blendMode():
BlendMode
Defined in: libs/scene/src/material/meshmaterial.ts:592
Blending mode of this material.
- 'none' for opaque, 'blend' for standard alpha, 'additive' for emissive FX.
- Changing the mode toggles an internal feature and rebuilds variants.
Returns
Set Signature
set blendMode(
val):void
Defined in: libs/scene/src/material/meshmaterial.ts:595
Parameters
val
Returns
void
Inherited from
transparentShadowCaster
Get Signature
get transparentShadowCaster():
boolean
Defined in: libs/scene/src/material/meshmaterial.ts:606
Whether transparent visible materials cast shadow through a masked shadow-only path.
- Visible rendering stays blended.
- Shadow-map rendering is treated like a cutout material using
shadowAlphaCutoff.
Returns
boolean
Set Signature
set transparentShadowCaster(
val):void
Defined in: libs/scene/src/material/meshmaterial.ts:609
Parameters
val
boolean
Returns
void
Inherited from
MeshMaterial.transparentShadowCaster
shadowAlphaCutoff
Get Signature
get shadowAlphaCutoff():
number
Defined in: libs/scene/src/material/meshmaterial.ts:618
Alpha cutoff used by the shadow-only masked caster path.
Returns
number
Set Signature
set shadowAlphaCutoff(
val):void
Defined in: libs/scene/src/material/meshmaterial.ts:621
Parameters
val
number
Returns
void
Inherited from
MeshMaterial.shadowAlphaCutoff
cullMode
Get Signature
get cullMode():
FaceMode
Defined in: libs/scene/src/material/meshmaterial.ts:632
Face culling mode: 'none' | 'front' | 'back'.
- Does not force shader rebuild; affects rasterizer state.
Returns
FaceMode
Set Signature
set cullMode(
val):void
Defined in: libs/scene/src/material/meshmaterial.ts:635
Parameters
val
FaceMode
Returns
void
Inherited from
opacity
Get Signature
get opacity():
number
Defined in: libs/scene/src/material/meshmaterial.ts:645
Material opacity in [0, 1].
- Used in transparent passes. Changing marks uniforms dirty only.
Returns
number
Set Signature
set opacity(
val):void
Defined in: libs/scene/src/material/meshmaterial.ts:648
Parameters
val
number
Returns
void
Inherited from
objectColor
Get Signature
get objectColor():
Immutable<Vector4>
Defined in: libs/scene/src/material/meshmaterial.ts:659
Per-object color used for GPU picking/object-ID pass.
- Changing marks uniforms dirty only.
Returns
Immutable<Vector4>
Set Signature
set objectColor(
val):void
Defined in: libs/scene/src/material/meshmaterial.ts:662
Parameters
val
Immutable<Vector4>
Returns
void
Inherited from
alphaMap
Get Signature
get alphaMap():
Texture2D<unknown>
Defined in: libs/scene/src/material/particle.ts:78
Texture used to modulate particle alpha coverage (shape/softness). When set, enables the alpha map feature and marks uniforms dirty.
Returns
Texture2D<unknown>
The current alpha map texture or undefined if not set.
Set Signature
set alphaMap(
tex):void
Defined in: libs/scene/src/material/particle.ts:81
Parameters
tex
Texture2D<unknown>
Returns
void
rampMap
Get Signature
get rampMap():
Texture2D<unknown>
Defined in: libs/scene/src/material/particle.ts:95
Texture used as a color/alpha ramp (e.g., over particle lifetime). Sampled along U with particleParams.w. When set, enables the ramp map feature and marks uniforms dirty.
Returns
Texture2D<unknown>
The current ramp map texture or undefined if not set.
Set Signature
set rampMap(
tex):void
Defined in: libs/scene/src/material/particle.ts:98
Parameters
tex
Texture2D<unknown>
Returns
void
jitterPower
Get Signature
get jitterPower():
number
Defined in: libs/scene/src/material/particle.ts:111
Random offset strength applied to particle billboards (world-space jitter). Stored in params.x.
Returns
number
The current jitter power.
Set Signature
set jitterPower(
val):void
Defined in: libs/scene/src/material/particle.ts:114
Parameters
val
number
Returns
void
aspect
Get Signature
get aspect():
number
Defined in: libs/scene/src/material/particle.ts:126
Particle aspect scaling factor for the billboard quad. Stored in params.y, applied to the right axis.
Returns
number
The current aspect scaling.
Set Signature
set aspect(
val):void
Defined in: libs/scene/src/material/particle.ts:129
Parameters
val
number
Returns
void
directional
Get Signature
get directional():
boolean
Defined in: libs/scene/src/material/particle.ts:143
Whether the particle is direction-oriented.
- If true, billboard axes are derived from particle velocity.
- If false, a stable axis (based on view up) is used. Stored as
params.z(1 for true, 0 for false).
Returns
boolean
True when direction-oriented; otherwise false.
Set Signature
set directional(
b):void
Defined in: libs/scene/src/material/particle.ts:146
Parameters
b
boolean
Returns
void
Methods
on()
on<
K>(type,listener,context?):void
Defined in: libs/base/dist/index.d.ts:594
IEventTarget.on
Type Parameters
K
K extends "dispose"
Parameters
type
K
listener
EventListener<{ dispose: []; }, K>
context?
unknown
Returns
void
Inherited from
once()
once<
K>(type,listener,context?):void
Defined in: libs/base/dist/index.d.ts:598
IEventTarget.once
Type Parameters
K
K extends "dispose"
Parameters
type
K
listener
EventListener<{ dispose: []; }, K>
context?
unknown
Returns
void
Inherited from
off()
off<
K>(type,listener?,context?):void
Defined in: libs/base/dist/index.d.ts:602
IEventTarget.off
Type Parameters
K
K extends "dispose"
Parameters
type
K
listener?
EventListener<{ dispose: []; }>
context?
unknown
Returns
void
Inherited from
dispatchEvent()
dispatchEvent<
K>(type, ...args):void
Defined in: libs/base/dist/index.d.ts:606
IEventTarget.dispatchEvent
Type Parameters
K
K extends "dispose"
Parameters
type
K
args
...object[K]
Returns
void
Inherited from
dispose()
dispose():
void
Defined in: libs/base/dist/index.d.ts:6066
Returns
void
Inherited from
isBatchable()
isBatchable():
boolean
Defined in: libs/scene/src/material/material.ts:234
Returns true if this is a instance of material
Returns
boolean
Inherited from
needSceneColor()
needSceneColor():
boolean
Defined in: libs/scene/src/material/material.ts:241
Whether this material requires the scene color texture (e.g., for refraction).
Returns
boolean
Inherited from
needSceneDepth()
needSceneDepth():
boolean
Defined in: libs/scene/src/material/material.ts:247
Whether this material requires the linear scene depth texture (e.g., for depth-aware effects).
Returns
boolean
Inherited from
applyUniforms()
applyUniforms(
bindGroup,ctx,needUpdate,pass):void
Defined in: libs/scene/src/material/material.ts:415
Conditionally update uniforms/resources into the material bind group.
Delegates to _applyUniforms() when needUpdate is true (based on _optionTag check).
Parameters
bindGroup
BindGroup
Material bind group at index 2 (may be null if program has no layout).
ctx
Draw context.
needUpdate
boolean
Whether uniforms need to be refreshed.
pass
number
Pass index.
Returns
void
Inherited from
clearCache()
clearCache():
void
Defined in: libs/scene/src/material/material.ts:440
Returns
void
Inherited from
passToHash()
passToHash(
pass):string
Defined in: libs/scene/src/material/material.ts:456
Convert a pass index to a hash seed string.
Subclasses may override to encode per-pass role (e.g., "depth", "forward", "shadow").
Parameters
pass
number
Pass number.
Returns
string
String used when building full hash.
Inherited from
drawPrimitive()
drawPrimitive(
pass,primitive,ctx,numInstances):void
Defined in: libs/scene/src/material/material.ts:484
Issue the actual draw call for a pass.
Override for custom per-pass draw behavior if necessary. The default implementation:
- Draws instanced if
numInstances > 0. - Else uses
ctx.instanceData.numInstancesif available. - Else issues a non-instanced draw.
Parameters
pass
number
Pass number.
primitive
Primitive to draw.
ctx
Draw context.
numInstances
number
Explicit instance count (0 = auto).
Returns
void
Inherited from
onDispose()
protectedonDispose():void
Defined in: libs/scene/src/material/material.ts:499
Dispose the material and release GPU-side resource references.
- Unregisters from the global registry.
- Disposes the per-material bind groups kept in
_states.
Returns
void
Inherited from
apply()
apply(
ctx):boolean
Defined in: libs/scene/src/material/meshmaterial.ts:241
Capture the active draw context for both cached and freshly-built program paths.
The shader-building hooks access this.drawContext, but uniform application may also consult it on subsequent frames when the GPU program is reused from cache. Updating it here keeps material mixins in sync even when createProgram() is skipped.
Parameters
ctx
Current draw context.
Returns
boolean
Whether material preparation succeeded.
Inherited from
uniformChanged()
uniformChanged():
void
Defined in: libs/scene/src/material/meshmaterial.ts:250
Mark uniform-only changes so uniforms are re-uploaded on next apply, without rebuilding shader programs.
Returns
void
Inherited from
defineFeature()
staticdefineFeature():number
Defined in: libs/scene/src/material/meshmaterial.ts:257
Define a new feature bit/index for shader variants. Subclasses may use this to add their own switches.
Returns
number
Inherited from
defineInstanceUniform()
staticdefineInstanceUniform(prop,type,name?):number
Defined in: libs/scene/src/material/meshmaterial.ts:290
Define a per-instance uniform for this class.
Returns a compact index encoding the vector index and component offset, which can be used in shader code via getInstancedUniform(...).
Parameters
prop
string
Property name exposed on instances.
type
Uniform data type.
name?
string = ''
Returns
number
Encoded index for use in getInstancedUniform.
Throws
If the property is already defined or type is invalid.
Inherited from
MeshMaterial.defineInstanceUniform
getInstancedUniform()
getInstancedUniform(
scope,uniformIndex):PBShaderExp
Defined in: libs/scene/src/material/meshmaterial.ts:331
Read an encoded per-instance uniform in shader code.
Encoded index packs: vector index, component offset, and component count.
Parameters
scope
PBInsideFunctionScope
Inside-function shader scope.
uniformIndex
number
Encoded index from defineInstanceUniform.
Returns
PBShaderExp
The shader expression reading the selected components.
Inherited from
MeshMaterial.getInstancedUniform
getInstancedUniforms()
getInstancedUniforms():
object[]
Defined in: libs/scene/src/material/meshmaterial.ts:353
Get the list of per-instance uniforms for this material class.
Returns
object[]
Inherited from
MeshMaterial.getInstancedUniforms
createInstance()
createInstance():
this
Defined in: libs/scene/src/material/meshmaterial.ts:368
Create a material instance (preferred for GPU instancing).
- On WebGL1 (or when instancing unsupported), falls back to cloning.
- Otherwise, returns a proxy instance that shares GPU programs and stores per-instance uniforms in a compact Float32Array.
The returned instance:
- Exposes properties defined by
defineInstanceUniformwith getter/setter that read/write the packed buffer and notifyRenderBundleWrapper. - Delegates methods to the core material via prototype chain.
Returns
this
Inherited from
supportLighting()
supportLighting():
boolean
Defined in: libs/scene/src/material/meshmaterial.ts:674
Whether this material responds to scene lighting. Override to return false for unlit materials.
Returns
boolean
True if lighting affects this material; otherwise false.
Inherited from
getEffectiveBlendMode()
protectedgetEffectiveBlendMode(pass,ctx?):BlendMode
Defined in: libs/scene/src/material/meshmaterial.ts:681
Returns the effective blend mode for the current pass. Transparent-shadow-caster materials stay blended in visible passes, but become masked in shadow passes.
Parameters
pass
number
ctx?
Returns
Inherited from
MeshMaterial.getEffectiveBlendMode
getActiveAlphaCutoff()
protectedgetActiveAlphaCutoff(ctx?,pass?):number
Defined in: libs/scene/src/material/meshmaterial.ts:694
Returns the alpha cutoff that should be used for the current pass.
Parameters
ctx?
pass?
number = ...
Returns
number
Inherited from
MeshMaterial.getActiveAlphaCutoff
useTransparentShadowCaster()
useTransparentShadowCaster(
ctx?,_pass?):boolean
Defined in: libs/scene/src/material/meshmaterial.ts:700
Whether the current pass should use the shadow-only masked caster path.
Parameters
ctx?
_pass?
number = ...
Returns
boolean
Inherited from
MeshMaterial.useTransparentShadowCaster
useTransparentShadowCasterForPass()
useTransparentShadowCasterForPass(
renderPassType?):boolean
Defined in: libs/scene/src/material/meshmaterial.ts:706
Whether the specified render pass type should reinterpret this transparent material as a masked shadow caster.
Parameters
renderPassType?
number
Returns
boolean
Inherited from
MeshMaterial.useTransparentShadowCasterForPass
usesAlphaCutoff()
protectedusesAlphaCutoff(ctx?,pass?):boolean
Defined in: libs/scene/src/material/meshmaterial.ts:716
Whether this pass needs an alpha-cutoff uniform bound.
Parameters
ctx?
pass?
number = ...
Returns
boolean
Inherited from
needFragmentColorInput()
needFragmentColorInput(
ctx?):boolean
Defined in: libs/scene/src/material/meshmaterial.ts:724
Whether this pass needs fragment color inputs. This stays aligned with the historical meaning of needFragmentColor, but also allows shadow-only transparent casters to fetch alpha sources.
Parameters
ctx?
Returns
boolean
Inherited from
MeshMaterial.needFragmentColorInput
updateRenderStates()
protectedupdateRenderStates(pass,stateSet,ctx):void
Defined in: libs/scene/src/material/meshmaterial.ts:737
Update render states per pass and draw context. Sets blending, alpha-to-coverage, depth test/write, cull mode, color mask, and cooperates with OIT.
Parameters
pass
number
Current material pass index.
stateSet
RenderStateSet
Render state set to update.
ctx
Current draw context.
Returns
void
void
Inherited from
MeshMaterial.updateRenderStates
getQueueType()
getQueueType():
number
Defined in: libs/scene/src/material/meshmaterial.ts:830
Determine the render queue for this material. Transparent materials are queued as QUEUE_TRANSPARENT, otherwise QUEUE_OPAQUE.
Returns
number
The queue type constant.
Inherited from
isTransparentPass()
isTransparentPass(
pass,ctx?):boolean
Defined in: libs/scene/src/material/meshmaterial.ts:840
Whether the given pass is transparent. Default returns true when blendMode !== 'none'.
Parameters
pass
number
Material pass index.
ctx?
Returns
boolean
True if the pass is transparent; otherwise false.
Inherited from
MeshMaterial.isTransparentPass
featureUsed()
featureUsed<
T>(feature):T
Defined in: libs/scene/src/material/meshmaterial.ts:867
Query a feature flag’s current value.
Type Parameters
T
T = unknown
Expected value type.
Parameters
feature
number
The feature index.
Returns
T
The current value for the feature, typed as T.
Inherited from
useFeature()
useFeature(
feature,use):void
Defined in: libs/scene/src/material/meshmaterial.ts:878
Enable or disable a feature and trigger variant rebuild when changed. Calls optionChanged(true) internally on change.
Parameters
feature
number
The feature index to set.
use
unknown
The new feature value (typed by convention).
Returns
void
void
Inherited from
needFragmentColor()
needFragmentColor(
ctx?):boolean
Defined in: libs/scene/src/material/meshmaterial.ts:917
Whether the fragment shader needs to compute color. Returns true for LIGHT pass, or when alpha test or alpha-to-coverage is enabled. Override if the material writes color in other passes.
Parameters
ctx?
Optional draw context; defaults to the last captured drawContext.
Returns
boolean
True if fragment color computation is needed; otherwise false.
Inherited from
MeshMaterial.needFragmentColor
outputFragmentColor()
outputFragmentColor(
scope,worldPos,color,ssrRoughness?,ssrNormal?,sssProfile?,sssParams?,sssDiffuse?,sssTransmission?,sssProfileEnabled?,skinSSS?):void
Defined in: libs/scene/src/material/meshmaterial.ts:1069
Centralized final color write and per-pass output composition.
Behavior by pass:
- LIGHT: clipping, alpha handling, optional OIT integration, fog application, color output encoding.
- DEPTH: encoded depth; optional motion vectors (TAA enabled/disabled handling).
- OBJECT_COLOR: object color and distance output (linear depth or world-pos + distance).
- SHADOWMAP: writes shadow depth via light’s shadow implementation.
Also writes SSR roughness/normal buffers when requested via material flags.
Parameters
scope
PBInsideFunctionScope
Inside-function shader scope.
worldPos
PBShaderExp
Fragment world-space position expression.
color
PBShaderExp
Lit fragment color expression; may be undefined for depth-only paths.
ssrRoughness?
PBShaderExp
Optional SSR roughness output expression.
ssrNormal?
PBShaderExp
Optional SSR normal output expression.
sssProfile?
PBShaderExp
Optional SSS profile output expression.
sssParams?
PBShaderExp
Optional SSS packed params output expression.
sssDiffuse?
PBShaderExp
Optional diffuse-only lighting color for SSS composition.
sssTransmission?
PBShaderExp
Optional thin-shell transmission lighting color for SSS composition.
sssProfileEnabled?
boolean = false
True only when this material should write SSS profile data.
skinSSS?
PBShaderExp
Returns
void
void
Inherited from
MeshMaterial.outputFragmentColor
clone()
clone():
ParticleMaterial
Defined in: libs/scene/src/material/particle.ts:46
Create a clone of this particle material, copying relevant parameters (jitter, aspect, directional).
Returns
ParticleMaterial
A cloned ParticleMaterial.
Implementation of
Clonable.clone
Overrides
copyFrom()
copyFrom(
other):void
Defined in: libs/scene/src/material/particle.ts:57
Copy base and particle-specific properties from another particle material.
Parameters
other
this
The source material to copy from.
Returns
void
void
Overrides
supportInstancing()
supportInstancing():
boolean
Defined in: libs/scene/src/material/particle.ts:69
Particles are not instanced via material instancing. Each particle system is expected to provide per-particle data through vertex attributes instead.
Returns
boolean
False always.
Overrides
MeshMaterial.supportInstancing
vertexShader()
vertexShader(
scope):void
Defined in: libs/scene/src/material/particle.ts:167
Vertex shader hook.
Responsibilities:
- Derives per-vertex billboard position in world space based on:
- particle position (
texCoord0), params (texCoord1), and velocity (texCoord2). paramsuniform: x=jitter power, y=aspect scale, z=directional flag.
- particle position (
- Builds a right/up basis aligned with either view or velocity.
- Computes UVs based on vertex ID (quad corners).
- Outputs
zUV,worldPos, andzParticleParams.
Parameters
scope
PBFunctionScope
Vertex shader function scope.
Returns
void
void
Overrides
fragmentShader()
fragmentShader(
scope):void
Defined in: libs/scene/src/material/particle.ts:258
Fragment shader hook.
Responsibilities:
- Optionally samples:
alphaMapfor alpha coverage (R channel).rampMapalong U=particleParams.wfor color/alpha.
- Multiplies ramp color with computed alpha, then delegates to
outputFragmentColor. - If no color is needed (e.g., non-light pass), calls
outputFragmentColorwith null color.
Parameters
scope
PBFunctionScope
Fragment shader function scope.
Returns
void
void
Overrides
applyUniformValues()
applyUniformValues(
bindGroup,ctx,pass):void
Defined in: libs/scene/src/material/particle.ts:295
Submit particle-specific uniforms and textures to the bind group.
Sets:
params= vec4(jitterPower, aspect, directionalFlag, 0).- Binds
alphaMapandrampMapwhen fragment color is needed for the current pass.
Also calls super.applyUniformValues to set common uniforms (alpha cutoff, opacity, etc.).
Parameters
bindGroup
BindGroup
The material bind group (set 2) to write to.
ctx
The current draw context.
pass
number
The current material pass.
Returns
void
void