File: SSGINode.md | Updated: 11/15/2025
Post processing node for applying Screen Space Global Illumination (SSGI) to a scene.
References:
The quality and performance of the effect mainly depend on sliceCount and stepCount. The total number of samples taken per pixel is sliceCount * stepCount * 2. Here are some recommended presets depending on whether temporal filtering is used or not.
With temporal filtering (recommended):
sliceCount of 1, stepCount of 12.sliceCount of 2, stepCount of 8.sliceCount of 3, stepCount of 16.Use for a higher slice count if you notice temporal instabilities like flickering. Reduce the sample count then to mitigate the performance lost.
Without temporal filtering:
sliceCount of 2, stepCount of 6.sliceCount of 3, stepCount of 8.sliceCount of 4, stepCount of 12.SSGINode is an addon, and must be imported explicitly, see Installation#Addons.
import { ssgi } from 'three/addons/tsl/display/SSGINode.js';
Constructs a new SSGI node.
beautyNode | A texture node that represents the beauty or scene pass.
---|---
depthNode | A texture node that represents the scene's depth.
normalNode | A texture node that represents the scene's normals.
camera | The camera the scene is rendered with.
Power function applied to AO to make it appear darker/lighter. Should be in the range [0, 4].
Default is 1.
How much light backface surfaces emit. Should be in the range [0, 1].
Default is 0.
A texture node that represents the beauty or scene pass.
A node that represents the scene's depth.
Controls samples distribution. It's an exponent applied at each step get increasing step size over the distance. Should be in the range [1, 3].
Default is 2.
Intensity of the indirect diffuse light. Should be in the range [0, 100].
Default is 10.
A node that represents the scene's normals. If no normals are passed to the constructor (because MRT is not available), normals can be automatically reconstructed from depth values in the shader.
Effective sampling radius in world space. AO and GI can only have influence within that radius. Should be in the range [1, 25].
Default is 12.
Number of per-pixel hemisphere slices. This has a big performance cost and should be kept as low as possible. Should be in the range [1, 4].
Default is 1.
Number of samples taken along one side of a given hemisphere slice. This has a big performance cost and should be kept as low as possible. Should be in the range [1, 32].
Default is 12.
Constant thickness value of objects on the screen in world units. Allows light to pass behind surfaces past that thickness value. Should be in the range [0.01, 10].
Default is 1.
The updateBeforeType is set to NodeUpdateType.FRAME since the node renders its effect once per frame in updateBefore().
Default is 'frame'.
Overrides: TempNode#updateBeforeType
Whether to increase thickness linearly over distance or not (avoid losing detail over the distance).
Default is false.
Makes the sample distance in screen space instead of world-space (helps having more detail up close).
Default is false.
Whether to use temporal filtering or not. Setting this property to true requires the usage of TRAANode. This will help to reduce noise although it introduces typical TAA artifacts like ghosting and temporal instabilities.
If setting this property to false, a manual denoise via DenoiseNode is required.
Default is true.
Frees internal resources. This method should be called when the effect is no longer required.
Overrides: TempNode#dispose
Returns the result of the effect as a texture node.
Returns: A texture node that represents the result of the effect.
Sets the size of the effect.
width | The width of the effect.
---|---
height | The height of the effect.
This method is used to setup the effect's TSL code.
builder | The current node builder.
---|---
Overrides: TempNode#setup
This method is used to render the effect once per frame.
frame | The current node frame.
---|---
Overrides: TempNode#updateBefore