Skip to content

Documentation / scene / SubsurfaceProfile

Class: SubsurfaceProfile

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

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:231

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:259

Gets the global profile data version.

Remarks

The value is incremented whenever a profile slot is allocated or profile data changes, allowing render systems to refresh cached profile textures.

Returns

number


slot

Get Signature

get slot(): number

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

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:446

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:450

Parameters
val

Immutable<Vector3>

Returns

void


falloffColor

Get Signature

get falloffColor(): Immutable<Vector3>

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

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:466

Parameters
val

Immutable<Vector3>

Returns

void


meanFreePathColor

Get Signature

get meanFreePathColor(): Immutable<Vector3>

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

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:486

Parameters
val

Immutable<Vector3>

Returns

void


meanFreePathDistance

Get Signature

get meanFreePathDistance(): number

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

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:502

Parameters
val

number

Returns

void


preset

Get Signature

get preset(): SubsurfaceProfilePreset

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

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:523

Parameters
val

SubsurfaceProfilePreset

Returns

void


presetIndex

Get Signature

get presetIndex(): number

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

Gets the packed canonical preset index.

Returns

number


strength

Get Signature

get strength(): number

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

Gets or sets the SSS strength multiplier.

Returns

number

Set Signature

set strength(val): void

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

Parameters
val

number

Returns

void


scale

Get Signature

get scale(): number

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

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:565

Parameters
val

number

Returns

void


worldUnitScale

Get Signature

get worldUnitScale(): number

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

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:581

Parameters
val

number

Returns

void


boundaryColorBleed

Get Signature

get boundaryColorBleed(): number

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

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:601

Parameters
val

number

Returns

void


transmissionTintColor

Get Signature

get transmissionTintColor(): Immutable<Vector3>

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

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:618

Parameters
val

Immutable<Vector3>

Returns

void


extinctionScale

Get Signature

get extinctionScale(): number

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

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:637

Parameters
val

number

Returns

void


normalScale

Get Signature

get normalScale(): number

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

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:657

Parameters
val

number

Returns

void


scatteringDistribution

Get Signature

get scatteringDistribution(): number

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

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:677

Parameters
val

number

Returns

void

Methods

getProfileBySlot()

static getProfileBySlot(slot): SubsurfaceProfile

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

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:282

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:297

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:309

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:320

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:363

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:692

Adds a listener that is invoked whenever this profile changes.

Parameters

listener

() => void

The callback to invoke after profile data changes.

Returns

void


removeChangeListener()

removeChangeListener(listener): void

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

Removes a previously registered profile change listener.

Parameters

listener

() => void

The callback to remove.

Returns

void

Released under the MIT License.