Nebula
Loading...
Searching...
No Matches
Graphics Namespace Reference

Detailed Description

Implements the shader server used by Vulkan.

Classes

struct  BindlessRegistryCreateInfo
 
class  CameraContext
 Handles cameras. More...
 
class  CameraSettings
 
struct  ContextEntityId
 
class  EnvironmentContext
 The environment context deals with anything related to the sky and atmosphere effects. More...
 
struct  FrameContext
 
struct  GlobalConstantsCreateInfo
 
class  GraphicsContext
 
struct  GraphicsContextFunctionBundle
 
struct  GraphicsContextState
 A graphics context is a resource which holds a contextual representation for a graphics entity. More...
 
struct  GraphicsEntityId
 The graphics entity is only an Id, to which we can attach GraphicsContexts. More...
 
class  GraphicsServer
 The graphics server is the main singleton for the Graphics subsystem. More...
 
class  LightProbeContext
 Adds a light probe component to graphics entities. More...
 
class  Stage
 A stage contains a list of graphics entities, which can be rendered through a View. More...
 
class  View
 A view describes a camera which can observe a Stage. More...
 

Typedefs

typedef uint32_t BindlessIndex
 
using ViewIndependentCall = void(*)(const Graphics::FrameContext& ctx)
 
using ViewDependentCall = void(*)(const Ptr<Graphics::View>& view, const Graphics::FrameContext& ctx)
 

Functions

void CreateBindlessRegistry (const BindlessRegistryCreateInfo &info)
 Create bindless registry.
 
void DestroyBindlessRegistry ()
 Destroy bindless registry.
 
BindlessIndex RegisterTexture (const CoreGraphics::TextureId &tex, CoreGraphics::TextureType type, bool depth=false, bool stencil=false)
 Register texture.
 
void ReregisterTexture (const CoreGraphics::TextureId &tex, CoreGraphics::TextureType type, BindlessIndex id, bool depth=false, bool stencil=false)
 Reregister texture on the same slot.
 
void UnregisterTexture (const BindlessIndex id, const CoreGraphics::TextureType type)
 Unregister texture.
 
 __ImplementContext (CameraContext, CameraContext::cameraAllocator)
 
 __ImplementPluginContext (EnvironmentContext)
 
Math::vec4 CalculateZenithLuminanceYxy (float t, float thetaS)
 
void CalculatePerezDistribution (float t, Math::vec4 &A, Math::vec4 &B, Math::vec4 &C, Math::vec4 &D, Math::vec4 &E)
 
void CreateGlobalConstants (const GlobalConstantsCreateInfo &info)
 Create global constants.
 
void DestroyGlobalConstants ()
 Destroy global constants.
 
void AllocateGlobalConstants ()
 Run when starting frame.
 
void UpdateTickParams (const Shared::PerTickParams &tickParams)
 Set tick params.
 
void UpdateViewConstants (const Shared::ViewConstants &viewConstants)
 Set view params.
 
void UpdateShadowConstants (const Shared::ShadowViewConstants &shadowViewConstants)
 Set camera params.
 
void FlushUpdates (const CoreGraphics::CmdBufferId buf, const CoreGraphics::QueueType queue)
 Flush constants by recording update command to command buffer.
 
void GetOffsets (IndexT &tickOffset, IndexT &viewOffset, IndexT &shadowOffset)
 Get frame constant offsets.
 
const Shared::PerTickParams & GetTickParams ()
 Get tick params constant buffer.
 
const Shared::ViewConstants & GetViewConstants ()
 Get current view constants.
 
const Shared::ShadowViewConstants & GetShadowViewConstants ()
 Get current shadow view constnats.
 
void SetGlobalEnvironmentTextures (const CoreGraphics::TextureId &env, const CoreGraphics::TextureId &irr, const SizeT numMips)
 Set global irradiance and cubemaps.
 
void SetupBufferConstants ()
 Setup gbuffer bindings.
 
const CoreGraphics::ResourceTableId GetFrameResourceTable (uint32_t bufferIndex)
 Get per-tick resource table for graphics.
 
const CoreGraphics::ResourceTableId GetTickResourceTable (uint32_t bufferIndex)
 Get per-tick resource table for graphics.
 
 __ImplementClass (Graphics::GraphicsServer, 'GFXS', Core::RefCounted)
 
 __ImplementSingleton (Graphics::GraphicsServer)
 
static GraphicsEntityId CreateEntity ()
 
static void DestroyEntity (const GraphicsEntityId id)
 
template<typename ... CONTEXTS>
static void RegisterEntity (const GraphicsEntityId id)
 
template<typename ... CONTEXTS>
static void DeregisterEntity (const GraphicsEntityId id)
 
 __ImplementClass (Graphics::Stage, 'STAG', Core::RefCounted)
 
 __ImplementClass (Graphics::View, 'VIEW', Core::RefCounted)
 
 __ImplementContext (LightProbeContext, LightProbeContext::lightProbeAllocator)
 

Variables

struct { 
 
   Util::FixedPool< uint32_t >   Graphics::texturePool 
 
   Threading::CriticalSection   Graphics::bindResourceCriticalSection 
 
state 
 
struct { 
 
   Graphics::GraphicsEntityId   Graphics::skyBoxEntity 
 
   Graphics::GraphicsEntityId   Graphics::sunEntity 
 
   Math::vec4   Graphics::bloomColor 
 
   float   Graphics::bloomIntensity 
 
   float   Graphics::maxEyeLuminance 
 
   Math::vec4   Graphics::fogColor 
 
   float   Graphics::fogDistances [2] 
 
   int   Graphics::numGlobalEnvironmentMips 
 
   float   Graphics::saturation 
 
   float   Graphics::fadeValue 
 
   float   Graphics::skyTurbidity 
 
   CoreGraphics::TextureId   Graphics::defaultEnvironmentMap 
 
   CoreGraphics::TextureId   Graphics::defaultIrradianceMap 
 
   Core::CVar *   Graphics::r_show_env_params 
 
envState 
 

Typedef Documentation

◆ BindlessIndex

typedef uint32_t Graphics::BindlessIndex

◆ ViewDependentCall

using Graphics::ViewDependentCall = void(*)(const Ptr<Graphics::View>& view, const Graphics::FrameContext& ctx)

◆ ViewIndependentCall

Function Documentation

◆ __ImplementClass() [1/3]

Graphics::__ImplementClass ( Graphics::GraphicsServer ,
'GFXS' ,
Core::RefCounted  )

◆ __ImplementClass() [2/3]

Graphics::__ImplementClass ( Graphics::Stage ,
'STAG' ,
Core::RefCounted  )

◆ __ImplementClass() [3/3]

Graphics::__ImplementClass ( Graphics::View ,
'VIEW' ,
Core::RefCounted  )

◆ __ImplementContext() [1/2]

Graphics::__ImplementContext ( CameraContext ,
CameraContext::cameraAllocator  )

◆ __ImplementContext() [2/2]

Graphics::__ImplementContext ( LightProbeContext ,
LightProbeContext::lightProbeAllocator  )

◆ __ImplementPluginContext()

Graphics::__ImplementPluginContext ( EnvironmentContext )

◆ __ImplementSingleton()

Graphics::__ImplementSingleton ( Graphics::GraphicsServer )

◆ AllocateGlobalConstants()

void Graphics::AllocateGlobalConstants ( )

Run when starting frame.

◆ CalculatePerezDistribution()

void Graphics::CalculatePerezDistribution ( float t,
Math::vec4 & A,
Math::vec4 & B,
Math::vec4 & C,
Math::vec4 & D,
Math::vec4 & E )

◆ CalculateZenithLuminanceYxy()

Math::vec4 Graphics::CalculateZenithLuminanceYxy ( float t,
float thetaS )

◆ CreateBindlessRegistry()

void Graphics::CreateBindlessRegistry ( const BindlessRegistryCreateInfo & info)

Create bindless registry.

◆ CreateEntity()

static GraphicsEntityId Graphics::CreateEntity ( )
static

◆ CreateGlobalConstants()

void Graphics::CreateGlobalConstants ( const GlobalConstantsCreateInfo & info)

Create global constants.

◆ DeregisterEntity()

template<typename ... CONTEXTS>
static void Graphics::DeregisterEntity ( const GraphicsEntityId id)
static

◆ DestroyBindlessRegistry()

void Graphics::DestroyBindlessRegistry ( )

Destroy bindless registry.

◆ DestroyEntity()

static void Graphics::DestroyEntity ( const GraphicsEntityId id)
static

◆ DestroyGlobalConstants()

void Graphics::DestroyGlobalConstants ( )

Destroy global constants.

◆ FlushUpdates()

void Graphics::FlushUpdates ( const CoreGraphics::CmdBufferId buf,
const CoreGraphics::QueueType queue )

Flush constants by recording update command to command buffer.

◆ GetFrameResourceTable()

const CoreGraphics::ResourceTableId Graphics::GetFrameResourceTable ( uint32_t bufferIndex)

Get per-tick resource table for graphics.

◆ GetOffsets()

void Graphics::GetOffsets ( IndexT & tickOffset,
IndexT & viewOffset,
IndexT & shadowOffset )

Get frame constant offsets.

◆ GetShadowViewConstants()

const Shared::ShadowViewConstants & Graphics::GetShadowViewConstants ( )

Get current shadow view constnats.

◆ GetTickParams()

const Shared::PerTickParams & Graphics::GetTickParams ( )

Get tick params constant buffer.

◆ GetTickResourceTable()

const CoreGraphics::ResourceTableId Graphics::GetTickResourceTable ( uint32_t bufferIndex)

Get per-tick resource table for graphics.

◆ GetViewConstants()

const Shared::ViewConstants & Graphics::GetViewConstants ( )

Get current view constants.

◆ RegisterEntity()

template<typename ... CONTEXTS>
static void Graphics::RegisterEntity ( const GraphicsEntityId id)
static

◆ RegisterTexture()

BindlessIndex Graphics::RegisterTexture ( const CoreGraphics::TextureId & tex,
CoreGraphics::TextureType type,
bool depth,
bool stencil )

Register texture.

◆ ReregisterTexture()

void Graphics::ReregisterTexture ( const CoreGraphics::TextureId & tex,
CoreGraphics::TextureType type,
BindlessIndex index,
bool depth,
bool stencil )

Reregister texture on the same slot.

◆ SetGlobalEnvironmentTextures()

void Graphics::SetGlobalEnvironmentTextures ( const CoreGraphics::TextureId & env,
const CoreGraphics::TextureId & irr,
const SizeT numMips )

Set global irradiance and cubemaps.

◆ SetupBufferConstants()

void Graphics::SetupBufferConstants ( )

Setup gbuffer bindings.

◆ UnregisterTexture()

void Graphics::UnregisterTexture ( const BindlessIndex id,
const CoreGraphics::TextureType type )

Unregister texture.

◆ UpdateShadowConstants()

void Graphics::UpdateShadowConstants ( const Shared::ShadowViewConstants & shadowViewConstants)

Set camera params.

◆ UpdateTickParams()

void Graphics::UpdateTickParams ( const Shared::PerTickParams & tickParams)

Set tick params.

◆ UpdateViewConstants()

void Graphics::UpdateViewConstants ( const Shared::ViewConstants & viewConstants)

Set view params.

Variable Documentation

◆ bindResourceCriticalSection

Threading::CriticalSection Graphics::bindResourceCriticalSection

◆ bits

int Graphics::bits

◆ bloomColor

Math::vec4 Graphics::bloomColor

◆ bloomIntensity

float Graphics::bloomIntensity

◆ computeDirty

bool Graphics::computeDirty

◆ defaultEnvironmentMap

CoreGraphics::TextureId Graphics::defaultEnvironmentMap

◆ defaultIrradianceMap

CoreGraphics::TextureId Graphics::defaultIrradianceMap

◆ [struct]

struct { ... } Graphics::envState

◆ fadeValue

float Graphics::fadeValue

◆ fogColor

Math::vec4 Graphics::fogColor

◆ fogDistances

float Graphics::fogDistances[2]

◆ frameResourceTables

Util::FixedArray<CoreGraphics::ResourceTableId> Graphics::frameResourceTables

◆ graphicsDirty

bool Graphics::graphicsDirty

◆ maxEyeLuminance

float Graphics::maxEyeLuminance

◆ numGlobalEnvironmentMips

int Graphics::numGlobalEnvironmentMips

◆ r_show_env_params

Core::CVar* Graphics::r_show_env_params

◆ saturation

float Graphics::saturation

◆ shadowViewCboOffset

IndexT Graphics::shadowViewCboOffset

◆ shadowViewConstants

Shared::ShadowViewConstants Graphics::shadowViewConstants

◆ shadowViewConstantsDirty

DirtySet Graphics::shadowViewConstantsDirty

◆ skyBoxEntity

Graphics::GraphicsEntityId Graphics::skyBoxEntity

◆ skyTurbidity

float Graphics::skyTurbidity

◆ [struct]

struct { ... } Graphics::state

◆ sunEntity

Graphics::GraphicsEntityId Graphics::sunEntity

◆ tableLayout

CoreGraphics::ResourcePipelineId Graphics::tableLayout

◆ texturePool

Util::FixedPool<uint32_t> Graphics::texturePool

◆ tickCboOffset

IndexT Graphics::tickCboOffset

◆ tickParams

Shared::PerTickParams Graphics::tickParams

◆ tickParamsDirty

DirtySet Graphics::tickParamsDirty

◆ tickResourceTables

Util::FixedArray<CoreGraphics::ResourceTableId> Graphics::tickResourceTables

◆ viewCboOffset

IndexT Graphics::viewCboOffset

◆ viewConstants

Shared::ViewConstants Graphics::viewConstants

◆ viewConstantsDirty

DirtySet Graphics::viewConstantsDirty