CASRenderModule
class CASRenderModule : public cauldron::RenderModule
CASRenderModule handles a number of tasks related to CAS.
CASRenderModule takes care of: creating UI section that enable users to switch between options of CAS performing sharpening or upscaling and output to the color target
Dependencies: FfxCasContext, FfxCasContextDescription
Inherits from: public cauldron::RenderModule
Public Interface
Constructor:
CASRenderModule
inline CASRenderModule()
Constructor with default behavior.
Attributes: inline
Source: samples/cas/casrendermodule.h
(line 57, column 5)
Destructor:
~CASRenderModule
virtual ~CASRenderModule()
Tear down the FFX API Context and release resources.
Attributes: virtual
Source: samples/cas/casrendermodule.h
(line 65, column 13)
Public Functions:
Init
virtual void Init(const json &initData) override
Initialize FFX API Context, setup the internal color texture used as temporary input, and setup UI section for CAS.
Parameters:
Name | Type | Default |
---|---|---|
initData | const json & | “ |
Attributes: virtual
Source: samples/cas/casrendermodule.h
(line 70, column 18)
Execute
virtual void Execute(double deltaTime, cauldron::CommandList *pCmdList) override
Setup input/output texture and parameters FFX API needs this frame and then call the FFX Dispatch.
Parameters:
Name | Type | Default |
---|---|---|
deltaTime | double | “ |
pCmdList | cauldron::CommandList * | “ |
Attributes: virtual
Source: samples/cas/casrendermodule.h
(line 75, column 18)
OnResize
virtual void OnResize(const cauldron::ResolutionInfo &resInfo) override
Called by the framework when resolution changes. FFX API Context for CAS need to be reset in respond to this.
Parameters:
Name | Type | Default |
---|---|---|
resInfo | const cauldron::ResolutionInfo & | “ |
Attributes: virtual
Source: samples/cas/casrendermodule.h
(line 80, column 18)
Private Interface
Private Functions:
UpdateResolution
cauldron::ResolutionInfo UpdateResolution(uint32_t displayWidth, uint32_t displayHeight)
Required by the framework so that CAS RenderModule can take care of the upscaling ratio.
Parameters:
Name | Type | Default |
---|---|---|
displayWidth | uint32_t | “ |
displayHeight | uint32_t | “ |
Returns: cauldron::ResolutionInfo
Source: samples/cas/casrendermodule.h
(line 103, column 30)
UpdatePreset
void UpdatePreset(const int32_t *pOldPreset)
Callback function called when upscaling is enabled or upscaling preset is changed.
Parameters:
Name | Type | Default |
---|---|---|
pOldPreset | const int32_t * | “ |
Source: samples/cas/casrendermodule.h
(line 108, column 30)
UpdateUpscaleRatio
void UpdateUpscaleRatio(const float *pOldRatio)
Callback function for upscaling ratio slider.
Parameters:
Name | Type | Default |
---|---|---|
pOldRatio | const float * | “ |
Source: samples/cas/casrendermodule.h
(line 113, column 30)
SetupFfxInterface
void SetupFfxInterface()
Source: samples/cas/casrendermodule.h
(line 115, column 30)
InitCasContext
void InitCasContext()
Source: samples/cas/casrendermodule.h
(line 116, column 30)
DestroyCasContext
void DestroyCasContext()
Source: samples/cas/casrendermodule.h
(line 117, column 30)
Private Members:
CAS_State m_CasState
CAS_State m_CasState = = CAS_State_SharpenOnly
Attributes: private
Source: samples/cas/casrendermodule.h
(line 119, column 15)
bool m_CasEnabled
bool m_CasEnabled = = true
Attributes: private
Source: samples/cas/casrendermodule.h
(line 120, column 15)
float m_Sharpness
float m_Sharpness = = 0.8f
Attributes: private
Source: samples/cas/casrendermodule.h
(line 121, column 15)
CASScalePreset m_ScalePreset
CASScalePreset m_ScalePreset = = CASScalePreset::UltraQuality
Attributes: private
Source: samples/cas/casrendermodule.h
(line 123, column 20)
float m_UpscaleRatio
float m_UpscaleRatio = = 1.3f
Attributes: private
Source: samples/cas/casrendermodule.h
(line 124, column 20)
bool m_UpscaleRatioEnabled
bool m_UpscaleRatioEnabled = = false
Attributes: private
Source: samples/cas/casrendermodule.h
(line 125, column 20)
bool m_CasUpscalingEnabled
bool m_CasUpscalingEnabled = = false
Attributes: private
Source: samples/cas/casrendermodule.h
(line 126, column 20)
FfxCasContextDescription m_InitializationParameters
FfxCasContextDescription m_InitializationParameters = = {0}
Attributes: private
Source: samples/cas/casrendermodule.h
(line 129, column 30)
FfxCasContext m_CasContext
FfxCasContext m_CasContext
Attributes: private
Source: samples/cas/casrendermodule.h
(line 130, column 30)
const cauldron::Texture * m_pColorTarget
const cauldron::Texture * m_pColorTarget = = nullptr
Attributes: private
Source: samples/cas/casrendermodule.h
(line 133, column 29)
const cauldron::Texture * m_pTempColorTarget
const cauldron::Texture * m_pTempColorTarget = = nullptr
Attributes: private
Source: samples/cas/casrendermodule.h
(line 134, column 29)
std::function<cauldron::ResolutionInfo(uint32_t, uint32_t)> m_pUpdateFunc
std::function<cauldron::ResolutionInfo(uint32_t, uint32_t)> m_pUpdateFunc = = nullptr
Attributes: private
Source: samples/cas/casrendermodule.h
(line 137, column 19)
Source: samples/cas/casrendermodule.h
(line 51, column 1)