CLASSES
TagsA - Z

VolumetricLightScatteringPostProcess

PostProcess

Description

class VolumetricLightScatteringPostProcess extends PostProcess

Constructor

new VolumetricLightScatteringPostProcess(name, ratio, camera, mesh, samples, samplingMode, engine, reusable, scene)

@constructor

Parameters

Name Type Description
name string
ratio any
camera Camera
optional mesh Mesh
optional samples number
optional samplingMode number
optional engine Engine
optional reusable boolean

Members

attachedNode : { position: Vector3 }

If not undefined, the mesh position is computed from the attached node position

@type {{position: Vector3}}

customMeshPosition : Vector3

Custom position of the mesh. Used if "useCustomMeshPosition" is set to "true"

@type {Vector3}

useCustomMeshPosition : boolean

Set if the post-process should use a custom position for the light source (true) or the internal mesh position (false)

@type {boolean}

invert : boolean

If the post-process should inverse the light scattering direction

@type {boolean}

mesh : Mesh

The internal mesh used by the post-process

@type {boolean}

useDiffuseColor : boolean

Set to true to use the diffuseColor instead of the diffuseTexture

@type {boolean}

excludedMeshes : AbstractMesh[]

Array containing the excluded meshes not rendered in the internal pass

exposure : number

Controls the overall intensity of the post-process

@type {number}

decay : number

Dissipates each sample's contribution in range [0, 1]

@type {number}

weight : number

Controls the overall intensity of each sample

@type {number}

density : number

Controls the density of each sample

@type {number}

Methods

isReady(subMesh, useInstances) → boolean

Parameters

Name Type Description
subMesh SubMesh
useInstances boolean

setCustomMeshPosition(position) → void

Sets the new light position for light scattering effect

Parameters

Name Type Description
position Vector3

getCustomMeshPosition() → Vector3

Returns the light position for light scattering effect

@return {BABYLON.Vector3} The custom light position

dispose(camera) → void

Disposes the internal assets and detaches the post-process from the camera

Parameters

Name Type Description
camera Camera

getPass() → RenderTargetTexture

Returns the render target texture used by the post-process

@return {BABYLON.RenderTargetTexture} The render target texture used by the post-process

static CreateDefaultMesh(name, scene) → Mesh

Creates a default mesh for the Volumeric Light Scattering post-process

@return {BABYLON.Mesh} the default mesh

Parameters

Name Type Description
name string
scene Scene