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

Set of reflection probes in 3D space. More...

#include <GREM/graphics_3d/ReflectionProbes3D.hpp>

Classes

struct  AtlasParameters
 Struct of shader parameters representing the reflection probe atlases. More...
struct  ProbeFields
 Struct of shader fields representing a reflection probe. More...

Public Types

using AtlasBuffer = UniformBuffer<AtlasParameters, "ReflectionProbes3DAtlases">
 Shader buffer for reflection probe atlases.
using ProbeBuffer = StorageBuffer<ProbeFields, "LightProbeVolumes3DProbes">
 Shader buffer for reflection probes.

Public Member Functions

 ReflectionProbes3D (Device &device, const ReflectionProbes3DOptions &options={})
 Construct an empty set of reflection probes.
 ReflectionProbes3D (Device &device, Texture reflectionMaps, ArrayList< ReflectionProbeOptions3D > probeOptions, const ReflectionProbes3DOptions &options)
 Construct a pre-baked set of reflection probes.
void clearReflectionProbes () noexcept
 Remove all reflection probes from the set.
void addReflectionProbe (const ReflectionProbeOptions3D &options)
 Add a reflection probe to the set.
void setReflectionProbes (const ReflectionProbes3DOptions &newOptions)
 Set the reflection probe set to the default empty set with new options.
void setReflectionProbes (Texture newReflectionMaps, ArrayList< ReflectionProbeOptions3D > newProbeOptions, const ReflectionProbes3DOptions &newOptions)
 Assign a pre-baked set of reflection probes to the reflection probe set.
const Texture & getReflectionMaps () const noexcept
 Get the reflection maps of the reflection probes.
Span< const ReflectionProbeOptions3D > getProbeOptions () const noexcept
 Get the configuration options for the reflection probes in the set.
ReflectionProbes3DOptions getOptions () const noexcept
 Get the configuration options of the reflection probe set.

Static Public Attributes

static constexpr TextureSamplerOptions REFLECTION_MAPS_SAMPLER_OPTIONS
 Sampler options to use for the reflection maps of reflection probes.

Detailed Description

Set of reflection probes in 3D space.

Member Typedef Documentation

◆ AtlasBuffer

Shader buffer for reflection probe atlases.

◆ ProbeBuffer

Shader buffer for reflection probes.

Constructor & Destructor Documentation

◆ ReflectionProbes3D() [1/2]

grem::graphics::ReflectionProbes3D::ReflectionProbes3D ( Device & device,
const ReflectionProbes3DOptions & options = {} )
explicit

Construct an empty set of reflection probes.

Parameters
devicedevice to create the set for. Must outlive the set.
optionsreflection probe set options, see ReflectionProbes3DOptions.
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.

◆ ReflectionProbes3D() [2/2]

grem::graphics::ReflectionProbes3D::ReflectionProbes3D ( Device & device,
Texture reflectionMaps,
ArrayList< ReflectionProbeOptions3D > probeOptions,
const ReflectionProbes3DOptions & options )

Construct a pre-baked set of reflection probes.

Parameters
devicedevice to create the set for. Must outlive the set.
reflectionMapspre-baked reflection maps for the reflection probes. Must be a valid sampled cube array texture in an RGB(A) color format, or empty if there are no probes. The texture's sampler options should be ReflectionProbes3D::REFLECTION_MAPS_SAMPLER_OPTIONS.
probeOptionslist of reflection probe options.
optionsreflection probe set options, see ReflectionProbes3DOptions.
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

◆ clearReflectionProbes()

void grem::graphics::ReflectionProbes3D::clearReflectionProbes ( )
noexcept

Remove all reflection probes from the set.

◆ addReflectionProbe()

void grem::graphics::ReflectionProbes3D::addReflectionProbe ( const ReflectionProbeOptions3D & options)

Add a reflection probe to the set.

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

◆ setReflectionProbes() [1/2]

void grem::graphics::ReflectionProbes3D::setReflectionProbes ( const ReflectionProbes3DOptions & newOptions)

Set the reflection probe set to the default empty set with new options.

Parameters
newOptionsreflection probe set options, see ReflectionProbes3DOptions.
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.

◆ setReflectionProbes() [2/2]

void grem::graphics::ReflectionProbes3D::setReflectionProbes ( Texture newReflectionMaps,
ArrayList< ReflectionProbeOptions3D > newProbeOptions,
const ReflectionProbes3DOptions & newOptions )

Assign a pre-baked set of reflection probes to the reflection probe set.

Parameters
newReflectionMapspre-baked reflection maps for the reflection probes. Must be a valid sampled cube array texture in an RGB(A) color format, or empty if there are no probes.
newProbeOptionslist of reflection probe options.
newOptionsreflection probe set options, see ReflectionProbes3DOptions.
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.

◆ getReflectionMaps()

const Texture & grem::graphics::ReflectionProbes3D::getReflectionMaps ( ) const
inlinenodiscardnoexcept

Get the reflection maps of the reflection probes.

Returns
a read-only reference to the reflection maps cube array texture, which will be empty if the reflection probes have not been baked since their last modification.

◆ getProbeOptions()

Span< const ReflectionProbeOptions3D > grem::graphics::ReflectionProbes3D::getProbeOptions ( ) const
inlinenodiscardnoexcept

Get the configuration options for the reflection probes in the set.

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

◆ getOptions()

ReflectionProbes3DOptions grem::graphics::ReflectionProbes3D::getOptions ( ) const
inlinenodiscardnoexcept

Get the configuration options of the reflection probe set.

Returns
the current configuration options.

Member Data Documentation

◆ REFLECTION_MAPS_SAMPLER_OPTIONS

TextureSamplerOptions grem::graphics::ReflectionProbes3D::REFLECTION_MAPS_SAMPLER_OPTIONS
staticconstexpr
Initial value:
{
.minificationFilter = TextureFilter::LINEAR,
.magnificationFilter = TextureFilter::LINEAR,
.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
@ LINEAR
Interpolate between the two nearest mip levels to the displayed size.
Definition Texture.hpp:484
@ LINEAR
Interpolate between texels for a smoother appearance.
Definition Texture.hpp:475

Sampler options to use for the reflection maps of reflection probes.


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