"L. Spiro Engine"
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes

lsg::CPostProcessLuminance Class Reference

Manages calculating the luminance of a render and adjusting the luminance over time. More...

#include <LSGPostProcessLuminance.h>

List of all members.

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 CShaderm_psFirstPass
static CShaderm_psOtherPasses
static CShaderm_psAdapt
static CShaderm_psDisplayLum
static CCriticalSection m_csCrit
static LSUINT32 m_ui32RefCount
static CShaderBase::LSG_HANDLE m_hTexCoords
static CShaderBase::LSG_HANDLE m_hOtherTexCoords

Detailed Description

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.


Member Function Documentation

LSBOOL LSE_CALL lsg::CPostProcessLuminance::GetAdaptedLuminance ( LSFLOAT  _fTime)

Creates the adapted luminance given the time between the previous and current luminance values.

Parameters:
_fTimeThe time since the last render.
Returns:
Returns true if all resources were created and the adapted luminance was calculated.
LSE_INLINE CColorRenderTarget &LSE_CALL lsg::CPostProcessLuminance::GetAdaptedTarget ( )

Gets the adapted color render target.

Returns:
Returns the adapted color render target.
LSE_INLINE CColorRenderTarget &LSE_CALL lsg::CPostProcessLuminance::GetCurLumTarget ( )

Gets the current luminance color render target.

Returns:
Returns a reference to the current luminance 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.

Parameters:
_crtSrcThe source render target whose luminance is to be determined.
_fTimeThe time since the last render.
Returns:
Returns true if all resources were created and the luminance was calculated.
LSE_INLINE CColorRenderTarget &LSE_CALL lsg::CPostProcessLuminance::GetPrevLumTarget ( )

Gets the previous luminance color render target.

Returns:
Returns a reference to the previous luminance render target.
LSBOOL LSE_CALL lsg::CPostProcessLuminance::Init ( LSUINT32  _ui32Width,
LSUINT32  _ui32Height 
) [protected]

Initializes the shaders and render targets.

Parameters:
_ui32WidthNew width.
_ui32HeightNew height.
Returns:
Returns true if the shaders and render targets were initialized.
LSE_INLINE CShader *LSE_CALL lsg::CPostProcessLuminance::LumDisplayShader ( )

Gets the shader for displaying luminance. May return NULL.

Returns:
Returns the shader for displaying luminance or NULL.
LSE_INLINE CVector< CColorRenderTarget, LSUINT8 > & lsg::CPostProcessLuminance::MiddleTargets ( )

Gets the array of render targets used in the intemediate steps.

Returns:
Returns the array of intermediate render targets.

Member Data Documentation

The final adapted result.

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.

Handle to the texture offsets in the shader.

Handle to the texture offsets in the shader.

The shader for adapting over time.

The shader for displaying the final luminance.

The shader for the first pass.

The shader for the remaining passes.

The current final render target.

The height of the last image passed to us.

The width of the last image passed to us.

LSUINT32 lsg::CPostProcessLuminance::m_ui32RefCount [static, protected]

Reference count on the shaders.

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.


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator