4#ifndef GREM_GRAPHICS_3D_LIGHT_PROBE_VOLUMES_3D_HPP
5#define GREM_GRAPHICS_3D_LIGHT_PROBE_VOLUMES_3D_HPP
150 .maxAnisotropy = 1.0f,
162 .maxAnisotropy = 1.0f,
202 GREM_API(graphics_3d)
254 GREM_API(graphics_3d)
266 return irradianceAtlasTexture;
277 return distanceAtlasTexture;
287 return volumeOptions;
303 GREM_API(graphics_3d)
void flushVolumesAndTextures(
Device& device)
const;
304 GREM_API(graphics_3d)
void flush(
Device& device,
Renderer3D& renderer3D)
const;
308 mutable Texture irradianceAtlasTexture{};
309 mutable Texture distanceAtlasTexture{};
310 mutable uint32_t irradianceAtlasResolution = 0;
311 mutable uint32_t irradianceAtlasDepth = 0;
312 mutable uint32_t distanceAtlasResolution = 0;
313 mutable uint32_t distanceAtlasDepth = 0;
314 mutable Buffer<VolumeFields> volumes{};
315 mutable Buffer<float> worldSpaceVolumes{};
318 mutable bool volumesDirty =
false;
319 mutable bool texturesDirty =
false;
320 mutable bool buffersDirty =
true;
Definition ArrayList.hpp:27
Persistent system managing the rendering context of a Window.
Definition Device.hpp:68
System for pre-baking global illumination.
Definition LightBaker3D.hpp:134
void setLightProbeVolumes(const LightProbeVolumes3DOptions &newOptions)
Set the light probe volume set to the default empty set with new options.
const Texture & getDistanceAtlasTexture() const noexcept
Get the atlas of distance values for the light probe volumes.
Definition LightProbeVolumes3D.hpp:276
const Texture & getIrradianceAtlasTexture() const noexcept
Get the atlas of irradiance values for the light probe volumes.
Definition LightProbeVolumes3D.hpp:265
void addLightProbeVolume(const LightProbeVolumeOptions3D &options)
Add a light probe volume to the set.
Span< const LightProbeVolumeOptions3D > getVolumeOptions() const noexcept
Get the configuration options for the light probe volumes in the set.
Definition LightProbeVolumes3D.hpp:286
LightProbeVolumes3D(Device &device, const LightProbeVolumes3DOptions &options={})
Construct an empty set of light probe volumes.
LightProbeVolumes3DOptions getOptions() const noexcept
Get the configuration options of the light probe volume set.
Definition LightProbeVolumes3D.hpp:295
UniformBuffer< AtlasParameters, "LightProbeVolumes3DAtlases"> AtlasBuffer
Shader buffer for light probe volume atlases.
Definition LightProbeVolumes3D.hpp:105
void clearLightProbeVolumes() noexcept
Remove all light probe volumes from the set.
static constexpr TextureSamplerOptions IRRADIANCE_ATLAS_SAMPLER_OPTIONS
Sampler options to use for the irradiance atlas of light probe volumes.
Definition LightProbeVolumes3D.hpp:144
StorageBuffer< VolumeFields, "LightProbeVolumes3DVolumes"> VolumeBuffer
Shader buffer for light probe volumes.
Definition LightProbeVolumes3D.hpp:139
static constexpr TextureSamplerOptions DISTANCE_ATLAS_SAMPLER_OPTIONS
Sampler options to use for the distance atlas of light probe volumes.
Definition LightProbeVolumes3D.hpp:156
Backend-specific implementation of RenderPass.
Definition RenderPass.hpp:38
Persistent system that provides 3D rendering capabilities.
Definition Renderer3D.hpp:120
GPU memory buffer containing an array of structs to be read by a shader program.
Definition buffers.hpp:493
Storage for multidimensional data, such as 2D images, on the GPU, combined with a sampler configurati...
Definition Texture.hpp:700
Definition buffer_layouts.hpp:20
@ 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
qua< float > quat
Definition math.hpp:892
vec< 4, float > vec4
Definition math.hpp:440
vec< 3, uint32_t > u32vec3
Definition math.hpp:419
vec< 2, float > vec2
Definition math.hpp:438
vec< 3, float > vec3
Definition math.hpp:439
Configuration options for a light probe volume in a LightProbeVolumes3D set.
Definition LightProbeVolumes3D.hpp:28
uint32_t distanceMapResolution
Width, in texels, of each light probe's distance map in the distance atlas, including a 1 pixel borde...
Definition LightProbeVolumes3D.hpp:69
u32vec3 probeCounts
Number of light probes along each axis of the light probe volume.
Definition LightProbeVolumes3D.hpp:51
uint32_t irradianceMapResolution
Width, in texels, of each light probe's irradiance map in the irradiance atlas, including a 1 pixel b...
Definition LightProbeVolumes3D.hpp:60
vec3 probeSpacing
Local spacing between the light probes.
Definition LightProbeVolumes3D.hpp:44
vec3 center
Center position of the light probe volume in world space.
Definition LightProbeVolumes3D.hpp:32
quat orientation
Orientation of the light probe volume in world space.
Definition LightProbeVolumes3D.hpp:37
Configuration options for a LightProbeVolumes3D set.
Definition LightProbeVolumes3D.hpp:75
constexpr bool operator==(const LightProbeVolumes3DOptions &other) const noexcept=default
Compare these options to another set of options for equality.
Struct of shader parameters representing the light probe volume atlases.
Definition LightProbeVolumes3D.hpp:94
sampler2DArray lightProbeVolumesDistanceAtlasTexture
Sampler for the atlas of distance values for the light probe volumes.
Definition LightProbeVolumes3D.hpp:99
sampler2DArray lightProbeVolumesIrradianceAtlasTexture
Sampler for the atlas of irradiance values for the light probe volumes.
Definition LightProbeVolumes3D.hpp:96
Struct of shader fields representing a light probe volume.
Definition LightProbeVolumes3D.hpp:110
vec3 lightProbeVolumeProbeCounts
Number of probes along each coordinate axis in the light probe volume.
Definition LightProbeVolumes3D.hpp:121
vec4 lightProbeVolumeOrientation
Components of the quaternion representing the orientation of the light probe volume in world space.
Definition LightProbeVolumes3D.hpp:115
vec3 lightProbeVolumeProbeSpacing
Local spacing between the light probes.
Definition LightProbeVolumes3D.hpp:118
vec3 lightProbeVolumeCenter
Center position of the light probe volume in world space.
Definition LightProbeVolumes3D.hpp:112
vec3 lightProbeVolumeIrradianceAtlasOffset
Texture coordinate offset of the light probe volume in the atlas of irradiance values.
Definition LightProbeVolumes3D.hpp:124
vec2 lightProbeVolumeIrradianceAtlasPaddedProbeSizeAndTexelSize
Padded size of the probes in the irradiance map atlas (X), and the size of the texels (Y) in texture ...
Definition LightProbeVolumes3D.hpp:130
vec3 lightProbeVolumeDistanceAtlasOffset
Texture coordinate offset of the light probe volume in the atlas of distance values.
Definition LightProbeVolumes3D.hpp:127
vec2 lightProbeVolumeDistanceAtlasPaddedProbeSizeAndTexelSize
Padded size of the probes in the distance map atlas (X), and the size of the texels (Y) in texture co...
Definition LightProbeVolumes3D.hpp:133
Configuration options for the sampler of a Texture.
Definition Texture.hpp:617
Reference to a sampler2DArray Texture that may be used as a parameter value type in a shader-read buf...
Definition ParameterDescription.hpp:147