GREM 3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
grem::graphics::LightProbeVolumes3D Class Reference

Set of light probe volumes in 3D space. More...

#include <GREM/graphics_3d/LightProbeVolumes3D.hpp>

Classes

struct  AtlasParameters
 Struct of shader parameters representing the light probe volume atlases. More...
struct  VolumeFields
 Struct of shader fields representing a light probe volume. More...

Public Types

using AtlasBuffer = UniformBuffer<AtlasParameters, "LightProbeVolumes3DAtlases">
 Shader buffer for light probe volume atlases.
using VolumeBuffer = StorageBuffer<VolumeFields, "LightProbeVolumes3DVolumes">
 Shader buffer for light probe volumes.

Public Member Functions

 LightProbeVolumes3D (Device &device, const LightProbeVolumes3DOptions &options={})
 Construct an empty set of light probe volumes.
 LightProbeVolumes3D (Device &device, Texture irradianceAtlasTexture, Texture distanceAtlasTexture, ArrayList< LightProbeVolumeOptions3D > volumeOptions, const LightProbeVolumes3DOptions &options)
 Construct a pre-baked set of light probe volumes.
void clearLightProbeVolumes () noexcept
 Remove all light probe volumes from the set.
void addLightProbeVolume (const LightProbeVolumeOptions3D &options)
 Add a light probe volume to the set.
void setLightProbeVolumes (const LightProbeVolumes3DOptions &newOptions)
 Set the light probe volume set to the default empty set with new options.
void setLightProbeVolumes (Texture newIrradianceAtlasTexture, Texture newDistanceAtlasTexture, ArrayList< LightProbeVolumeOptions3D > newVolumeOptions, const LightProbeVolumes3DOptions &newOptions)
 Assign a pre-baked set of light probe volumes to the light probe volume set.
const Texture & getIrradianceAtlasTexture () const noexcept
 Get the atlas of irradiance values for the light probe volumes.
const Texture & getDistanceAtlasTexture () const noexcept
 Get the atlas of distance values for the light probe volumes.
Span< const LightProbeVolumeOptions3D > getVolumeOptions () const noexcept
 Get the configuration options for the light probe volumes in the set.
LightProbeVolumes3DOptions getOptions () const noexcept
 Get the configuration options of the light probe volume set.

Static Public Attributes

static constexpr TextureSamplerOptions IRRADIANCE_ATLAS_SAMPLER_OPTIONS
 Sampler options to use for the irradiance atlas of light probe volumes.
static constexpr TextureSamplerOptions DISTANCE_ATLAS_SAMPLER_OPTIONS
 Sampler options to use for the distance atlas of light probe volumes.

Detailed Description

Set of light probe volumes in 3D space.

Member Typedef Documentation

◆ AtlasBuffer

Shader buffer for light probe volume atlases.

◆ VolumeBuffer

Shader buffer for light probe volumes.

Constructor & Destructor Documentation

◆ LightProbeVolumes3D() [1/2]

grem::graphics::LightProbeVolumes3D::LightProbeVolumes3D ( Device & device,
const LightProbeVolumes3DOptions & options = {} )
explicit

Construct an empty set of light probe volumes.

Parameters
devicedevice to create the set for. Must outlive the set.
optionslight probe volume set options, see LightProbeVolumes3DOptions.
Exceptions
graphics::Errorif resource creation failed.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.

◆ LightProbeVolumes3D() [2/2]

grem::graphics::LightProbeVolumes3D::LightProbeVolumes3D ( Device & device,
Texture irradianceAtlasTexture,
Texture distanceAtlasTexture,
ArrayList< LightProbeVolumeOptions3D > volumeOptions,
const LightProbeVolumes3DOptions & options )

Construct a pre-baked set of light probe volumes.

Parameters
devicedevice to create the set for. Must outlive the set.
irradianceAtlasTexturepre-baked atlas of irradiance values for the light probe volumes. Must be a valid sampled 2D array texture in an RGB(A) color format, or empty if there are no volumes. The texture's sampler options should be LightProbeVolumes3D::IRRADIANCE_ATLAS_SAMPLER_OPTIONS.
distanceAtlasTexturepre-baked atlas of distance values for the light probe volumes. Must be a valid sampled 2D array texture in a single-channel color format, or empty if there are no volumes. The texture's sampler options should be LightProbeVolumes3D::DISTANCE_ATLAS_SAMPLER_OPTIONS.
volumeOptionslist of light probe volume options.
optionslight probe volume set options, see LightProbeVolumes3DOptions.
Exceptions
graphics::Errorif resource creation failed.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.

Member Function Documentation

◆ clearLightProbeVolumes()

void grem::graphics::LightProbeVolumes3D::clearLightProbeVolumes ( )
noexcept

Remove all light probe volumes from the set.

◆ addLightProbeVolume()

void grem::graphics::LightProbeVolumes3D::addLightProbeVolume ( const LightProbeVolumeOptions3D & options)

Add a light probe volume to the set.

Parameters
optionslight probe volume options, see LightProbeVolumeOptions3D.
Exceptions
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.

◆ setLightProbeVolumes() [1/2]

void grem::graphics::LightProbeVolumes3D::setLightProbeVolumes ( const LightProbeVolumes3DOptions & newOptions)

Set the light probe volume set to the default empty set with new options.

Parameters
newOptionslight probe volume set options, see LightProbeVolumes3DOptions.
Exceptions
graphics::Errorif resource creation failed.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.

◆ setLightProbeVolumes() [2/2]

void grem::graphics::LightProbeVolumes3D::setLightProbeVolumes ( Texture newIrradianceAtlasTexture,
Texture newDistanceAtlasTexture,
ArrayList< LightProbeVolumeOptions3D > newVolumeOptions,
const LightProbeVolumes3DOptions & newOptions )

Assign a pre-baked set of light probe volumes to the light probe volume set.

Parameters
newIrradianceAtlasTexturepre-baked atlas of irradiance values for the light probe volumes. Must be a valid sampled 2D array texture in an RGB(A) color format, or empty if there are no volumes.
newDistanceAtlasTexturepre-baked atlas of distance values for the light probe volumes. Must be a valid sampled 2D array texture in a single-channel color format, or empty if there are no volumes.
newVolumeOptionslist of light probe volume options.
newOptionslight probe volume set options, see LightProbeVolumes3DOptions.
Exceptions
graphics::Errorif resource creation failed.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.

◆ getIrradianceAtlasTexture()

const Texture & grem::graphics::LightProbeVolumes3D::getIrradianceAtlasTexture ( ) const
inlinenodiscardnoexcept

Get the atlas of irradiance values for the light probe volumes.

Returns
a read-only reference to the irradiance atlas texture, which will be empty if the light probe volumes have not been baked since their last modification.

◆ getDistanceAtlasTexture()

const Texture & grem::graphics::LightProbeVolumes3D::getDistanceAtlasTexture ( ) const
inlinenodiscardnoexcept

Get the atlas of distance values for the light probe volumes.

Returns
a read-only reference to the distance atlas texture, which will be empty if the light probe volumes have not been baked since their last modification.

◆ getVolumeOptions()

Span< const LightProbeVolumeOptions3D > grem::graphics::LightProbeVolumes3D::getVolumeOptions ( ) const
inlinenodiscardnoexcept

Get the configuration options for the light probe volumes in the set.

Returns
a read-only view over the list of light probe volume options, valid until the next modification to the light probe volume set.

◆ getOptions()

LightProbeVolumes3DOptions grem::graphics::LightProbeVolumes3D::getOptions ( ) const
inlinenodiscardnoexcept

Get the configuration options of the light probe volume set.

Returns
the current configuration options.

Member Data Documentation

◆ IRRADIANCE_ATLAS_SAMPLER_OPTIONS

TextureSamplerOptions grem::graphics::LightProbeVolumes3D::IRRADIANCE_ATLAS_SAMPLER_OPTIONS
staticconstexpr
Initial value:
{
.minificationFilter = TextureFilter::LINEAR,
.magnificationFilter = TextureFilter::LINEAR,
.mipmapMode = TextureMipmapMode::NONE,
.horizontalWrappingMode = TextureWrappingMode::CLAMP_TO_EDGE,
.verticalWrappingMode = TextureWrappingMode::CLAMP_TO_EDGE,
.maxAnisotropy = 1.0f,
}
@ CLAMP_TO_EDGE
Clamp to the edge of the texture when sampling outside the 0-1 range.
Definition Texture.hpp:492
@ NONE
Always use the most detailed mip level (level 0).
Definition Texture.hpp:482
@ LINEAR
Interpolate between texels for a smoother appearance.
Definition Texture.hpp:475

Sampler options to use for the irradiance atlas of light probe volumes.

◆ DISTANCE_ATLAS_SAMPLER_OPTIONS

TextureSamplerOptions grem::graphics::LightProbeVolumes3D::DISTANCE_ATLAS_SAMPLER_OPTIONS
staticconstexpr
Initial value:
{
.minificationFilter = TextureFilter::LINEAR,
.magnificationFilter = TextureFilter::LINEAR,
.mipmapMode = TextureMipmapMode::NONE,
.horizontalWrappingMode = TextureWrappingMode::CLAMP_TO_EDGE,
.verticalWrappingMode = TextureWrappingMode::CLAMP_TO_EDGE,
.maxAnisotropy = 1.0f,
}

Sampler options to use for the distance atlas of light probe volumes.


The documentation for this class was generated from the following file: