Documentation / scene / SkinMaterial
Class: SkinMaterial
Defined in: libs/scene/src/material/skin.ts:45
Stylized realtime skin material.
Remarks
This material is designed for the SkinSSS post effect. It renders a regular lit color and, when camera.skinSSS is enabled, writes the diffusible part of that color - the stylized diffuse ramp plus back-lit transmission, without specular - into the SkinSSSTexture MRT.
The side buffer holds exactly the same term that is already in the lit color, untinted and unscaled. SkinSSS subtracts it and adds back a channel-dependent diffused version, so the redistribution is energy conserving by construction and disabling the effect leaves the image unchanged. Scatter tint, strength and radius therefore live on the post effect, not here.
Stylization is split from diffusion on purpose. SkinMaterial.diffuseWrap, SkinMaterial.diffuseSoftness, SkinMaterial.shadowTint and SkinMaterial.brightening shape the direct lighting ramp; the post effect then diffuses whatever ramp they produced. A stylized ramp stays stylized after scattering rather than being averaged away.
The optional subsurfaceTexture uses R as skin mask, G as local softness and B as thickness for the back-lit transmission term (thin regions such as ears and nostrils glow when lit from behind; enable it by setting SkinMaterial.transmissionStrength).
Extends
MeshMaterial<this> &object&TextureProp<"normal"> &object&object&object&object&TextureProp<"albedo"> &object&object&object&IMixinVertexColor&TextureProp<"subsurface"> &object&object&object
Implements
Clonable<SkinMaterial>
Constructors
Constructor
new SkinMaterial():
SkinMaterial
Defined in: libs/scene/src/material/skin.ts:63
Returns
SkinMaterial
Overrides
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).constructor
Properties
normalTexture
normalTexture:
Texture2D<unknown>
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).normalTexture
normalTextureSampler
normalTextureSampler:
TextureSampler<unknown>
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).normalTextureSampler
normalTexCoordIndex
normalTexCoordIndex:
number
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).normalTexCoordIndex
normalTexCoordMatrix
normalTexCoordMatrix:
Matrix4x4
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).normalTexCoordMatrix
hasNormalTexture
hasNormalTexture: () =>
boolean
Returns
boolean
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).hasNormalTexture
getNormalTextureUniform
getNormalTextureUniform: (
scope) =>PBShaderExp
Parameters
scope
PBInsideFunctionScope
Returns
PBShaderExp
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).getNormalTextureUniform
getNormalTexCoord
getNormalTexCoord: (
scope) =>PBShaderExp
Parameters
scope
PBInsideFunctionScope
Returns
PBShaderExp
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).getNormalTexCoord
sampleNormalTexture
sampleNormalTexture: (
scope,texCoord?) =>PBShaderExp
Parameters
scope
PBInsideFunctionScope
texCoord?
PBShaderExp
Returns
PBShaderExp
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).sampleNormalTexture
albedoTexture
albedoTexture:
Texture2D<unknown>
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).albedoTexture
albedoTextureSampler
albedoTextureSampler:
TextureSampler<unknown>
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).albedoTextureSampler
albedoTexCoordIndex
albedoTexCoordIndex:
number
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).albedoTexCoordIndex
albedoTexCoordMatrix
albedoTexCoordMatrix:
Matrix4x4
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).albedoTexCoordMatrix
hasAlbedoTexture
hasAlbedoTexture: () =>
boolean
Returns
boolean
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).hasAlbedoTexture
getAlbedoTextureUniform
getAlbedoTextureUniform: (
scope) =>PBShaderExp
Parameters
scope
PBInsideFunctionScope
Returns
PBShaderExp
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).getAlbedoTextureUniform
getAlbedoTexCoord
getAlbedoTexCoord: (
scope) =>PBShaderExp
Parameters
scope
PBInsideFunctionScope
Returns
PBShaderExp
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).getAlbedoTexCoord
sampleAlbedoTexture
sampleAlbedoTexture: (
scope,texCoord?) =>PBShaderExp
Parameters
scope
PBInsideFunctionScope
texCoord?
PBShaderExp
Returns
PBShaderExp
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).sampleAlbedoTexture
subsurfaceTexture
subsurfaceTexture:
Texture2D<unknown>
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).subsurfaceTexture
subsurfaceTextureSampler
subsurfaceTextureSampler:
TextureSampler<unknown>
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).subsurfaceTextureSampler
subsurfaceTexCoordIndex
subsurfaceTexCoordIndex:
number
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).subsurfaceTexCoordIndex
subsurfaceTexCoordMatrix
subsurfaceTexCoordMatrix:
Matrix4x4
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).subsurfaceTexCoordMatrix
hasSubsurfaceTexture
hasSubsurfaceTexture: () =>
boolean
Returns
boolean
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).hasSubsurfaceTexture
getSubsurfaceTextureUniform
getSubsurfaceTextureUniform: (
scope) =>PBShaderExp
Parameters
scope
PBInsideFunctionScope
Returns
PBShaderExp
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).getSubsurfaceTextureUniform
getSubsurfaceTexCoord
getSubsurfaceTexCoord: (
scope) =>PBShaderExp
Parameters
scope
PBInsideFunctionScope
Returns
PBShaderExp
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).getSubsurfaceTexCoord
sampleSubsurfaceTexture
sampleSubsurfaceTexture: (
scope,texCoord?) =>PBShaderExp
Parameters
scope
PBInsideFunctionScope
texCoord?
PBShaderExp
Returns
PBShaderExp
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).sampleSubsurfaceTexture
albedoColor
albedoColor:
Vector4
Defined in: libs/scene/src/material/mixins/albedocolor.ts:16
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).albedoColor
normalScale
normalScale:
number
Defined in: libs/scene/src/material/mixins/lit.ts:23
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).normalScale
normalFlipY
normalFlipY:
boolean
Defined in: libs/scene/src/material/mixins/lit.ts:24
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).normalFlipY
normalMapMode
normalMapMode:
"tangent-space"|"object-space"
Defined in: libs/scene/src/material/mixins/lit.ts:25
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).normalMapMode
doubleSidedLighting
doubleSidedLighting:
boolean
Defined in: libs/scene/src/material/mixins/lit.ts:26
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).doubleSidedLighting
vertexColor
vertexColor:
boolean
Defined in: libs/scene/src/material/mixins/vertexcolor.ts:10
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).vertexColor
Accessors
disposed
Get Signature
get disposed():
boolean
Defined in: libs/base/dist/index.d.ts:6107
Returns
boolean
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).disposed
changeTag
Get Signature
get changeTag():
number
Defined in: libs/scene/src/material/material.ts:173
Incremented when the material’s GPU-relevant state changes and render bundles may need to be rebuilt.
Returns
number
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).changeTag
instanceId
Get Signature
get instanceId():
number
Defined in: libs/scene/src/material/material.ts:179
Runtime-unique numeric identifier for the material instance.
Returns
number
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).instanceId
numPasses
Get Signature
get numPasses():
number
Defined in: libs/scene/src/material/material.ts:189
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:192
Parameters
val
number
Returns
void
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).numPasses
coreMaterial
Get Signature
get coreMaterial():
this
Defined in: libs/scene/src/material/material.ts:283
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
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).coreMaterial
drawContext
Get Signature
get drawContext():
DrawContext
Defined in: libs/scene/src/material/meshmaterial.ts:514
Draw context captured during program creation, available inside shader hooks.
Returns
The last DrawContext used to build or apply this material.
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).drawContext
pass
Get Signature
get pass():
number
Defined in: libs/scene/src/material/meshmaterial.ts:523
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
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).pass
alphaCutoff
Get Signature
get alphaCutoff():
number
Defined in: libs/scene/src/material/meshmaterial.ts:532
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:535
Parameters
val
number
Returns
void
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).alphaCutoff
alphaDither
Get Signature
get alphaDither():
boolean
Defined in: libs/scene/src/material/meshmaterial.ts:547
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:550
Parameters
val
boolean
Returns
void
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).alphaDither
TAADisabled
Get Signature
get TAADisabled():
boolean
Defined in: libs/scene/src/material/meshmaterial.ts:561
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:564
Parameters
val
boolean
Returns
void
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).TAADisabled
transparentMotionVector
Get Signature
get transparentMotionVector():
boolean
Defined in: libs/scene/src/material/meshmaterial.ts:581
Whether a blended material contributes motion vectors.
Remarks
Off by default, and only meaningful with blendMode !== 'none': blended geometry is normally absent from the prepass, so it writes no velocity and a temporal filter reprojects it with whatever is behind it. Turning this on adds it to a motion-vector-only pass over the transparent queue.
Right for geometry that is dense enough to own its pixels - hair, foliage cards - where one velocity per pixel is a fair summary. Wrong for genuinely see-through surfaces such as glass, where the background's own velocity is the one that should survive, which is why this is opt-in.
Returns
boolean
Set Signature
set transparentMotionVector(
val):void
Defined in: libs/scene/src/material/meshmaterial.ts:584
Parameters
val
boolean
Returns
void
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).transparentMotionVector
TAAStrength
Get Signature
get TAAStrength():
number
Defined in: libs/scene/src/material/meshmaterial.ts:592
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:595
Parameters
val
number
Returns
void
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).TAAStrength
alphaToCoverage
Get Signature
get alphaToCoverage():
boolean
Defined in: libs/scene/src/material/meshmaterial.ts:607
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:610
Parameters
val
boolean
Returns
void
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).alphaToCoverage
blendMode
Get Signature
get blendMode():
BlendMode
Defined in: libs/scene/src/material/meshmaterial.ts:618
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:621
Parameters
val
Returns
void
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).blendMode
transparentShadowCaster
Get Signature
get transparentShadowCaster():
boolean
Defined in: libs/scene/src/material/meshmaterial.ts:632
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:635
Parameters
val
boolean
Returns
void
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).transparentShadowCaster
shadowAlphaCutoff
Get Signature
get shadowAlphaCutoff():
number
Defined in: libs/scene/src/material/meshmaterial.ts:644
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:647
Parameters
val
number
Returns
void
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).shadowAlphaCutoff
cullMode
Get Signature
get cullMode():
FaceMode
Defined in: libs/scene/src/material/meshmaterial.ts:658
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:661
Parameters
val
FaceMode
Returns
void
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).cullMode
opacity
Get Signature
get opacity():
number
Defined in: libs/scene/src/material/meshmaterial.ts:671
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:674
Parameters
val
number
Returns
void
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).opacity
objectColor
Get Signature
get objectColor():
Immutable<Vector4>
Defined in: libs/scene/src/material/meshmaterial.ts:685
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:688
Parameters
val
Immutable<Vector4>
Returns
void
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).objectColor
skinSSS
Get Signature
get skinSSS():
boolean
Defined in: libs/scene/src/material/skin.ts:80
Marker used by the forward render graph to allocate the SkinSSS MRT.
Returns
boolean
vertexNormal
Get Signature
get vertexNormal():
boolean
Defined in: libs/scene/src/material/skin.ts:108
true if vertex normal attribute presents
Returns
boolean
Set Signature
set vertexNormal(
val):void
Defined in: libs/scene/src/material/skin.ts:111
Parameters
val
boolean
Returns
void
vertexTangent
Get Signature
get vertexTangent():
boolean
Defined in: libs/scene/src/material/skin.ts:116
true if vertex tangent attribute presents
Returns
boolean
Set Signature
set vertexTangent(
val):void
Defined in: libs/scene/src/material/skin.ts:119
Parameters
val
boolean
Returns
void
shininess
Get Signature
get shininess():
number
Defined in: libs/scene/src/material/skin.ts:124
Blinn specular exponent. Higher values produce smaller highlights.
Returns
number
Set Signature
set shininess(
val):void
Defined in: libs/scene/src/material/skin.ts:127
Parameters
val
number
Returns
void
specularStrength
Get Signature
get specularStrength():
number
Defined in: libs/scene/src/material/skin.ts:136
Direct specular strength. Keep this restrained for soft skin.
Returns
number
Set Signature
set specularStrength(
val):void
Defined in: libs/scene/src/material/skin.ts:139
Parameters
val
number
Returns
void
diffuseWrap
Get Signature
get diffuseWrap():
number
Defined in: libs/scene/src/material/skin.ts:148
Wrap amount for visible diffuse lighting.
Returns
number
Set Signature
set diffuseWrap(
val):void
Defined in: libs/scene/src/material/skin.ts:151
Parameters
val
number
Returns
void
diffuseSoftness
Get Signature
get diffuseSoftness():
number
Defined in: libs/scene/src/material/skin.ts:160
Blend from hard Lambert lighting to wrapped diffuse lighting.
Returns
number
Set Signature
set diffuseSoftness(
val):void
Defined in: libs/scene/src/material/skin.ts:163
Parameters
val
number
Returns
void
scatterWrap
Get Signature
get scatterWrap():
number
Defined in: libs/scene/src/material/skin.ts:180
Wider wrap that used to shape the post-process scattering source.
Deprecated
No longer has any effect. The side buffer now carries the real diffuse term rather than a hand-built difference that was nonzero only near the terminator, so there is nothing for a second wrap to shape. Use SkinSSS.scatterRadius and the profile's channel radii to control how far light travels, and SkinMaterial.diffuseWrap to shape the ramp.
Returns
number
Set Signature
set scatterWrap(
val):void
Defined in: libs/scene/src/material/skin.ts:183
Parameters
val
number
Returns
void
scatterStrength
Get Signature
get scatterStrength():
number
Defined in: libs/scene/src/material/skin.ts:200
Strength of the multiplier written into the SkinSSS side buffer.
Deprecated
No longer has any effect. Scaling the side buffer would break the identity that makes the diffusion energy conserving - it must equal the diffusible term already present in the lit color. Use SkinSSS.strength for the overall amount and SkinSSS.glow for an additive, non-conserving bleed on top.
Returns
number
Set Signature
set scatterStrength(
val):void
Defined in: libs/scene/src/material/skin.ts:203
Parameters
val
number
Returns
void
transmissionStrength
Get Signature
get transmissionStrength():
number
Defined in: libs/scene/src/material/skin.ts:215
Strength of the back-lit transmission term. Requires a subsurfaceTexture with thickness in the B channel; 0 (the default) disables transmission.
Returns
number
Set Signature
set transmissionStrength(
val):void
Defined in: libs/scene/src/material/skin.ts:218
Parameters
val
number
Returns
void
transmissionPower
Get Signature
get transmissionPower():
number
Defined in: libs/scene/src/material/skin.ts:227
Exponent of the back-lit transmission falloff. Higher values tighten the glow.
Returns
number
Set Signature
set transmissionPower(
val):void
Defined in: libs/scene/src/material/skin.ts:230
Parameters
val
number
Returns
void
scatterColor
Get Signature
get scatterColor():
Immutable<Vector4>
Defined in: libs/scene/src/material/skin.ts:247
Warm tint for the blurred skin lighting contribution.
Deprecated
No longer has any effect; moved to SkinSSS.scatterTint. Tinting here would tint the diffuse in the lit color too, which is what made the old look read as a red haze over the whole face. On the post effect the tint applies only to the light that actually moved, and per-channel scatter radii from the profile already produce the red bleed on their own.
Returns
Immutable<Vector4>
Set Signature
set scatterColor(
val):void
Defined in: libs/scene/src/material/skin.ts:250
Parameters
val
Immutable<Vector4>
Returns
void
shadowTint
Get Signature
get shadowTint():
Immutable<Vector4>
Defined in: libs/scene/src/material/skin.ts:262
NPR-style shadow tint: the dark end of the diffuse ramp lifts toward this color instead of black (black, the default, reproduces plain wrapped lambert). A rosy/lavender tint gives the stylized beauty-shot shadow look.
Returns
Immutable<Vector4>
Set Signature
set shadowTint(
val):void
Defined in: libs/scene/src/material/skin.ts:265
Parameters
val
Immutable<Vector4>
Returns
void
brightening
Get Signature
get brightening():
number
Defined in: libs/scene/src/material/skin.ts:273
Whitening gain applied to the whole diffuse response. 0 (the default) is neutral.
Returns
number
Set Signature
set brightening(
val):void
Defined in: libs/scene/src/material/skin.ts:276
Parameters
val
number
Returns
void
Methods
on()
on<
K>(type,listener,context?):void
Defined in: libs/base/dist/index.d.ts:630
IEventTarget.on
Type Parameters
K
K extends "dispose"
Parameters
type
K
listener
EventListener<{ dispose: []; }, K>
context?
unknown
Returns
void
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).on
once()
once<
K>(type,listener,context?):void
Defined in: libs/base/dist/index.d.ts:634
IEventTarget.once
Type Parameters
K
K extends "dispose"
Parameters
type
K
listener
EventListener<{ dispose: []; }, K>
context?
unknown
Returns
void
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).once
off()
off<
K>(type,listener?,context?):void
Defined in: libs/base/dist/index.d.ts:638
IEventTarget.off
Type Parameters
K
K extends "dispose"
Parameters
type
K
listener?
EventListener<{ dispose: []; }>
context?
unknown
Returns
void
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).off
dispatchEvent()
dispatchEvent<
K>(type, ...args):void
Defined in: libs/base/dist/index.d.ts:642
IEventTarget.dispatchEvent
Type Parameters
K
K extends "dispose"
Parameters
type
K
args
...object[K]
Returns
void
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).dispatchEvent
dispose()
dispose():
void
Defined in: libs/base/dist/index.d.ts:6108
Returns
void
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).dispose
getNumPassesForRender()
protectedgetNumPassesForRender(_ctx):number
Defined in: libs/scene/src/material/material.ts:205
Get the number of passes this material will render for the given draw context.
Default returns numPasses. Subclasses may override to skip passes based on context flags.
Parameters
_ctx
Draw context (device, flags, pass hash, instance data, etc.).
Returns
number
Number of passes to render for this context.
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).getNumPassesForRender
supportInstancing()
supportInstancing():
boolean
Defined in: libs/scene/src/material/material.ts:249
Whether this material supports hardware instancing.
Override and return false if per-instance data is not supported in the shader.
Returns
boolean
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).supportInstancing
isBatchable()
isBatchable():
boolean
Defined in: libs/scene/src/material/material.ts:253
Returns true if this is a instance of material
Returns
boolean
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).isBatchable
needSceneColor()
needSceneColor():
boolean
Defined in: libs/scene/src/material/material.ts:260
Whether this material requires the scene color texture (e.g., for refraction).
Returns
boolean
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).needSceneColor
needSceneDepth()
needSceneDepth():
boolean
Defined in: libs/scene/src/material/material.ts:266
Whether this material requires the linear scene depth texture (e.g., for depth-aware effects).
Returns
boolean
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).needSceneDepth
applyUniforms()
applyUniforms(
bindGroup,ctx,needUpdate,pass):void
Defined in: libs/scene/src/material/material.ts:450
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
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).applyUniforms
clearCache()
clearCache():
void
Defined in: libs/scene/src/material/material.ts:475
Returns
void
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).clearCache
passToHash()
passToHash(
pass):string
Defined in: libs/scene/src/material/material.ts:503
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
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).passToHash
drawPrimitive()
drawPrimitive(
pass,primitive,ctx,numInstances):void
Defined in: libs/scene/src/material/material.ts:531
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
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).drawPrimitive
onDispose()
protectedonDispose():void
Defined in: libs/scene/src/material/material.ts:546
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
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).onDispose
apply()
apply(
ctx):boolean
Defined in: libs/scene/src/material/meshmaterial.ts:243
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
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).apply
uniformChanged()
uniformChanged():
void
Defined in: libs/scene/src/material/meshmaterial.ts:252
Mark uniform-only changes so uniforms are re-uploaded on next apply, without rebuilding shader programs.
Returns
void
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).uniformChanged
defineFeature()
staticdefineFeature():number
Defined in: libs/scene/src/material/meshmaterial.ts:259
Define a new feature bit/index for shader variants. Subclasses may use this to add their own switches.
Returns
number
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).defineFeature
defineInstanceUniform()
staticdefineInstanceUniform(prop,type,name?):number
Defined in: libs/scene/src/material/meshmaterial.ts:292
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
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).defineInstanceUniform
getInstancedUniform()
getInstancedUniform(
scope,uniformIndex):PBShaderExp
Defined in: libs/scene/src/material/meshmaterial.ts:333
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
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).getInstancedUniform
getInstancedUniforms()
getInstancedUniforms():
object[]
Defined in: libs/scene/src/material/meshmaterial.ts:355
Get the list of per-instance uniforms for this material class.
Returns
object[]
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).getInstancedUniforms
createInstance()
createInstance():
this
Defined in: libs/scene/src/material/meshmaterial.ts:370
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
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).createInstance
supportLighting()
supportLighting():
boolean
Defined in: libs/scene/src/material/meshmaterial.ts:700
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
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).supportLighting
getEffectiveBlendMode()
protectedgetEffectiveBlendMode(pass,ctx?):BlendMode
Defined in: libs/scene/src/material/meshmaterial.ts:707
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
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).getEffectiveBlendMode
getActiveAlphaCutoff()
protectedgetActiveAlphaCutoff(ctx?,pass?):number
Defined in: libs/scene/src/material/meshmaterial.ts:736
Returns the alpha cutoff that should be used for the current pass.
Parameters
ctx?
pass?
number = ...
Returns
number
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).getActiveAlphaCutoff
useTransparentShadowCaster()
useTransparentShadowCaster(
ctx?,_pass?):boolean
Defined in: libs/scene/src/material/meshmaterial.ts:742
Whether the current pass should use the shadow-only masked caster path.
Parameters
ctx?
_pass?
number = ...
Returns
boolean
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).useTransparentShadowCaster
useTransparentShadowCasterForPass()
useTransparentShadowCasterForPass(
renderPassType?):boolean
Defined in: libs/scene/src/material/meshmaterial.ts:748
Whether the specified render pass type should reinterpret this transparent material as a masked shadow caster.
Parameters
renderPassType?
number
Returns
boolean
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).useTransparentShadowCasterForPass
usesAlphaCutoff()
protectedusesAlphaCutoff(ctx,pass):boolean
Defined in: libs/scene/src/material/meshmaterial.ts:758
Whether this pass needs an alpha-cutoff uniform bound.
Parameters
ctx
pass
number
Returns
boolean
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).usesAlphaCutoff
needFragmentColorInput()
needFragmentColorInput(
ctx?):boolean
Defined in: libs/scene/src/material/meshmaterial.ts:766
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
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).needFragmentColorInput
updateRenderStates()
protectedupdateRenderStates(pass,stateSet,ctx):void
Defined in: libs/scene/src/material/meshmaterial.ts:779
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
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).updateRenderStates
getQueueType()
getQueueType():
number
Defined in: libs/scene/src/material/meshmaterial.ts:893
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
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).getQueueType
isTransparentPass()
isTransparentPass(
pass,ctx?):boolean
Defined in: libs/scene/src/material/meshmaterial.ts:903
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
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).isTransparentPass
featureUsed()
featureUsed<
T>(feature):T
Defined in: libs/scene/src/material/meshmaterial.ts:930
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
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).featureUsed
useFeature()
useFeature(
feature,use):void
Defined in: libs/scene/src/material/meshmaterial.ts:941
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
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).useFeature
isMaterialTextureEnabled()
protectedisMaterialTextureEnabled(_name):boolean
Defined in: libs/scene/src/material/meshmaterial.ts:972
Parameters
_name
string
Returns
boolean
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).isMaterialTextureEnabled
needFragmentColor()
needFragmentColor(
ctx?):boolean
Defined in: libs/scene/src/material/meshmaterial.ts:983
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
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).needFragmentColor
outputFragmentColor()
outputFragmentColor(
scope,worldPos,color,ssrRoughness?,ssrNormal?,sssProfile?,sssParams?,sssDiffuse?,sssTransmission?,sssProfileEnabled?,skinSSS?):void
Defined in: libs/scene/src/material/meshmaterial.ts:1139
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
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).outputFragmentColor
calculateAlbedoColor()
calculateAlbedoColor(
scope,uv?):PBShaderExp
Defined in: libs/scene/src/material/mixins/albedocolor.ts:17
Parameters
scope
PBInsideFunctionScope
uv?
PBShaderExp
Returns
PBShaderExp
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).calculateAlbedoColor
receivesWaterCaustics()
receivesWaterCaustics():
boolean
Defined in: libs/scene/src/material/mixins/lit.ts:27
Returns
boolean
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).receivesWaterCaustics
needCalculateEnvLight()
needCalculateEnvLight():
boolean
Defined in: libs/scene/src/material/mixins/lit.ts:28
Returns
boolean
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).needCalculateEnvLight
getUniformNormalScale()
getUniformNormalScale(
scope):PBShaderExp
Defined in: libs/scene/src/material/mixins/lit.ts:29
Parameters
scope
PBInsideFunctionScope
Returns
PBShaderExp
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).getUniformNormalScale
getEnvLightIrradiance()
getEnvLightIrradiance(
scope,normal):PBShaderExp
Defined in: libs/scene/src/material/mixins/lit.ts:30
Parameters
scope
PBInsideFunctionScope
normal
PBShaderExp
Returns
PBShaderExp
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).getEnvLightIrradiance
getEnvLightRadiance()
getEnvLightRadiance(
scope,reflectVec,roughness):PBShaderExp
Defined in: libs/scene/src/material/mixins/lit.ts:31
Parameters
scope
PBInsideFunctionScope
reflectVec
PBShaderExp
roughness
PBShaderExp
Returns
PBShaderExp
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).getEnvLightRadiance
calculateViewVector()
calculateViewVector(
scope,worldPos):PBShaderExp
Defined in: libs/scene/src/material/mixins/lit.ts:36
Parameters
scope
PBInsideFunctionScope
worldPos
PBShaderExp
Returns
PBShaderExp
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).calculateViewVector
calculateReflectionVector()
calculateReflectionVector(
scope,normal,viewVec):PBShaderExp
Defined in: libs/scene/src/material/mixins/lit.ts:37
Parameters
scope
PBInsideFunctionScope
normal
PBShaderExp
viewVec
PBShaderExp
Returns
PBShaderExp
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).calculateReflectionVector
calculateTBN()
calculateTBN(
scope,worldPos,worldNormal?,worldTangent?,worldBinormal?):PBShaderExp
Defined in: libs/scene/src/material/mixins/lit.ts:42
Parameters
scope
PBInsideFunctionScope
worldPos
PBShaderExp
worldNormal?
PBShaderExp
worldTangent?
PBShaderExp
worldBinormal?
PBShaderExp
Returns
PBShaderExp
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).calculateTBN
calculateNormal()
calculateNormal(
scope,worldPos,worldNormal?,worldTangent?,worldBinormal?):PBShaderExp
Defined in: libs/scene/src/material/mixins/lit.ts:49
Parameters
scope
PBInsideFunctionScope
worldPos
PBShaderExp
worldNormal?
PBShaderExp
worldTangent?
PBShaderExp
worldBinormal?
PBShaderExp
Returns
PBShaderExp
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).calculateNormal
calculateNormalAndTBN()
calculateNormalAndTBN(
scope,worldPos,worldNormal?,worldTangent?,worldBinormal?):PBShaderExp
Defined in: libs/scene/src/material/mixins/lit.ts:56
Parameters
scope
PBInsideFunctionScope
worldPos
PBShaderExp
worldNormal?
PBShaderExp
worldTangent?
PBShaderExp
worldBinormal?
PBShaderExp
Returns
PBShaderExp
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).calculateNormalAndTBN
calculateLightAttenuation()
calculateLightAttenuation(
scope,type,worldPos,posRange,dirCutoff,extra?):PBShaderExp
Defined in: libs/scene/src/material/mixins/lit.ts:63
Parameters
scope
PBInsideFunctionScope
type
PBShaderExp
worldPos
PBShaderExp
posRange
PBShaderExp
dirCutoff
PBShaderExp
extra?
PBShaderExp
Returns
PBShaderExp
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).calculateLightAttenuation
calculateLightDirection()
calculateLightDirection(
scope,type,worldPos,posRange,dirCutoff):PBShaderExp
Defined in: libs/scene/src/material/mixins/lit.ts:71
Parameters
scope
PBInsideFunctionScope
type
PBShaderExp
worldPos
PBShaderExp
posRange
PBShaderExp
dirCutoff
PBShaderExp
Returns
PBShaderExp
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).calculateLightDirection
calculateShadow()
calculateShadow(
scope,worldPos,worldNormal,NoL):PBShaderExp
Defined in: libs/scene/src/material/mixins/lit.ts:78
Parameters
scope
PBInsideFunctionScope
worldPos
PBShaderExp
worldNormal
PBShaderExp
NoL
PBShaderExp
Returns
PBShaderExp
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).calculateShadow
forEachLight()
forEachLight(
scope,callback):void
Defined in: libs/scene/src/material/mixins/lit.ts:84
Parameters
scope
PBInsideFunctionScope
callback
(this, type, posRange, dirCutoff, colorIntensity, extra, shadow) => void
Returns
void
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).forEachLight
getVertexColor()
getVertexColor(
scope):PBShaderExp
Defined in: libs/scene/src/material/mixins/vertexcolor.ts:11
Parameters
scope
PBInsideFunctionScope
Returns
PBShaderExp
Inherited from
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).getVertexColor
clone()
clone():
SkinMaterial
Defined in: libs/scene/src/material/skin.ts:84
Create a shallow clone of this material. Subclasses should override to copy custom fields.
Returns
SkinMaterial
Implementation of
Clonable.clone
Overrides
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).clone
copyFrom()
copyFrom(
other):void
Defined in: libs/scene/src/material/skin.ts:90
Copy common MeshMaterial properties from another material. Call super.copyFrom(other) first when overriding in subclasses.
Parameters
other
this
Source material.
Returns
void
Overrides
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).copyFrom
vertexShader()
vertexShader(
scope):void
Defined in: libs/scene/src/material/skin.ts:284
Vertex shader hook. Prepares common inputs (skin/morph/instancing), varyings, and pass-dependent outputs. Override to implement per-vertex logic; use ShaderHelper as needed.
Parameters
scope
PBFunctionScope
Vertex shader function scope.
Returns
void
void
Overrides
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).vertexShader
fragmentShader()
fragmentShader(
scope):void
Defined in: libs/scene/src/material/skin.ts:310
Fragment shader hook. Declares pass-dependent uniforms (e.g., opacity, objectColor, alphaCutoff). Override to implement per-fragment logic, and call outputFragmentColor to finalize writes.
Parameters
scope
PBFunctionScope
Fragment shader function scope.
Returns
void
void
Overrides
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).fragmentShader
applyUniformValues()
applyUniformValues(
bindGroup,ctx,pass):void
Defined in: libs/scene/src/material/skin.ts:555
Submit material uniforms/resources to the material bind group (set 2). Handles alpha cutoff, opacity (non-instanced transparent), OIT, object color, and TAA strength.
Parameters
bindGroup
BindGroup
The material bind group to write into.
ctx
Current draw context.
pass
number
Current material pass index.
Returns
void
void
Overrides
applyMaterialMixins(MeshMaterial, mixinLight, mixinVertexColor, mixinTextureProps('subsurface')).applyUniformValues