Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
Divide::PreRenderBatch Class Reference

#include <PreRenderBatch.h>

Classes

struct  HDRTargets
 
struct  LDRTargets
 
struct  ScreenTargets
 

Public Types

enum class  EdgeDetectionMethod : U8 { Depth = 0 , Luma , Colour , COUNT }
 

Public Member Functions

 PreRenderBatch (GFXDevice &context, PostFX &parent)
 
 ~PreRenderBatch ()
 
PostFXparent () const noexcept
 
void update (U64 deltaTimeUS) noexcept
 
void prePass (PlayerIndex idx, const CameraSnapshot &cameraSnapshot, U32 filterStack, GFX::CommandBuffer &bufferInOut)
 
void execute (PlayerIndex idx, const CameraSnapshot &cameraSnapshot, U32 filterStack, GFX::CommandBuffer &bufferInOut)
 
void reshape (U16 width, U16 height)
 
void onFilterToggle (FilterType filter, bool state)
 
RenderTargetHandle getInput (bool hdr) const
 
RenderTargetHandle getOutput (bool hdr) const
 
RenderTargetHandle screenRT () const noexcept
 
RenderTargetHandle edgesRT () const noexcept
 
Handle< TextureluminanceTex () const noexcept
 
PreRenderOperatorgetOperator (FilterType type) const
 
void toneMapParams (ToneMapParams params) noexcept
 
void adaptiveExposureControl (bool state) noexcept
 
F32 adaptiveExposureValue () const noexcept
 
RenderTargetHandle getLinearDepthRT () const noexcept
 
 PROPERTY_R (bool, adaptiveExposureControl, true)
 
 PROPERTY_R (ToneMapParams, toneMapParams)
 
 PROPERTY_RW (F32, edgeDetectionThreshold, 0.1f)
 
 PROPERTY_RW (EdgeDetectionMethod, edgeDetectionMethod, EdgeDetectionMethod::Luma)
 
 PROPERTY_R (SamplerDescriptor, lumaSampler)
 

Private Types

using OperatorBatch = vector< PreRenderOperator_uptr >
 

Private Member Functions

bool operatorsReady () const noexcept
 
RenderTargetHandle getTarget (bool hdr, bool swapped) const noexcept
 

Static Private Member Functions

static FilterSpace GetOperatorSpace (const FilterType type) noexcept
 

Private Attributes

GFXDevice_context
 
PostFX_parent
 
std::array< OperatorBatch, to_base(FilterSpace::COUNT)> _operators
 
std::array< Handle< ShaderProgram >, to_base(EdgeDetectionMethod::COUNT)> _edgeDetection {}
 
std::array< Pipeline *, to_base(EdgeDetectionMethod::COUNT)> _edgeDetectionPipelines {}
 
ScreenTargets _screenRTs {}
 
ShaderBuffer_uptr _histogramBuffer { nullptr }
 
Handle< Texture_currentLuminance { INVALID_HANDLE<Texture> }
 
Handle< ShaderProgram_toneMap { INVALID_HANDLE<ShaderProgram> }
 
Handle< ShaderProgram_toneMapAdaptive { INVALID_HANDLE<ShaderProgram> }
 
Handle< ShaderProgram_createHistogram { INVALID_HANDLE<ShaderProgram> }
 
Handle< ShaderProgram_averageHistogram { INVALID_HANDLE<ShaderProgram> }
 
Handle< ShaderProgram_lineariseDepthBuffer { INVALID_HANDLE<ShaderProgram> }
 
Pipeline_pipelineLumCalcHistogram { nullptr }
 
Pipeline_pipelineLumCalcAverage { nullptr }
 
Pipeline_pipelineToneMap { nullptr }
 
Pipeline_pipelineToneMapAdaptive { nullptr }
 
U64 _lastDeltaTimeUS { 0u }
 
RenderTargetHandle _sceneEdges {}
 
RenderTargetHandle _linearDepthRT {}
 
F32 _adaptiveExposureValue {1.f}
 
bool _adaptiveExposureValueNeedsUpdate {false}
 

Detailed Description

Definition at line 83 of file PreRenderBatch.h.

Member Typedef Documentation

◆ OperatorBatch

using Divide::PreRenderBatch::OperatorBatch = vector<PreRenderOperator_uptr>
private

Definition at line 101 of file PreRenderBatch.h.

Member Enumeration Documentation

◆ EdgeDetectionMethod

Enumerator
Depth 
Luma 
Colour 
COUNT 

Definition at line 105 of file PreRenderBatch.h.

Constructor & Destructor Documentation

◆ PreRenderBatch()

Divide::PreRenderBatch::PreRenderBatch ( GFXDevice context,
PostFX parent 
)

Definition at line 48 of file PreRenderBatch.cpp.

◆ ~PreRenderBatch()

Divide::PreRenderBatch::~PreRenderBatch ( )

Definition at line 410 of file PreRenderBatch.cpp.

Member Function Documentation

◆ adaptiveExposureControl()

void Divide::PreRenderBatch::adaptiveExposureControl ( bool  state)
noexcept

Definition at line 463 of file PreRenderBatch.cpp.

◆ adaptiveExposureValue()

F32 Divide::PreRenderBatch::adaptiveExposureValue ( ) const
noexcept

Definition at line 469 of file PreRenderBatch.cpp.

◆ edgesRT()

RenderTargetHandle Divide::PreRenderBatch::edgesRT ( ) const
inlinenoexcept

Definition at line 62 of file PreRenderBatch.inl.

◆ execute()

void Divide::PreRenderBatch::execute ( PlayerIndex  idx,
const CameraSnapshot cameraSnapshot,
U32  filterStack,
GFX::CommandBuffer bufferInOut 
)

Definition at line 573 of file PreRenderBatch.cpp.

◆ getInput()

RenderTargetHandle Divide::PreRenderBatch::getInput ( bool  hdr) const
inline

Definition at line 50 of file PreRenderBatch.inl.

◆ getLinearDepthRT()

RenderTargetHandle Divide::PreRenderBatch::getLinearDepthRT ( ) const
inlinenoexcept

Definition at line 38 of file PreRenderBatch.inl.

◆ getOperator()

PreRenderOperator * Divide::PreRenderBatch::getOperator ( FilterType  type) const

Definition at line 445 of file PreRenderBatch.cpp.

◆ GetOperatorSpace()

static FilterSpace Divide::PreRenderBatch::GetOperatorSpace ( const FilterType  type)
inlinestaticprivatenoexcept

Definition at line 150 of file PreRenderBatch.h.

◆ getOutput()

RenderTargetHandle Divide::PreRenderBatch::getOutput ( bool  hdr) const
inline

Definition at line 54 of file PreRenderBatch.inl.

◆ getTarget()

RenderTargetHandle Divide::PreRenderBatch::getTarget ( bool  hdr,
bool  swapped 
) const
inlineprivatenoexcept

Definition at line 42 of file PreRenderBatch.inl.

◆ luminanceTex()

Handle< Texture > Divide::PreRenderBatch::luminanceTex ( ) const
inlinenoexcept

Definition at line 66 of file PreRenderBatch.inl.

◆ onFilterToggle()

void Divide::PreRenderBatch::onFilterToggle ( FilterType  filter,
bool  state 
)

Definition at line 490 of file PreRenderBatch.cpp.

◆ operatorsReady()

bool Divide::PreRenderBatch::operatorsReady ( ) const
privatenoexcept

Definition at line 433 of file PreRenderBatch.cpp.

◆ parent()

PostFX & Divide::PreRenderBatch::parent ( ) const
inlinenoexcept

Definition at line 116 of file PreRenderBatch.h.

◆ prePass()

void Divide::PreRenderBatch::prePass ( PlayerIndex  idx,
const CameraSnapshot cameraSnapshot,
U32  filterStack,
GFX::CommandBuffer bufferInOut 
)

Definition at line 500 of file PreRenderBatch.cpp.

◆ PROPERTY_R() [1/3]

Divide::PreRenderBatch::PROPERTY_R ( bool  ,
adaptiveExposureControl  ,
true   
)

◆ PROPERTY_R() [2/3]

Divide::PreRenderBatch::PROPERTY_R ( SamplerDescriptor  ,
lumaSampler   
)

◆ PROPERTY_R() [3/3]

Divide::PreRenderBatch::PROPERTY_R ( ToneMapParams  ,
toneMapParams   
)

◆ PROPERTY_RW() [1/2]

Divide::PreRenderBatch::PROPERTY_RW ( EdgeDetectionMethod  ,
edgeDetectionMethod  ,
EdgeDetectionMethod::Luma   
)

◆ PROPERTY_RW() [2/2]

Divide::PreRenderBatch::PROPERTY_RW ( F32  ,
edgeDetectionThreshold  ,
0.  1f 
)

◆ reshape()

void Divide::PreRenderBatch::reshape ( U16  width,
U16  height 
)

Definition at line 880 of file PreRenderBatch.cpp.

◆ screenRT()

RenderTargetHandle Divide::PreRenderBatch::screenRT ( ) const
inlinenoexcept

Definition at line 58 of file PreRenderBatch.inl.

◆ toneMapParams()

void Divide::PreRenderBatch::toneMapParams ( ToneMapParams  params)
noexcept

Definition at line 475 of file PreRenderBatch.cpp.

◆ update()

void Divide::PreRenderBatch::update ( U64  deltaTimeUS)
noexcept

Definition at line 486 of file PreRenderBatch.cpp.

Member Data Documentation

◆ _adaptiveExposureValue

F32 Divide::PreRenderBatch::_adaptiveExposureValue {1.f}
private

Definition at line 199 of file PreRenderBatch.h.

◆ _adaptiveExposureValueNeedsUpdate

bool Divide::PreRenderBatch::_adaptiveExposureValueNeedsUpdate {false}
mutableprivate

Definition at line 200 of file PreRenderBatch.h.

◆ _averageHistogram

Handle<ShaderProgram> Divide::PreRenderBatch::_averageHistogram { INVALID_HANDLE<ShaderProgram> }
private

Definition at line 187 of file PreRenderBatch.h.

◆ _context

GFXDevice& Divide::PreRenderBatch::_context
private

Definition at line 174 of file PreRenderBatch.h.

◆ _createHistogram

Handle<ShaderProgram> Divide::PreRenderBatch::_createHistogram { INVALID_HANDLE<ShaderProgram> }
private

Definition at line 186 of file PreRenderBatch.h.

◆ _currentLuminance

Handle<Texture> Divide::PreRenderBatch::_currentLuminance { INVALID_HANDLE<Texture> }
private

Definition at line 183 of file PreRenderBatch.h.

◆ _edgeDetection

std::array<Handle<ShaderProgram>, to_base(EdgeDetectionMethod::COUNT)> Divide::PreRenderBatch::_edgeDetection {}
private

Definition at line 178 of file PreRenderBatch.h.

◆ _edgeDetectionPipelines

std::array<Pipeline*, to_base(EdgeDetectionMethod::COUNT)> Divide::PreRenderBatch::_edgeDetectionPipelines {}
private

Definition at line 179 of file PreRenderBatch.h.

◆ _histogramBuffer

ShaderBuffer_uptr Divide::PreRenderBatch::_histogramBuffer { nullptr }
private

Definition at line 182 of file PreRenderBatch.h.

◆ _lastDeltaTimeUS

U64 Divide::PreRenderBatch::_lastDeltaTimeUS { 0u }
private

Definition at line 194 of file PreRenderBatch.h.

◆ _linearDepthRT

RenderTargetHandle Divide::PreRenderBatch::_linearDepthRT {}
private

Definition at line 197 of file PreRenderBatch.h.

◆ _lineariseDepthBuffer

Handle<ShaderProgram> Divide::PreRenderBatch::_lineariseDepthBuffer { INVALID_HANDLE<ShaderProgram> }
private

Definition at line 188 of file PreRenderBatch.h.

◆ _operators

std::array<OperatorBatch, to_base(FilterSpace::COUNT)> Divide::PreRenderBatch::_operators
private

Definition at line 177 of file PreRenderBatch.h.

◆ _parent

PostFX& Divide::PreRenderBatch::_parent
private

Definition at line 175 of file PreRenderBatch.h.

◆ _pipelineLumCalcAverage

Pipeline* Divide::PreRenderBatch::_pipelineLumCalcAverage { nullptr }
private

Definition at line 191 of file PreRenderBatch.h.

◆ _pipelineLumCalcHistogram

Pipeline* Divide::PreRenderBatch::_pipelineLumCalcHistogram { nullptr }
private

Definition at line 190 of file PreRenderBatch.h.

◆ _pipelineToneMap

Pipeline* Divide::PreRenderBatch::_pipelineToneMap { nullptr }
private

Definition at line 192 of file PreRenderBatch.h.

◆ _pipelineToneMapAdaptive

Pipeline* Divide::PreRenderBatch::_pipelineToneMapAdaptive { nullptr }
private

Definition at line 193 of file PreRenderBatch.h.

◆ _sceneEdges

RenderTargetHandle Divide::PreRenderBatch::_sceneEdges {}
private

Definition at line 196 of file PreRenderBatch.h.

◆ _screenRTs

ScreenTargets Divide::PreRenderBatch::_screenRTs {}
private

Definition at line 181 of file PreRenderBatch.h.

◆ _toneMap

Handle<ShaderProgram> Divide::PreRenderBatch::_toneMap { INVALID_HANDLE<ShaderProgram> }
private

Definition at line 184 of file PreRenderBatch.h.

◆ _toneMapAdaptive

Handle<ShaderProgram> Divide::PreRenderBatch::_toneMapAdaptive { INVALID_HANDLE<ShaderProgram> }
private

Definition at line 185 of file PreRenderBatch.h.


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