Class FrameGraphVolumetricLightingTask
Hierarchy (View Summary)
- FrameGraphTask
- FrameGraphVolumetricLightingTask
Constructors
constructor
-
new FrameGraphVolumetricLightingTask(
name: string,
frameGraph: FrameGraph,
enableExtinction?: boolean,
): FrameGraphVolumetricLightingTaskCreates a new FrameGraphVolumetricLightingTask.
Parameters
- name: string
The name of the task.
- frameGraph: FrameGraph
The frame graph to which the task belongs.
- enableExtinction: boolean = false
Whether to enable extinction in the volumetric lighting effect (default: false). If you don't plan to set extinction to something different than (0, 0, 0), you can disable this to save some performance.
Returns FrameGraphVolumetricLightingTask
- name: string
Properties
Optionaldependencies
The (texture) dependencies of the task (optional).
depth Texture
The depth texture used for volumetric lighting calculations. It must be the depth texture used to generate targetTexture.
Readonlyenable Extinction
Whether to enable extinction in the volumetric lighting effect (default: false). Read-only property set in the constructor.
light
The directional light used for volumetric lighting.
lighting Volume Mesh
The mesh representing the lighting volume. This is the mesh that will be rendered to create the volumetric lighting effect.
Optionallighting Volume Texture
The lighting volume texture (optional). If not provided, a new texture will be created, with the same size, format and type as targetTexture. This is the texture that will store the volumetric lighting information, before being blended to targetTexture.
on After Task Execute
An observable that is triggered after the task is executed.
on Before Task Execute
An observable that is triggered before the task is executed.
on Textures Allocated Observable
An observable that is triggered after the textures have been allocated.
Readonlyoutput Texture
The output texture of the task. It will be the same as targetTexture.
source Sampling Mode
The sampling mode to use when blending the volumetric lighting texture with targetTexture.
target Texture
The target texture to which the volumetric lighting will be applied.
Accessors
camera
-
get camera(): Camera
The camera used for volumetric lighting calculations.
Returns Camera
-
set camera(value: Camera): void
Parameters
- value: Camera
Returns void
disabled
-
get disabled(): boolean
Whether the task is disabled.
Returns boolean
-
set disabled(value: boolean): void
Parameters
- value: boolean
Returns void
extinction
-
get extinction(): Vector3
The extinction coefficient for the volumetric lighting effect (default: (0, 0, 0) - no extinction). This parameter controls how much light is absorbed and scattered as it travels through the medium. Will only have an effect if enableExtinction is set to true in the constructor!
Returns Vector3
-
set extinction(value: Vector3): void
Parameters
- value: Vector3
Returns void
light Power
-
get lightPower(): Color3
The light power/color for the volumetric lighting effect (default: (1, 1, 1)). This parameter controls the intensity and color of the light used for volumetric lighting.
Returns Color3
-
set lightPower(value: Color3): void
Parameters
- value: Color3
Returns void
name
-
get name(): string
The name of the task.
Returns string
-
set name(name: string): void
The name of the task.
Parameters
- name: string
Returns void
passes
-
get passes(): IFrameGraphPass[]
Gets the passes of the task.
Returns IFrameGraphPass[]
passes Disabled
-
get passesDisabled(): IFrameGraphPass[]
Gets the disabled passes of the task.
Returns IFrameGraphPass[]
phase G
-
get phaseG(): number
The phase G parameter for the volumetric lighting effect (default: 0). This parameter controls the anisotropy of the scattering. A value of 0 means isotropic scattering, while a value of 1 means forward scattering and -1 means backward scattering.
Returns number
-
set phaseG(value: number): void
Parameters
- value: number
Returns void
Methods
dispose
-
Disposes of the task.
Returns void
get Class Name
-
Gets the current class name
Returns string
the class name
init Async
-
This function is called once after the task has been added to the frame graph and before the frame graph is built for the first time. This allows you to initialize asynchronous resources, which is not possible in the constructor.
Returns Promise<unknown>
A promise that resolves when the initialization is complete.
is Ready
-
Checks if the task is ready to be executed.
Returns any
True if the task is ready to be executed, else false.
record
-
Records the task in the frame graph. Use this function to add content (render passes, ...) to the task.
Parameters
- skipCreationOfDisabledPasses: boolean = false
If true, the disabled passe(s) won't be created.
Returns void
- skipCreationOfDisabledPasses: boolean = false
StaticIs Supported
-
Returns whether volumetric lighting is supported by the engine.
Parameters
- engine: AbstractEngine
The engine to check for volumetric lighting support.
- enableExtinction: boolean = false
Whether the extinction/dual-source blending path will be used.
Returns any
True if volumetric lighting is supported, false otherwise.
- engine: AbstractEngine
A frame graph task that performs volumetric lighting.