Nebula
Loading...
Searching...
No Matches
ddgicontext.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
10//------------------------------------------------------------------------------
11#include <gi/shaders/probe_finalize.h>
12#include <gi/shaders/probe_update.h>
13
15namespace GI
16{
17
19{
20 struct
21 {
22 uint scrolling : 1; // Infinitely scrolls based on camera position
23 uint classify : 1; // Enables/disables probes based on hits
24 uint relocate : 1; // Relocate probes to avoid them being stuck inside geometry
25 uint lowPrecisionTextures : 1; // Use more compact texture formats at the expense of quality
27 uint32 bits = 0x0;
28};
29
31{
33public:
38
40 static void Create();
42 static void Discard();
43
45 {
50
51 float normalBias = 0.1f;
52 float viewBias = 0.4f;
53 float irradianceScale = 1.0f;
54 float distanceExponent = 0.5f;
55 float encodingGamma = 5.0f;
56 float changeThreshold = 0.2f;
57 float brightnessThreshold = 2.0f;
58 float hysteresis = 0.97f;
59 float blendCutoff = 0.0f;
60 float blend = 0.0f;
61 float updateBudget = 1.0f;
62
64 };
65
67 static void SetupVolume(const Graphics::GraphicsEntityId id, const VolumeSetup& setup);
69 static void SetPosition(const Graphics::GraphicsEntityId id, const Math::vec3& position);
71 static void SetSize(const Graphics::GraphicsEntityId id, const Math::vec3& size);
72
74 static void UpdateActiveVolumes(const Ptr<Graphics::View>& view, const Graphics::FrameContext& ctx);
75
76#ifndef PUBLIC_BUILD
77 static void OnRenderDebug(uint32_t flags);
78#endif
79
80private:
81
115
116 typedef Ids::IdAllocator<
117 Volume
120
121
125 static void Dealloc(Graphics::ContextEntityId id);
126};
127
128} // namespace GI
Definition ddgicontext.h:31
static void UpdateActiveVolumes(const Ptr< Graphics::View > &view, const Graphics::FrameContext &ctx)
prepare light lists
Definition ddgicontext.cc:625
static void SetPosition(const Graphics::GraphicsEntityId id, const Math::vec3 &position)
Set volume position.
Definition ddgicontext.cc:601
Ids::IdAllocator< Volume > DDGIVolumeAllocator
Definition ddgicontext.h:118
static void SetSize(const Graphics::GraphicsEntityId id, const Math::vec3 &size)
Set volume scale.
Definition ddgicontext.cc:613
__DeclareContext() public ~DDGIContext()
Destructor.
Definition ddgicontext.cc:121
static void Dealloc(Graphics::ContextEntityId id)
deallocate a slice
Definition ddgicontext.cc:849
static void Create()
setup light context
Definition ddgicontext.cc:129
static void Discard()
discard light context
Definition ddgicontext.cc:433
static void SetupVolume(const Graphics::GraphicsEntityId id, const VolumeSetup &setup)
Create volume.
Definition ddgicontext.cc:442
static Graphics::ContextEntityId Alloc()
allocate a new slice for this context
Definition ddgicontext.cc:840
static void OnRenderDebug(uint32_t flags)
Definition ddgicontext.cc:815
static DDGIVolumeAllocator ddgiVolumeAllocator
Definition ddgicontext.h:119
Definition graphicscontext.h:165
An ID allocator associates an id with a slice in an N number of arrays.
Definition idallocator.h:39
Nebula's bounding box class.
Definition bbox.h:24
Nebula's smart pointer class which manages the life time of RefCounted objects.
Definition ptr.h:38
#define __DeclareContext()
Definition graphicscontext.h:44
The DDGI context is responsible for managing the GI volumes used to apply indirect light in the scene...
Definition ddgicontext.cc:42
Definition buffer.h:23
Definition resourcetable.h:95
texture type
Definition texture.h:25
Definition ddgicontext.h:83
Math::bbox boundingBox
Definition ddgicontext.h:88
CoreGraphics::TextureId scrollSpace
Definition ddgicontext.h:90
CoreGraphics::TextureId radiance
Definition ddgicontext.h:89
uint numProbesX
Definition ddgicontext.h:84
float distanceExponent
Definition ddgicontext.h:97
CoreGraphics::ResourceTableId updateProbesTable
Definition ddgicontext.h:92
CoreGraphics::TextureId offsets
Definition ddgicontext.h:90
uint numRaysPerProbe
Definition ddgicontext.h:85
float irradianceScale
Definition ddgicontext.h:96
float normalBias
Definition ddgicontext.h:94
CoreGraphics::BufferId volumeConstantBuffer
Definition ddgicontext.h:91
float blendCutoff
Definition ddgicontext.h:104
CoreGraphics::ResourceTableId debugResourceTable
Definition ddgicontext.h:111
CoreGraphics::TextureId states
Definition ddgicontext.h:90
uint numProbesZ
Definition ddgicontext.h:84
Math::vec3 size
Definition ddgicontext.h:86
float hysteresis
Definition ddgicontext.h:103
float viewBias
Definition ddgicontext.h:95
ProbeUpdate::VolumeConstants volumeConstants
Definition ddgicontext.h:107
CoreGraphics::ResourceTableId relocateProbesTable
Definition ddgicontext.h:92
CoreGraphics::TextureId distance
Definition ddgicontext.h:90
float brightnessThreshold
Definition ddgicontext.h:100
CoreGraphics::TextureId irradiance
Definition ddgicontext.h:90
float changeThreshold
Definition ddgicontext.h:99
float encodingGamma
Definition ddgicontext.h:98
float blend
Definition ddgicontext.h:105
Math::vec3 position
Definition ddgicontext.h:87
uint numProbesY
Definition ddgicontext.h:84
float minFrontfaceDistance
Definition ddgicontext.h:102
CoreGraphics::ResourceTableId blendProbesTable
Definition ddgicontext.h:92
DDGIOptions options
Definition ddgicontext.h:108
float backfaceThreshold
Definition ddgicontext.h:101
Definition ddgicontext.h:45
float hysteresis
Definition ddgicontext.h:58
float blend
Definition ddgicontext.h:60
float normalBias
Definition ddgicontext.h:51
float encodingGamma
Definition ddgicontext.h:55
float updateBudget
Definition ddgicontext.h:61
float brightnessThreshold
Definition ddgicontext.h:57
uint numProbesY
Definition ddgicontext.h:46
Math::vec3 position
Definition ddgicontext.h:49
uint numProbesZ
Definition ddgicontext.h:46
Math::vec3 size
Definition ddgicontext.h:48
float blendCutoff
Definition ddgicontext.h:59
uint numRaysPerProbe
Definition ddgicontext.h:47
float irradianceScale
Definition ddgicontext.h:53
float distanceExponent
Definition ddgicontext.h:54
uint numProbesX
Definition ddgicontext.h:46
DDGIOptions options
Definition ddgicontext.h:63
float viewBias
Definition ddgicontext.h:52
float changeThreshold
Definition ddgicontext.h:56
Definition graphicscontext.h:133
Definition graphicsserver.h:31
The graphics entity is only an Id, to which we can attach GraphicsContexts.
Definition graphicsentity.h:16
A 3D vector.
Definition vec3.h:40
unsigned int uint
Definition types.h:31
uint32_t uint32
Definition types.h:38
Definition ddgicontext.h:19
struct GI::DDGIOptions::@216165255272205226064354333337361232233070377325 flags
uint relocate
Definition ddgicontext.h:24
uint32 bits
Definition ddgicontext.h:27
uint scrolling
Definition ddgicontext.h:22
uint lowPrecisionTextures
Definition ddgicontext.h:25
uint classify
Definition ddgicontext.h:23