Class GIRSMManager
Constructors
constructor
-
new GIRSMManager(
scene: Scene,
outputDimensions: { height: number; width: number },
giTextureDimensions?: { height: number; width: number },
maxSamples?: number,
giTextureType?: any,
): GIRSMManagerCreates a new GIRSMManager
Parameters
- scene: Scene
The scene
- outputDimensions: { height: number; width: number }
The dimensions of the output texture (width and height). Should normally be the same as the output dimensions of the screen.
- giTextureDimensions: { height: number; width: number } = ...
The dimensions of the GI texture (width and height). Try to use the smallest size possible for better performance.
- maxSamples: number = 2048
The maximum number of samples to generate in the sample texture. Default value is 2048. The numSamples property of the GIRSM should be less than or equal to this value!
- giTextureType: any = Constants.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV
The texture type used by the GI texture. Default is Constants.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV.
Returns GIRSMManager
- scene: Scene
Properties
blur Depth Threshold
Defines the depth threshold used by the bilateral blur post-processes (also used by the upsampling, if enabled). You may have to change this value, depending on your scene.
blur Kernel
Defines the kernel size used by the bilateral blur post-processes. Default is 12.
blur Normal Threshold
Defines the normal threshold used by the bilateral blur post-processes (also used by the upsampling, if enabled). You may have to change this value, depending on your scene.
pause
Defines if the global illumination calculation is paused or not. Use this setting to pause the global illumination calculation when you know that the scene (camera/mesh/light positions) is not changing anymore to save some GPU power. The scene will still be rendered with the latest global illumination contribution.
upsampler Kernel
Defines the kernel size used by the bilateral upsampling post-processes. Default is 6.
StaticGeometry Buffer Texture Types And Formats
[key: number]: { textureFormat: number; textureType: number };
} = ...
Defines the default texture types and formats used by the geometry buffer renderer.
Accessors
counters GPU
-
get countersGPU(): { name: string; value: number }[]
Gets the list of GPU counters used by the manager. GPU timing measurements must be enabled for the counters to be filled (engine.enableGPUTimingMeasurements = true). Only available with WebGPU. You will still get the list of counters with other engines but the values will always be 0.
Returns { name: string; value: number }[]
enable
-
get enable(): boolean
Enables or disables the manager. Default is false. If disabled, the global illumination won't be calculated and the scene will be rendered normally, without any global illumination contribution.
Returns boolean
-
set enable(enable: boolean): void
Parameters
- enable: boolean
Returns void
enable Blur
-
get enableBlur(): boolean
Defines if the global illumination contribution should be blurred or not (using a bilateral blur). Default is true.
Returns boolean
-
set enableBlur(enable: boolean): void
Parameters
- enable: boolean
Returns void
full Size Blur
-
get fullSizeBlur(): boolean
Defines if the blur should be done at full resolution or not. Default is false. If this setting is enabled, upampling will be disabled (ignored) as it is not needed anymore.
Returns boolean
-
set fullSizeBlur(mode: boolean): void
Parameters
- mode: boolean
Returns void
gi RSM
-
Gets the list of GIRSM used by the manager.
Returns GIRSM[]
gi Texture Type
-
get giTextureType(): number
Gets or sets the texture type used by the GI texture. Default is Constants.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV.
Returns number
-
set giTextureType(textureType: number): void
Parameters
- textureType: number
Returns void
shader Language
-
get shaderLanguage(): ShaderLanguage
Gets the shader language used in this material.
Returns ShaderLanguage
show Only GI
-
get showOnlyGI(): boolean
Defines if the debug layer should be enabled or not. Default is false. Use this setting for debugging purpose, to show the global illumination contribution only.
Returns boolean
-
set showOnlyGI(show: boolean): void
Parameters
- show: boolean
Returns void
use32 Bits Depth Buffer
-
get use32BitsDepthBuffer(): boolean
Defines if the depth buffer used by the geometry buffer renderer should be 32 bits or not. Default is false (16 bits).
Returns boolean
-
set use32BitsDepthBuffer(enable: boolean): void
Parameters
- enable: boolean
Returns void
use Quality Blur
-
get useQualityBlur(): boolean
Defines if the blur should be done with a better quality but slower or not. Default is false.
Returns boolean
-
set useQualityBlur(enable: boolean): void
Parameters
- enable: boolean
Returns void
use Quality Upsampling
-
get useQualityUpsampling(): boolean
Defines if the upsampling should be done with a better quality but slower or not. Default is false.
Returns boolean
-
set useQualityUpsampling(enable: boolean): void
Parameters
- enable: boolean
Returns void
Methods
add GIRSM
add Material
-
Add a material to the manager. This will enable the global illumination contribution for the material.
Parameters
Optionalmaterial: anyMaterial that will be affected by the global illumination contribution. If not provided, all materials of the scene will be affected.
Returns void
dispose
-
Disposes the manager.
Returns void
generate Sample Texture
-
Generates the sample texture used by the the global illumination calculation process.
Parameters
- maxSamples: number
The maximum number of samples to generate in the texture. Default value is 2048. The numSamples property of the GIRSM should be less than or equal to this value!
Returns void
- maxSamples: number
recreate Resources
-
Recreates the resources used by the manager. You should normally not have to call this method manually, except if you change the useFullTexture property of a GIRSM, because the manager won't track this change.
Parameters
- disposeGeometryBufferRenderer: boolean = false
Defines if the geometry buffer renderer should be disposed and recreated. Default is false.
Returns void
- disposeGeometryBufferRenderer: boolean = false
remove GIRSM
set GI Texture Dimensions
-
Sets the dimensions of the GI texture. Try to use the smallest size possible for better performance.
Parameters
- dimensions: { height: number; width: number }
The dimensions of the GI texture (width and height)
Returns void
- dimensions: { height: number; width: number }
set Output Dimensions
-
Sets the output dimensions of the final process. It should normally be the same as the output dimensions of the screen.
Parameters
- dimensions: { height: number; width: number }
The dimensions of the output texture (width and height)
Returns void
- dimensions: { height: number; width: number }
Class used to manage the global illumination contribution calculated from reflective shadow maps (RSM).