Skip to content

Documentation / scene / SubsurfaceProfile

Class: SubsurfaceProfile

Defined in: libs/scene/src/material/subsurfaceprofile.ts:219

Serializable subsurface scattering profile.

Remarks

The profile stores the channel-dependent scattering radius and falloff used by the screen-space SSS post effect. Materials can share a profile instance to emulate Unreal-style skin profile assets.

Constructors

Constructor

new SubsurfaceProfile(): SubsurfaceProfile

Defined in: libs/scene/src/material/subsurfaceprofile.ts:250

Creates a subsurface scattering profile initialized with the default skin preset.

Returns

SubsurfaceProfile

Accessors

version

Get Signature

get static version(): number

Defined in: libs/scene/src/material/subsurfaceprofile.ts:304

Returns

number


slot

Get Signature

get slot(): number

Defined in: libs/scene/src/material/subsurfaceprofile.ts:479

Gets the 1-based profile slot used when encoding this profile into SSS buffers.

Returns

number


scatterRadius

Get Signature

get scatterRadius(): Immutable<Vector3>

Defined in: libs/scene/src/material/subsurfaceprofile.ts:491

Gets or sets the RGB scatter radius.

Remarks

Assigning a radius also updates the mean-free-path authoring controls.

Returns

Immutable<Vector3>

Set Signature

set scatterRadius(val): void

Defined in: libs/scene/src/material/subsurfaceprofile.ts:495

Parameters
val

Immutable<Vector3>

Returns

void


falloffColor

Get Signature

get falloffColor(): Immutable<Vector3>

Defined in: libs/scene/src/material/subsurfaceprofile.ts:507

Gets or sets the channel falloff color used by the diffusion kernel.

Returns

Immutable<Vector3>

Set Signature

set falloffColor(val): void

Defined in: libs/scene/src/material/subsurfaceprofile.ts:511

Parameters
val

Immutable<Vector3>

Returns

void


meanFreePathColor

Get Signature

get meanFreePathColor(): Immutable<Vector3>

Defined in: libs/scene/src/material/subsurfaceprofile.ts:527

Mean free path color used to derive channel-dependent scatter radius.

Remarks

This is a more UE-like authoring control that keeps the existing radius- based implementation, while letting tools expose a color + distance pair.

Returns

Immutable<Vector3>

Set Signature

set meanFreePathColor(val): void

Defined in: libs/scene/src/material/subsurfaceprofile.ts:531

Parameters
val

Immutable<Vector3>

Returns

void


meanFreePathDistance

Get Signature

get meanFreePathDistance(): number

Defined in: libs/scene/src/material/subsurfaceprofile.ts:543

Gets or sets the mean free path distance used to derive the absolute scatter radius.

Returns

number

Set Signature

set meanFreePathDistance(val): void

Defined in: libs/scene/src/material/subsurfaceprofile.ts:547

Parameters
val

number

Returns

void


preset

Get Signature

get preset(): SubsurfaceProfilePreset

Defined in: libs/scene/src/material/subsurfaceprofile.ts:564

Gets or sets the active subsurface profile preset.

Remarks

Assigning a preset applies its template values to the profile. Alias preset names are resolved to their canonical preset.

Returns

SubsurfaceProfilePreset

Set Signature

set preset(val): void

Defined in: libs/scene/src/material/subsurfaceprofile.ts:568

Parameters
val

SubsurfaceProfilePreset

Returns

void


presetIndex

Get Signature

get presetIndex(): number

Defined in: libs/scene/src/material/subsurfaceprofile.ts:581

Gets the packed canonical preset index.

Returns

number


strength

Get Signature

get strength(): number

Defined in: libs/scene/src/material/subsurfaceprofile.ts:590

Gets or sets the SSS strength multiplier.

Returns

number

Set Signature

set strength(val): void

Defined in: libs/scene/src/material/subsurfaceprofile.ts:594

Parameters
val

number

Returns

void


scale

Get Signature

get scale(): number

Defined in: libs/scene/src/material/subsurfaceprofile.ts:606

Gets or sets the screen-space scatter width scale.

Returns

number

Set Signature

set scale(val): void

Defined in: libs/scene/src/material/subsurfaceprofile.ts:610

Parameters
val

number

Returns

void


worldUnitScale

Get Signature

get worldUnitScale(): number

Defined in: libs/scene/src/material/subsurfaceprofile.ts:622

Gets or sets the world-unit scale used when converting profile radii.

Returns

number

Set Signature

set worldUnitScale(val): void

Defined in: libs/scene/src/material/subsurfaceprofile.ts:626

Parameters
val

number

Returns

void


boundaryColorBleed

Get Signature

get boundaryColorBleed(): number

Defined in: libs/scene/src/material/subsurfaceprofile.ts:642

Gets or sets the amount of color bleeding preserved near SSS boundaries.

Remarks

Values are clamped to the [0, 1] range.

Returns

number

Set Signature

set boundaryColorBleed(val): void

Defined in: libs/scene/src/material/subsurfaceprofile.ts:646

Parameters
val

number

Returns

void


transmissionTintColor

Get Signature

get transmissionTintColor(): Immutable<Vector3>

Defined in: libs/scene/src/material/subsurfaceprofile.ts:659

Gets or sets the RGB tint applied to transmitted subsurface light.

Returns

Immutable<Vector3>

Set Signature

set transmissionTintColor(val): void

Defined in: libs/scene/src/material/subsurfaceprofile.ts:663

Parameters
val

Immutable<Vector3>

Returns

void


extinctionScale

Get Signature

get extinctionScale(): number

Defined in: libs/scene/src/material/subsurfaceprofile.ts:678

Gets or sets the extinction multiplier used by transmission attenuation.

Remarks

Values are clamped to zero or greater.

Returns

number

Set Signature

set extinctionScale(val): void

Defined in: libs/scene/src/material/subsurfaceprofile.ts:682

Parameters
val

number

Returns

void


normalScale

Get Signature

get normalScale(): number

Defined in: libs/scene/src/material/subsurfaceprofile.ts:698

Gets or sets the normal sensitivity scale used by SSS filtering.

Remarks

Values are clamped to zero or greater.

Returns

number

Set Signature

set normalScale(val): void

Defined in: libs/scene/src/material/subsurfaceprofile.ts:702

Parameters
val

number

Returns

void


scatteringDistribution

Get Signature

get scatteringDistribution(): number

Defined in: libs/scene/src/material/subsurfaceprofile.ts:718

Gets or sets the scattering distribution blend.

Remarks

Values are clamped to the [0, 1] range.

Returns

number

Set Signature

set scatteringDistribution(val): void

Defined in: libs/scene/src/material/subsurfaceprofile.ts:722

Parameters
val

number

Returns

void


specularDetailSoftness

Get Signature

get specularDetailSoftness(): number

Defined in: libs/scene/src/material/subsurfaceprofile.ts:731

Strength of the screen-space filter applied to normal-driven specular detail.

Returns

number

Set Signature

set specularDetailSoftness(val): void

Defined in: libs/scene/src/material/subsurfaceprofile.ts:735

Parameters
val

number

Returns

void


specularDetailRadius

Get Signature

get specularDetailRadius(): number

Defined in: libs/scene/src/material/subsurfaceprofile.ts:744

Radius in screen pixels used to soften normal-driven specular detail.

Returns

number

Set Signature

set specularDetailRadius(val): void

Defined in: libs/scene/src/material/subsurfaceprofile.ts:748

Parameters
val

number

Returns

void

Methods

clone()

clone(): SubsurfaceProfile

Defined in: libs/scene/src/material/subsurfaceprofile.ts:272

Returns

SubsurfaceProfile


copyFrom()

copyFrom(other): void

Defined in: libs/scene/src/material/subsurfaceprofile.ts:278

Parameters

other

SubsurfaceProfile

Returns

void


dispose()

dispose(): void

Defined in: libs/scene/src/material/subsurfaceprofile.ts:295

Returns

void


getProfileBySlot()

static getProfileBySlot(slot): SubsurfaceProfile

Defined in: libs/scene/src/material/subsurfaceprofile.ts:316

Gets the profile assigned to a packed profile slot.

Parameters

slot

number

The 1-based profile slot index.

Returns

SubsurfaceProfile

The profile assigned to the slot, or null if the slot is invalid or unused.


getDefaultSkinProfile()

static getDefaultSkinProfile(): SubsurfaceProfile

Defined in: libs/scene/src/material/subsurfaceprofile.ts:327

Gets the shared default skin subsurface profile.

Returns

SubsurfaceProfile

The lazily-created default skin profile.


getPresetTintBiasByIndex()

static getPresetTintBiasByIndex(index): [number, number, number]

Defined in: libs/scene/src/material/subsurfaceprofile.ts:342

Gets the preset tint bias used by the screen-space transmission model.

Parameters

index

number

The packed canonical preset index.

Returns

[number, number, number]

The RGB tint bias for the preset, or white when the index is unknown.


getPresetResponseByIndex()

static getPresetResponseByIndex(index): [number, number, number, number]

Defined in: libs/scene/src/material/subsurfaceprofile.ts:354

Gets the preset transmission response used by the screen-space SSS pass.

Parameters

index

number

The packed canonical preset index.

Returns

[number, number, number, number]

The four-component transmission response for the preset.


getDerivedTintBias()

getDerivedTintBias(): [number, number, number]

Defined in: libs/scene/src/material/subsurfaceprofile.ts:365

Computes the effective tint bias from the preset and current profile settings.

Returns

[number, number, number]

The derived RGB tint bias used for transmission tinting.


getDerivedTransmissionResponse()

getDerivedTransmissionResponse(): [number, number, number, number]

Defined in: libs/scene/src/material/subsurfaceprofile.ts:408

Computes the effective transmission response from the preset and current profile settings.

Returns

[number, number, number, number]

The derived transmission response packed as four scalar channels.


addChangeListener()

addChangeListener(listener): void

Defined in: libs/scene/src/material/subsurfaceprofile.ts:756

Parameters

listener

() => void

Returns

void


removeChangeListener()

removeChangeListener(listener): void

Defined in: libs/scene/src/material/subsurfaceprofile.ts:767

Removes a previously registered profile change listener.

Parameters

listener

() => void

The callback to remove.

Returns

void

Released under the MIT License.