Nebula
Loading...
Searching...
No Matches
Fog::VolumetricFogContext Class Reference

#include <volumetricfogcontext.h>

Inherits Graphics::GraphicsContext.

Private Types

enum  FogVolumeType { BoxVolume , SphereVolume }
 
enum  { FogVolume_Type , FogVolume_TypedId , FogVolume_Turbidity , FogVolume_Absorption }
 
enum  { FogBoxVolume_Transform }
 
enum  { FogSphereVolume_Position , FogSphereVolume_Radius }
 
typedef Ids::IdAllocator< FogVolumeType, Ids::Id32, float, Math::vec3FogGenericVolumeAllocator
 
typedef Ids::IdAllocator< Math::mat4FogBoxVolumeAllocator
 
typedef Ids::IdAllocator< Math::vec3, float > FogSphereVolumeAllocator
 

Private Member Functions

virtual __DeclareContext() public ~VolumetricFogContext ()
 destructor
 
void SetGlobalTurbidity (float f)
 set global turbidity (fog density)
 
void SetGlobalAbsorption (const Math::vec3 &color)
 set the global fog absorption color
 

Static Private Member Functions

static void Create ()
 setup volumetric fog context
 
static void Discard ()
 discard volumetric fog context
 
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
 
static void SetBoxTransform (const Graphics::GraphicsEntityId id, const Math::mat4 &transform)
 set box transform
 
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
 
static void SetSpherePosition (const Graphics::GraphicsEntityId id, const Math::vec3 &position)
 set sphere position
 
static void SetSphereRadius (const Graphics::GraphicsEntityId id, const float radius)
 set sphere radius
 
static void SetTurbidity (const Graphics::GraphicsEntityId id, const float turbidity)
 set volume turbidity
 
static void SetAbsorption (const Graphics::GraphicsEntityId id, const Math::vec3 &absorption)
 set volume absorption
 
static void UpdateViewDependentResources (const Ptr< Graphics::View > &view, const Graphics::FrameContext &ctx)
 prepare light lists
 
static void RenderUI (const Graphics::FrameContext &ctx)
 render IMGUI
 
static Math::mat4 GetTransform (const Graphics::GraphicsEntityId id)
 get transform
 
static void SetTransform (const Graphics::GraphicsEntityId id, const Math::mat4 &mat)
 set transform
 
static Graphics::ContextEntityId Alloc ()
 allocate a new slice for this context
 
static void Dealloc (Graphics::ContextEntityId id)
 deallocate a slice
 

Static Private Attributes

static FogGenericVolumeAllocator fogGenericVolumeAllocator
 
static FogBoxVolumeAllocator fogBoxVolumeAllocator
 
static FogSphereVolumeAllocator fogSphereVolumeAllocator
 

Additional Inherited Members

- Public Member Functions inherited from Graphics::GraphicsContext
 GraphicsContext ()
 constructor
 
virtual ~GraphicsContext ()
 destructor
 
- Static Protected Member Functions inherited from Graphics::GraphicsContext
static void InternalRegisterEntity (const Graphics::GraphicsEntityId id, Graphics::GraphicsContextState &&state)
 
static void InternalDeregisterEntity (const Graphics::GraphicsEntityId id, Graphics::GraphicsContextState &&state)
 
template<class ID_ALLOCATOR >
static void InternalDefragment (ID_ALLOCATOR &allocator, Graphics::GraphicsContextState &&state)
 

Member Typedef Documentation

◆ FogBoxVolumeAllocator

◆ FogGenericVolumeAllocator

◆ FogSphereVolumeAllocator

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
FogVolume_Type 
FogVolume_TypedId 
FogVolume_Turbidity 
FogVolume_Absorption 

◆ anonymous enum

anonymous enum
private
Enumerator
FogBoxVolume_Transform 

◆ anonymous enum

anonymous enum
private
Enumerator
FogSphereVolume_Position 
FogSphereVolume_Radius 

◆ FogVolumeType

Enumerator
BoxVolume 
SphereVolume 

Constructor & Destructor Documentation

◆ ~VolumetricFogContext()

Fog::VolumetricFogContext::~VolumetricFogContext ( )
privatevirtual

destructor

Member Function Documentation

◆ Alloc()

Graphics::ContextEntityId Fog::VolumetricFogContext::Alloc ( )
staticprivate

allocate a new slice for this context

◆ Create()

void Fog::VolumetricFogContext::Create ( )
staticprivate

setup volumetric fog context

◆ Dealloc()

void Fog::VolumetricFogContext::Dealloc ( Graphics::ContextEntityId id)
staticprivate

deallocate a slice

◆ Discard()

void Fog::VolumetricFogContext::Discard ( )
staticprivate

discard volumetric fog context

◆ GetTransform()

Math::mat4 Fog::VolumetricFogContext::GetTransform ( const Graphics::GraphicsEntityId id)
staticprivate

get transform

◆ RenderUI()

void Fog::VolumetricFogContext::RenderUI ( const Graphics::FrameContext & ctx)
staticprivate

render IMGUI

◆ SetAbsorption()

void Fog::VolumetricFogContext::SetAbsorption ( const Graphics::GraphicsEntityId id,
const Math::vec3 & absorption )
staticprivate

set volume absorption

◆ SetBoxTransform()

void Fog::VolumetricFogContext::SetBoxTransform ( const Graphics::GraphicsEntityId id,
const Math::mat4 & transform )
staticprivate

set box transform

◆ SetGlobalAbsorption()

void Fog::VolumetricFogContext::SetGlobalAbsorption ( const Math::vec3 & color)
private

set the global fog absorption color

◆ SetGlobalTurbidity()

void Fog::VolumetricFogContext::SetGlobalTurbidity ( float f)
private

set global turbidity (fog density)

◆ SetSpherePosition()

void Fog::VolumetricFogContext::SetSpherePosition ( const Graphics::GraphicsEntityId id,
const Math::vec3 & position )
staticprivate

set sphere position

◆ SetSphereRadius()

void Fog::VolumetricFogContext::SetSphereRadius ( const Graphics::GraphicsEntityId id,
const float radius )
staticprivate

set sphere radius

◆ SetTransform()

void Fog::VolumetricFogContext::SetTransform ( const Graphics::GraphicsEntityId id,
const Math::mat4 & mat )
staticprivate

set transform

◆ SetTurbidity()

void Fog::VolumetricFogContext::SetTurbidity ( const Graphics::GraphicsEntityId id,
const float turbidity )
staticprivate

set volume turbidity

◆ SetupBoxVolume()

void Fog::VolumetricFogContext::SetupBoxVolume ( const Graphics::GraphicsEntityId id,
const Math::mat4 & transform,
const float density,
const Math::vec3 & absorption )
staticprivate

setup a new volume as a box

◆ SetupSphereVolume()

void Fog::VolumetricFogContext::SetupSphereVolume ( const Graphics::GraphicsEntityId id,
const Math::vec3 & position,
float radius,
const float density,
const Math::vec3 & absorption )
staticprivate

setup a new volume as a sphere

◆ UpdateViewDependentResources()

void Fog::VolumetricFogContext::UpdateViewDependentResources ( const Ptr< Graphics::View > & view,
const Graphics::FrameContext & ctx )
staticprivate

prepare light lists

Member Data Documentation

◆ fogBoxVolumeAllocator

VolumetricFogContext::FogBoxVolumeAllocator Fog::VolumetricFogContext::fogBoxVolumeAllocator
staticprivate

◆ fogGenericVolumeAllocator

VolumetricFogContext::FogGenericVolumeAllocator Fog::VolumetricFogContext::fogGenericVolumeAllocator
staticprivate

◆ fogSphereVolumeAllocator

VolumetricFogContext::FogSphereVolumeAllocator Fog::VolumetricFogContext::fogSphereVolumeAllocator
staticprivate

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