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

#include <PostFX.h>

+ Inheritance diagram for Divide::PostFX:

Public Member Functions

 PostFX (PlatformContext &context)
 
 ~PostFX () override
 
void prePass (PlayerIndex idx, const CameraSnapshot &cameraSnapshot, GFX::CommandBuffer &bufferInOut)
 
void apply (PlayerIndex idx, const CameraSnapshot &cameraSnapshot, GFX::CommandBuffer &bufferInOut)
 
void idle (const Configuration &config, U64 deltaTimeUSGame)
 
void update (U64 deltaTimeUSFixed, U64 deltaTimeUSApp)
 
void updateResolution (U16 newWidth, U16 newHeight)
 
void pushFilter (const FilterType filter, const bool overrideScene=false)
 
void popFilter (const FilterType filter, const bool overrideScene=false)
 
bool getFilterState (const FilterType filter) const noexcept
 
PreRenderBatchgetFilterBatch () noexcept
 
void setFadeOut (const UColour3 &targetColour, D64 durationMS, D64 waitDurationMS, DELEGATE< void > onComplete=DELEGATE< void >())
 
void setFadeIn (D64 durationMS, DELEGATE< void > onComplete=DELEGATE< void >())
 
void setFadeOutIn (const UColour3 &targetColour, D64 durationFadeOutMS, D64 waitDurationMS)
 
void setFadeOutIn (const UColour3 &targetColour, D64 durationFadeOutMS, D64 durationFadeInMS, D64 waitDurationMS)
 
 PROPERTY_RW (bool, isDayTime, true)
 
- Public Member Functions inherited from Divide::PlatformContextComponent
 PlatformContextComponent (PlatformContext &context) noexcept
 
virtual ~PlatformContextComponent ()=default
 
PlatformContextcontext () noexcept
 
const PlatformContextcontext () const noexcept
 
- Public Member Functions inherited from Divide::NonCopyable
 NonCopyable (const NonCopyable &)=delete
 
NonCopyableoperator= (const NonCopyable &)=delete
 
 NonCopyable (NonCopyable &&)=default
 
NonCopyableoperator= (NonCopyable &&)=default
 

Static Public Member Functions

static const char * FilterName (FilterType filter) noexcept
 

Private Types

enum class  FXDisplayFunction : U8 {
  Vignette = 0 , Noise , Underwater , Normal ,
  PassThrough , COUNT
}
 
enum class  FXRoutines : U8 { Vignette = 0 , Noise , Screen , COUNT }
 

Private Attributes

PreRenderBatch _preRenderBatch
 
Handle< Texture_screenBorder = INVALID_HANDLE<Texture>
 
Handle< Texture_noise = INVALID_HANDLE<Texture>
 
Handle< Texture_underwaterTexture = INVALID_HANDLE<Texture>
 
F32 _randomNoiseCoefficient = 0.0f
 
F32 _randomFlashCoefficient = 0.0f
 
D64 _noiseTimer = 0.0
 
D64 _tickInterval = 1.0
 
Handle< ShaderProgram_postProcessingShader = INVALID_HANDLE<ShaderProgram>
 
vec2< U16_resolutionCache
 
RTDrawDescriptor _postFXTarget
 
D64 _currentFadeTimeMS = 0.0
 
D64 _targetFadeTimeMS = 0.0
 
D64 _fadeWaitDurationMS = 0.0
 
bool _fadeOut = false
 
bool _fadeActive = false
 
DELEGATE< void > _fadeOutComplete
 
DELEGATE< void > _fadeInComplete
 
U32 _filterStack = 0u
 
U32 _overrideFilterStack = 0u
 
bool _filtersDirty = true
 
Pipeline_drawPipeline = nullptr
 
UniformData _uniformData
 
GFX::SetCameraCommand _setCameraCmd
 

Additional Inherited Members

- Protected Member Functions inherited from Divide::NonCopyable
 NonCopyable ()=default
 
 ~NonCopyable ()=default
 
- Protected Attributes inherited from Divide::PlatformContextComponent
PlatformContext_context
 

Detailed Description

Definition at line 47 of file PostFX.h.

Member Enumeration Documentation

◆ FXDisplayFunction

enum class Divide::PostFX::FXDisplayFunction : U8
strongprivate
Enumerator
Vignette 
Noise 
Underwater 
Normal 
PassThrough 
COUNT 

Definition at line 49 of file PostFX.h.

◆ FXRoutines

enum class Divide::PostFX::FXRoutines : U8
strongprivate
Enumerator
Vignette 
Noise 
Screen 
COUNT 

Definition at line 58 of file PostFX.h.

Constructor & Destructor Documentation

◆ PostFX()

Divide::PostFX::PostFX ( PlatformContext context)
explicit

Definition at line 47 of file PostFX.cpp.

◆ ~PostFX()

Divide::PostFX::~PostFX ( )
override

Definition at line 119 of file PostFX.cpp.

Member Function Documentation

◆ apply()

void Divide::PostFX::apply ( PlayerIndex  idx,
const CameraSnapshot cameraSnapshot,
GFX::CommandBuffer bufferInOut 
)

Definition at line 154 of file PostFX.cpp.

◆ FilterName()

const char * Divide::PostFX::FilterName ( FilterType  filter)
staticnoexcept

Definition at line 27 of file PostFX.cpp.

◆ getFilterBatch()

PreRenderBatch & Divide::PostFX::getFilterBatch ( )
inlinenoexcept

Definition at line 119 of file PostFX.h.

◆ getFilterState()

bool Divide::PostFX::getFilterState ( const FilterType  filter) const
inlinenoexcept

Definition at line 111 of file PostFX.h.

◆ idle()

void Divide::PostFX::idle ( const Configuration config,
U64  deltaTimeUSGame 
)

Definition at line 232 of file PostFX.cpp.

◆ popFilter()

void Divide::PostFX::popFilter ( const FilterType  filter,
const bool  overrideScene = false 
)
inline

Definition at line 94 of file PostFX.h.

◆ prePass()

void Divide::PostFX::prePass ( PlayerIndex  idx,
const CameraSnapshot cameraSnapshot,
GFX::CommandBuffer bufferInOut 
)

Definition at line 143 of file PostFX.cpp.

◆ PROPERTY_RW()

Divide::PostFX::PROPERTY_RW ( bool  ,
isDayTime  ,
true   
)

◆ pushFilter()

void Divide::PostFX::pushFilter ( const FilterType  filter,
const bool  overrideScene = false 
)
inline

Definition at line 77 of file PostFX.h.

◆ setFadeIn()

void Divide::PostFX::setFadeIn ( D64  durationMS,
DELEGATE< void >  onComplete = DELEGATE<void>() 
)

Definition at line 312 of file PostFX.cpp.

◆ setFadeOut()

void Divide::PostFX::setFadeOut ( const UColour3 targetColour,
D64  durationMS,
D64  waitDurationMS,
DELEGATE< void >  onComplete = DELEGATE<void>() 
)

Definition at line 298 of file PostFX.cpp.

◆ setFadeOutIn() [1/2]

void Divide::PostFX::setFadeOutIn ( const UColour3 targetColour,
D64  durationFadeOutMS,
D64  durationFadeInMS,
D64  waitDurationMS 
)

Definition at line 330 of file PostFX.cpp.

◆ setFadeOutIn() [2/2]

void Divide::PostFX::setFadeOutIn ( const UColour3 targetColour,
D64  durationFadeOutMS,
D64  waitDurationMS 
)

Definition at line 322 of file PostFX.cpp.

◆ update()

void Divide::PostFX::update ( U64  deltaTimeUSFixed,
U64  deltaTimeUSApp 
)

Definition at line 252 of file PostFX.cpp.

◆ updateResolution()

void Divide::PostFX::updateResolution ( U16  newWidth,
U16  newHeight 
)

Definition at line 129 of file PostFX.cpp.

Member Data Documentation

◆ _currentFadeTimeMS

D64 Divide::PostFX::_currentFadeTimeMS = 0.0
private

Definition at line 159 of file PostFX.h.

◆ _drawPipeline

Pipeline* Divide::PostFX::_drawPipeline = nullptr
private

Definition at line 172 of file PostFX.h.

◆ _fadeActive

bool Divide::PostFX::_fadeActive = false
private

Definition at line 163 of file PostFX.h.

◆ _fadeInComplete

DELEGATE<void> Divide::PostFX::_fadeInComplete
private

Definition at line 165 of file PostFX.h.

◆ _fadeOut

bool Divide::PostFX::_fadeOut = false
private

Definition at line 162 of file PostFX.h.

◆ _fadeOutComplete

DELEGATE<void> Divide::PostFX::_fadeOutComplete
private

Definition at line 164 of file PostFX.h.

◆ _fadeWaitDurationMS

D64 Divide::PostFX::_fadeWaitDurationMS = 0.0
private

Definition at line 161 of file PostFX.h.

◆ _filtersDirty

bool Divide::PostFX::_filtersDirty = true
private

Definition at line 170 of file PostFX.h.

◆ _filterStack

U32 Divide::PostFX::_filterStack = 0u
private

Definition at line 167 of file PostFX.h.

◆ _noise

Handle<Texture> Divide::PostFX::_noise = INVALID_HANDLE<Texture>
private

Definition at line 147 of file PostFX.h.

◆ _noiseTimer

D64 Divide::PostFX::_noiseTimer = 0.0
private

Definition at line 151 of file PostFX.h.

◆ _overrideFilterStack

U32 Divide::PostFX::_overrideFilterStack = 0u
private

Definition at line 168 of file PostFX.h.

◆ _postFXTarget

RTDrawDescriptor Divide::PostFX::_postFXTarget
private

Definition at line 156 of file PostFX.h.

◆ _postProcessingShader

Handle<ShaderProgram> Divide::PostFX::_postProcessingShader = INVALID_HANDLE<ShaderProgram>
private

Definition at line 153 of file PostFX.h.

◆ _preRenderBatch

PreRenderBatch Divide::PostFX::_preRenderBatch
private

Definition at line 144 of file PostFX.h.

◆ _randomFlashCoefficient

F32 Divide::PostFX::_randomFlashCoefficient = 0.0f
private

Definition at line 150 of file PostFX.h.

◆ _randomNoiseCoefficient

F32 Divide::PostFX::_randomNoiseCoefficient = 0.0f
private

Definition at line 150 of file PostFX.h.

◆ _resolutionCache

vec2<U16> Divide::PostFX::_resolutionCache
private

Definition at line 154 of file PostFX.h.

◆ _screenBorder

Handle<Texture> Divide::PostFX::_screenBorder = INVALID_HANDLE<Texture>
private

Definition at line 146 of file PostFX.h.

◆ _setCameraCmd

GFX::SetCameraCommand Divide::PostFX::_setCameraCmd
private

Definition at line 174 of file PostFX.h.

◆ _targetFadeTimeMS

D64 Divide::PostFX::_targetFadeTimeMS = 0.0
private

Definition at line 160 of file PostFX.h.

◆ _tickInterval

D64 Divide::PostFX::_tickInterval = 1.0
private

Definition at line 151 of file PostFX.h.

◆ _underwaterTexture

Handle<Texture> Divide::PostFX::_underwaterTexture = INVALID_HANDLE<Texture>
private

Definition at line 148 of file PostFX.h.

◆ _uniformData

UniformData Divide::PostFX::_uniformData
private

Definition at line 173 of file PostFX.h.


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