Private
constructorPrivate
lutPrivate
rayPrivate
withReplaces potentially screen-size dependent external resources (back buffer, depth buffer, and render target) in the internal bind groups.
Configuration of external resources.
Renders the aerial perspective lookup table.
To produce meaningful results, this requires the transmittance and multiple scattering lookup tables, as well as the uniform buffers containing the Atmosphere and Uniforms parameters to hold valid data. Call renderConstantLuts and updateUniforms to ensure this is the case.
If (a) user-defined shadow map(s) is used (see SkyAtmosphereRendererConfig.shadow), make sure to encode any updates of the shadow map(s) before encoding this pass.
Used to encode rendering of the lookup table. The encoder is not end()
ed by this function.
Renders the transmittance and multiple scattering lookup tables.
To produce meaningful results, this requires the internal uniform buffer containing the Atmosphere parameters to hold valid data. Use the atmosphere parameter to implicitly update the Atmosphere parameters or call updateAtmosphere to ensure this is the case.
Since the transmittance and multiple scattering lookup tables are not view or light souce dependent, this only needs to be called if the Atmosphere parameters change.
Used to encode rendering of the lookup tables. The encoder is not end()
ed by this function.
Optional
atmosphere: AtmosphereIf this is defined, updateAtmosphere is called before rendering the lookup tables.
Renders the sky view and aerial perspective lookup tables.
To produce meaningful results, this requires the transmittance and multiple scattering lookup tables, as well as the uniform buffers containing the Atmosphere and Uniforms parameters to hold valid data. Call renderConstantLuts and updateUniforms to ensure this is the case.
If (a) user-defined shadow map(s) is used (see SkyAtmosphereRendererConfig.shadow), make sure to encode any updates of the shadow map(s) before encoding this pass.
Used to encode rendering of the lookup tables. The encoder is not end()
ed by this function.
Optional
uniforms: UniformsIf this is defined, updateUniforms is called before rendering the lookup tables.
Renders the lookup tables required for rendering the sky / atmosphere.
To initialize or update the transmittance and multiple scattering lookup tables, pass new Atmosphere paramters to this function or use the forceConstantLutRendering
parameter.
A GPUComputePassEncoder
to encode passes with. The encoder is not end()
ed by this function.
Optional
uniforms: UniformsUniforms to use for this frame. If this is given, the internal uniform buffer will be updated using updateUniforms.
Optional
atmosphere: AtmosphereAtmosphere parameters to use for this frame. If this is given, the internal uniform buffer storing the Atmosphere parameters will be updated and the transmittance and multiple scattering lookup tables will be rendered.
Optional
useFullResolutionRayMarch: booleanIf this is true, the sky view and aerial perspective lookup tables will not be rendered.
Optional
forceConstantLutRendering: booleanIf this is true, the transmittance and multiple scattering lookup tables will be rendered regardless of whether the atmosphere
parameter is undefined
or not.
Optional
forceSkyViewLutRendering: booleanIf this is true, the sky view lookup table will be rendered, even if skipDynamicLutRendering is true. Defaults to false.
Renders the sky / atmosphere using either lookup tables or full-resolution ray marching, as well as all look up tables required by the respective approach.
To initialize or update the transmittance and multiple scattering lookup tables, pass new Atmosphere paramters to this function or use the forceConstantLutRendering
parameter.
A GPUComputePassEncoder
to encode passes with. The encoder is not end()
ed by this function.
Optional
uniforms: UniformsUniforms to use for this frame. If this is given, the internal uniform buffer will be updated using updateUniforms.
Optional
atmosphere: AtmosphereAtmosphere parameters to use for this frame. If this is given, the internal uniform buffer storing the Atmosphere parameters will be updated and the transmittance and multiple scattering lookup tables will be rendered.
Optional
useFullResolutionRayMarch: booleanIf this is true, full-resolution ray marching will be used to render the sky / atmosphere. In that case, the sky view and aerial perspective lookup tables will not be rendered. Defaults to defaultToFullResolutionRayMarch.
Optional
forceConstantLutRendering: booleanIf this is true, the transmittance and multiple scattering lookup tables will be rendered regardless of whether the atmosphere
parameter is undefined
or not.
Renders the multiple scattering lookup table.
To produce meaningful results, this requires the internal uniform buffer containing the Atmosphere parameters to hold valid data. Call updateAtmosphere to ensure this is the case.
Since the multiple scattering lookup table is not view or light souce dependent, this only needs to be called if the Atmosphere parameters change.
Used to encode rendering of the lookup table. The encoder is not end()
ed by this function.
updateAtmosphere: To write Atmosphere parameters to the internal uniform buffer, call this function.
Renders the sky / atmosphere using either lookup tables or full-resolution ray marching, as well as all look up tables required by the respective approach.
A GPUComputePassEncoder
to encode the sky / atmosphere rendering pass with. The encoder is not end()
ed by this function.
Optional
useFullResolutionRayMarch: booleanIf this is true, full-resolution ray marching will be used to render the sky / atmosphere. Defaults to defaultToFullResolutionRayMarch.
Renders the sky / atmosphere using full-resolution ray marching.
Requires the transmittance and multiple scattering lookup tables to be initialized. Either initialize these lookup tables in the constructor using SkyAtmosphereRendererConfig.initializeConstantLuts, or call renderConstantLuts.
A GPUComputePassEncoder
to encode the pass with. Can be the same encoder used to initialize the transmittance and multiple scattering lookup tables. The encoder is not end()
ed by this function.
renderConstantLuts: To initialize the lookup tables required, call this function.
Renders the sky view table.
To produce meaningful results, this requires the transmittance and multiple scattering lookup tables, as well as the uniform buffers containing the Atmosphere and Uniforms parameters to hold valid data. Call renderConstantLuts and updateUniforms to ensure this is the case.
Used to encode rendering of the lookup table. The encoder is not end()
ed by this function.
Renders the sky / atmosphere using precomputed lookup tables.
Requires the sky view and aerial perspective lookup tables to be initialized. To initialize these lookup tables, call renderDynamicLuts.
A GPUComputePassEncoder
to encode the pass with. Can be the same encoder used to initialize the sky view and aerial perspective lookup tables. The encoder is not end()
ed by this function.
renderDynamicLuts: To initialize the lookup tables required, call this function.
Renders the transmittance lookup table.
To produce meaningful results, this requires the internal uniform buffer containing the Atmosphere parameters to hold valid data. Call updateAtmosphere to ensure this is the case.
Since the transmittance lookup table is not view or light souce dependent, this only needs to be called if the Atmosphere parameters change.
Used to encode rendering of the lookup table. The encoder is not end()
ed by this function.
updateAtmosphere: To write Atmosphere parameters to the internal uniform buffer, call this function.
Updates the renderer's internal uniform buffer containing the Atmosphere parameters as well as its host-side copy of Atmosphere parameters.
The new Atmosphere to override the current parameters.
SkyAtmosphereResources.updateAtmosphere: Updates the host-side Atmosphere parameters as well as the corresponding uniform buffer.
Updates the renderer's internal uniform buffer containing the Uniforms as well as its host-side copy of Uniforms.
The new Uniforms to override the current parameters.
If custom uniform buffers are used, this does nothing (see CustomUniformsSourceConfig).
SkyAtmosphereResources.updateUniforms: Update the Uniforms uniform buffers.
Static
createCreates a SkyAtmosphereComputeRenderer.
The GPUDevice
used to create internal resources (textures, pipelines, etc.).
A SkyAtmosphereRendererConfig used to configure internal resources and behavior.
Optional
existingLutRenderer: SkyAtmosphereLutRendererIf this is defined, no new internal SkyAtmosphereLutRenderer will be created. Instead, the existing one is used.
Optional
existingPipelines: SkyAtmospherePipelinesIf this is defined, no new pipelines for rendering the internal lookup tables will be created. Instead, the existing pipelines given will be reused. The existing pipelines must be compatible with the SkyAtmosphereRendererConfig. Especially, SkyAtmosphereRendererConfig.lookUpTables and SkyAtmosphereRendererConfig.shadow should be the same.
Optional
existingResources: SkyAtmosphereResourcesIf this is defined, no new resources (buffers, textures, samplers) will be created. Instead, the existing resources given will be used.
Static
createAsynchronously creates a SkyAtmosphereComputeRenderer.
All pipelines used by this renderer are created asynchronously.
The GPUDevice
used to create internal resources (textures, pipelines, etc.).
A SkyAtmosphereRendererConfig used to configure internal resources and behavior.
Optional
existingLutRenderer: SkyAtmosphereLutRendererIf this is defined, no new internal SkyAtmosphereLutRenderer will be created. Instead, the existing one is used.
Optional
existingPipelines: SkyAtmospherePipelinesIf this is defined, no new pipelines for rendering the internal lookup tables will be created. Instead, the existing pipelines given will be reused. The existing pipelines must be compatible with the SkyAtmosphereRendererConfig. Especially, SkyAtmosphereRendererConfig.lookUpTables and SkyAtmosphereRendererConfig.shadow should be the same.
Optional
existingResources: SkyAtmosphereResourcesIf this is defined, no new resources (buffers, textures, samplers) will be created. Instead, the existing resources given will be used.
A SkyAtmosphereLutRenderer that uses
GPUComputePipeline
s to render the sky / atmosphere.