"L. Spiro Engine"
|
Manages calculating the luminance of a render and adjusting the luminance over time. More...
#include <LSGPostProcessLuminance.h>
Public Member Functions | |
LSBOOL LSE_CALL | GetLuminance (CColorRenderTarget &_crtSrc) |
LSBOOL LSE_CALL | GetAdaptedLuminance (LSFLOAT _fTime) |
LSE_INLINE CColorRenderTarget &LSE_CALL | GetCurLumTarget () |
LSE_INLINE CColorRenderTarget &LSE_CALL | GetPrevLumTarget () |
LSE_INLINE CColorRenderTarget &LSE_CALL | GetAdaptedTarget () |
LSE_INLINE CVector < CColorRenderTarget, LSUINT8 > & | MiddleTargets () |
LSE_INLINE CShader *LSE_CALL | LumDisplayShader () |
Protected Member Functions | |
LSBOOL LSE_CALL | Init (LSUINT32 _ui32Width, LSUINT32 _ui32Height) |
Protected Attributes | |
CVector< CColorRenderTarget, LSUINT8 > | m_vRenderTargets |
CColorRenderTarget | m_crtFinal [2] |
CColorRenderTarget | m_crtAdapted |
LSUINT32 | m_ui32CurFinal |
LSUINT32 | m_ui32LastWidth |
LSUINT32 | m_ui32LastHeight |
Static Protected Attributes | |
static CShader * | m_psFirstPass |
static CShader * | m_psOtherPasses |
static CShader * | m_psAdapt |
static CShader * | m_psDisplayLum |
static CCriticalSection | m_csCrit |
static LSUINT32 | m_ui32RefCount |
static CShaderBase::LSG_HANDLE | m_hTexCoords |
static CShaderBase::LSG_HANDLE | m_hOtherTexCoords |
Manages calculating the luminance of a render and adjusting the luminance over time.
Class CPostProcessLuminance Description: Manages calculating the luminance of a render and adjusting the luminance over time.
LSBOOL LSE_CALL lsg::CPostProcessLuminance::GetAdaptedLuminance | ( | LSFLOAT | _fTime | ) |
Creates the adapted luminance given the time between the previous and current luminance values.
_fTime | The time since the last render. |
LSE_INLINE CColorRenderTarget &LSE_CALL lsg::CPostProcessLuminance::GetAdaptedTarget | ( | ) |
Gets the adapted color render target.
LSE_INLINE CColorRenderTarget &LSE_CALL lsg::CPostProcessLuminance::GetCurLumTarget | ( | ) |
Gets the current luminance color render target.
LSBOOL LSE_CALL lsg::CPostProcessLuminance::GetLuminance | ( | CColorRenderTarget & | _crtSrc | ) |
Gets the final luminance of the given render target, which is used as a texture for the purposes of determing luminance.
_crtSrc | The source render target whose luminance is to be determined. |
_fTime | The time since the last render. |
LSE_INLINE CColorRenderTarget &LSE_CALL lsg::CPostProcessLuminance::GetPrevLumTarget | ( | ) |
Gets the previous luminance color render target.
LSBOOL LSE_CALL lsg::CPostProcessLuminance::Init | ( | LSUINT32 | _ui32Width, |
LSUINT32 | _ui32Height | ||
) | [protected] |
Initializes the shaders and render targets.
_ui32Width | New width. |
_ui32Height | New height. |
LSE_INLINE CShader *LSE_CALL lsg::CPostProcessLuminance::LumDisplayShader | ( | ) |
Gets the shader for displaying luminance. May return NULL.
LSE_INLINE CVector< CColorRenderTarget, LSUINT8 > & lsg::CPostProcessLuminance::MiddleTargets | ( | ) |
Gets the array of render targets used in the intemediate steps.
The final adapted result.
CColorRenderTarget lsg::CPostProcessLuminance::m_crtFinal[2] [protected] |
The 2 final results, swapped each frame, one used for the current luminance and one for the previous.
CCriticalSection lsg::CPostProcessLuminance::m_csCrit [static, protected] |
Critical section for thread safety.
CShaderBase::LSG_HANDLE lsg::CPostProcessLuminance::m_hOtherTexCoords [static, protected] |
Handle to the texture offsets in the shader.
CShaderBase::LSG_HANDLE lsg::CPostProcessLuminance::m_hTexCoords [static, protected] |
Handle to the texture offsets in the shader.
CShader* lsg::CPostProcessLuminance::m_psAdapt [static, protected] |
The shader for adapting over time.
CShader* lsg::CPostProcessLuminance::m_psDisplayLum [static, protected] |
The shader for displaying the final luminance.
CShader* lsg::CPostProcessLuminance::m_psFirstPass [static, protected] |
The shader for the first pass.
CShader* lsg::CPostProcessLuminance::m_psOtherPasses [static, protected] |
The shader for the remaining passes.
LSUINT32 lsg::CPostProcessLuminance::m_ui32CurFinal [protected] |
The current final render target.
LSUINT32 lsg::CPostProcessLuminance::m_ui32LastHeight [protected] |
The height of the last image passed to us.
LSUINT32 lsg::CPostProcessLuminance::m_ui32LastWidth [protected] |
The width of the last image passed to us.
LSUINT32 lsg::CPostProcessLuminance::m_ui32RefCount [static, protected] |
Reference count on the shaders.
CVector<CColorRenderTarget, LSUINT8> lsg::CPostProcessLuminance::m_vRenderTargets [protected] |
The array of color render targets used by this class. The number of render targets depends on the screen resolution, which is convenient because low-end devices with smaller screens require fewer render targets and fewer passes. The final result of all the passes is not stored here.