Nebula
Loading...
Searching...
No Matches
volumetricfogcontext.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
14//------------------------------------------------------------------------------
16namespace Frame
17{
18class FrameScript;
19};
20
21namespace Fog
22{
23
25{
27public:
28
32 virtual ~VolumetricFogContext();
33
35 static void Create();
37 static void Discard();
38
40 static void SetupBoxVolume(
42 const Math::mat4& transform,
43 const float density,
44 const Math::vec3& absorption);
46 static void SetBoxTransform(const Graphics::GraphicsEntityId id, const Math::mat4& transform);
47
48
50 static void SetupSphereVolume(
52 const Math::vec3& position,
53 float radius,
54 const float density,
55 const Math::vec3& absorption);
57 static void SetSpherePosition(const Graphics::GraphicsEntityId id, const Math::vec3& position);
59 static void SetSphereRadius(const Graphics::GraphicsEntityId id, const float radius);
60
62 static void SetTurbidity(const Graphics::GraphicsEntityId id, const float turbidity);
64 static void SetAbsorption(const Graphics::GraphicsEntityId id, const Math::vec3& absorption);
65
69 static void RenderUI(const Graphics::FrameContext& ctx);
70
72 void SetGlobalTurbidity(float f);
75
79 static void SetTransform(const Graphics::GraphicsEntityId id, const Math::mat4& mat);
80
81private:
82
88 enum
89 {
94 };
95 typedef Ids::IdAllocator<
98 float,
102
103 enum
104 {
106 };
107 typedef Ids::IdAllocator<
111
112 enum
113 {
116 };
117 typedef Ids::IdAllocator<
119 float
122
126 static void Dealloc(Graphics::ContextEntityId id);
127};
128
129} // namespace Fog
Definition volumetricfogcontext.h:25
@ FogBoxVolume_Transform
Definition volumetricfogcontext.h:105
static FogBoxVolumeAllocator fogBoxVolumeAllocator
Definition volumetricfogcontext.h:110
static void SetTransform(const Graphics::GraphicsEntityId id, const Math::mat4 &mat)
set transform
Definition volumetricfogcontext.cc:488
static void SetTurbidity(const Graphics::GraphicsEntityId id, const float turbidity)
set volume turbidity
Definition volumetricfogcontext.cc:318
static Math::mat4 GetTransform(const Graphics::GraphicsEntityId id)
get transform
Definition volumetricfogcontext.cc:469
static void Dealloc(Graphics::ContextEntityId id)
deallocate a slice
Definition volumetricfogcontext.cc:515
static void UpdateViewDependentResources(const Ptr< Graphics::View > &view, const Graphics::FrameContext &ctx)
prepare light lists
Definition volumetricfogcontext.cc:338
static void SetAbsorption(const Graphics::GraphicsEntityId id, const Math::vec3 &absorption)
set volume absorption
Definition volumetricfogcontext.cc:328
void SetGlobalTurbidity(float f)
set global turbidity (fog density)
Definition volumetricfogcontext.cc:451
@ FogSphereVolume_Position
Definition volumetricfogcontext.h:114
@ FogSphereVolume_Radius
Definition volumetricfogcontext.h:115
static void SetSpherePosition(const Graphics::GraphicsEntityId id, const Math::vec3 &position)
set sphere position
Definition volumetricfogcontext.cc:292
virtual __DeclareContext() public ~VolumetricFogContext()
destructor
Definition volumetricfogcontext.cc:70
Ids::IdAllocator< Math::vec3, float > FogSphereVolumeAllocator
Definition volumetricfogcontext.h:120
static void Discard()
discard volumetric fog context
Definition volumetricfogcontext.cc:229
static void SetSphereRadius(const Graphics::GraphicsEntityId id, const float radius)
set sphere radius
Definition volumetricfogcontext.cc:305
static void SetupSphereVolume(const Graphics::GraphicsEntityId id, const Math::vec3 &position, float radius, const float density, const Math::vec3 &absorption)
setup a new volume as a sphere
Definition volumetricfogcontext.cc:270
static FogSphereVolumeAllocator fogSphereVolumeAllocator
Definition volumetricfogcontext.h:121
Ids::IdAllocator< Math::mat4 > FogBoxVolumeAllocator
Definition volumetricfogcontext.h:109
static void SetupBoxVolume(const Graphics::GraphicsEntityId id, const Math::mat4 &transform, const float density, const Math::vec3 &absorption)
setup a new volume as a box
Definition volumetricfogcontext.cc:237
static FogGenericVolumeAllocator fogGenericVolumeAllocator
Definition volumetricfogcontext.h:101
FogVolumeType
Definition volumetricfogcontext.h:84
@ SphereVolume
Definition volumetricfogcontext.h:86
@ BoxVolume
Definition volumetricfogcontext.h:85
static void RenderUI(const Graphics::FrameContext &ctx)
render IMGUI
Definition volumetricfogcontext.cc:427
@ FogVolume_TypedId
Definition volumetricfogcontext.h:91
@ FogVolume_Type
Definition volumetricfogcontext.h:90
@ FogVolume_Turbidity
Definition volumetricfogcontext.h:92
@ FogVolume_Absorption
Definition volumetricfogcontext.h:93
static void Create()
setup volumetric fog context
Definition volumetricfogcontext.cc:79
void SetGlobalAbsorption(const Math::vec3 &color)
set the global fog absorption color
Definition volumetricfogcontext.cc:460
static void SetBoxTransform(const Graphics::GraphicsEntityId id, const Math::mat4 &transform)
set box transform
Definition volumetricfogcontext.cc:257
static Graphics::ContextEntityId Alloc()
allocate a new slice for this context
Definition volumetricfogcontext.cc:506
Ids::IdAllocator< FogVolumeType, Ids::Id32, float, Math::vec3 > FogGenericVolumeAllocator
Definition volumetricfogcontext.h:100
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 smart pointer class which manages the life time of RefCounted objects.
Definition ptr.h:38
#define __DeclareContext()
Definition graphicscontext.h:44
Definition volumetricfogcontext.cc:21
float turbidity
Definition volumetricfogcontext.cc:40
Math::vec3 color
Definition volumetricfogcontext.cc:41
ImGUI debug interface for inspecting frame scripts.
Definition shaderserverbase.h:52
uint32_t Id32
Definition id.h:138
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 4x4 single point precision float matrix.
Definition mat4.h:49
A 3D vector.
Definition vec3.h:40