Castor3D  ..
Classes | Public Member Functions | Static Public Attributes | Protected Attributes | Static Protected Attributes | List of all members
Castor3D::RenderTarget Class Reference

Render target class. More...

+ Inheritance diagram for Castor3D::RenderTarget:
+ Collaboration diagram for Castor3D::RenderTarget:

Classes

class  BinaryParser
 RenderTarget loader. More...
 
class  TextLoader
 RenderTarget loader. More...
 

Public Member Functions

C3D_API RenderTarget (Engine &p_pRoot, eTARGET_TYPE p_eTargetType=eTARGET_TYPE_WINDOW)
 
C3D_API ~RenderTarget ()
 Destructor. More...
 
C3D_API void Render (uint32_t p_dFrameTime)
 Renders one frame. More...
 
C3D_API void Initialise (uint32_t p_index)
 Initialisation function. More...
 
C3D_API void Cleanup ()
 Cleanup function. More...
 
C3D_API void SetSize (Castor::Size const &p_size)
 Sets the target dimensions. More...
 
C3D_API DynamicTextureSPtr CreateDynamicTexture (uint8_t p_cpuAccess, uint8_t p_gpuAccess) const
 Creates a dynamic texture. More...
 
C3D_API void SetTechnique (Castor::String const &p_name, Parameters const &p_parameters)
 Defines the RenderTechnique. More...
 
C3D_API eVIEWPORT_TYPE GetViewportType () const
 Retrieves the eVIEWPORT_TYPE. More...
 
C3D_API void SetViewportType (eVIEWPORT_TYPE val)
 Sets the eVIEWPORT_TYPE. More...
 
C3D_API void SetCamera (CameraSPtr p_pCamera)
 Sets the camera. More...
 
C3D_API void SetIntraOcularDistance (real p_rIod)
 Defines the intra ocular distance. More...
 
C3D_API void SetToneMappingType (eTONE_MAPPING_TYPE p_type, Parameters const &p_parameters)
 Sets the tone mapping implementation type. More...
 
bool IsInitialised () const
 Retrieves the intialisation status. More...
 
Castor::Size const & GetSize () const
 Retrieves the target size. More...
 
DepthStencilStateSPtr GetDepthStencilState () const
 Retrieves the DepthStencilState. More...
 
RasteriserStateSPtr GetRasteriserState () const
 Retrieves the RasteriserState. More...
 
RenderTechniqueSPtr GetTechnique () const
 Retrieves the RenderTechnique. More...
 
void SetTechnique (RenderTechniqueSPtr p_pTechnique)
 Defines the RenderTechnique. More...
 
bool IsMultisampling () const
 Retrieves the multisampling status. More...
 
int32_t GetSamplesCount () const
 Retrieves the samples count. More...
 
void SetSamplesCount (int32_t val)
 Sets the samples count. More...
 
SceneSPtr GetScene () const
 Retrieves the Scene. More...
 
CameraSPtr GetCamera () const
 Retrieves the Camera. More...
 
CameraSPtr GetCameraLEye () const
 Retrieves the left eye camera. More...
 
CameraSPtr GetCameraREye () const
 Retrieves the right eye camera. More...
 
void SetScene (SceneSPtr p_scene)
 Sets the Scene. More...
 
FrameBufferSPtr GetFrameBuffer () const
 Retrieves the frame buffer. More...
 
TextureUnit const & GetTexture () const
 Retrieves the texture. More...
 
FrameBufferSPtr GetFrameBufferLEye () const
 Retrieves the left eye frame buffer. More...
 
TextureUnit const & GetTextureLEye () const
 Retrieves the left eye texture. More...
 
FrameBufferSPtr GetFrameBufferREye () const
 Retrieves the right eye frame buffer. More...
 
TextureUnit const & GetTextureREye () const
 Retrieves the right eye texture. More...
 
bool IsUsingStereo () const
 Retrieves the stereo status. More...
 
void SetStereo (bool p_bStereo)
 Defines the stereo status. More...
 
real GetIntraOcularDistance () const
 Retrieves the intra ocular distance. More...
 
Castor::ePIXEL_FORMAT GetPixelFormat () const
 Retrieves the window pixel format. More...
 
void SetPixelFormat (Castor::ePIXEL_FORMAT val)
 Sets the window pixel format. More...
 
eTARGET_TYPE GetTargetType () const
 Retrieves the target type. More...
 
void AddPostEffect (PostEffectSPtr p_effect)
 Adds a post effect to the list. More...
 
uint32_t GetIndex () const
 
PostEffectPtrArray const & GetPostEffects () const
 
ToneMappingSPtr GetToneMapping () const
 

Static Public Attributes

static C3D_API const Castor::String DefaultSamplerName
 The render target default sampler name. More...
 

Protected Attributes

eTARGET_TYPE m_eTargetType
 The render target type. More...
 
bool m_initialised
 Tells if the target is initalised. More...
 
Castor::Size m_size
 The target size. More...
 
RenderTechniqueSPtr m_renderTechnique
 The technique used to render this target. More...
 
bool m_bMultisampling
 Tells whether or not to use multisampling. More...
 
int32_t m_samplesCount
 Defines the samples count if multisampling is activated. More...
 
SceneWPtr m_pScene
 The scene rendered in this render target. More...
 
CameraWPtr m_pCamera
 The camera used to render the scene. More...
 
CameraWPtr m_pCameraLEye
 The left eye camera used to render the stereo scene. More...
 
CameraWPtr m_pCameraREye
 The right eye camera used to render the stereo scene. More...
 
bool m_bStereo
 Tells the window uses stereoscopic rendering. More...
 
real m_rIntraOcularDistance
 Intra ocular distance used in stereoscopic rendering. More...
 
stFRAME_BUFFER m_fbLeftEye
 Frame buffer for left/middle eye. More...
 
stFRAME_BUFFER m_fbRightEye
 Frame buffer for right eye. More...
 
FrameBufferWPtr m_pCurrentFrameBuffer
 The currently active frame buffer (useful in stereoscopic rendering) More...
 
CameraWPtr m_pCurrentCamera
 The currently active camera (useful in stereoscopic rendering) More...
 
Castor::ePIXEL_FORMAT m_pixelFormat
 The target display format. More...
 
uint32_t m_index
 This render target's index. More...
 
Castor::String m_techniqueName
 The render technique name. More...
 
Parameters m_techniqueParameters
 The render technique parameters. More...
 
DepthStencilStateWPtr m_wpDepthStencilState
 Depth and stencil buffers states. More...
 
RasteriserStateWPtr m_wpRasteriserState
 Rasteriser states. More...
 
PostEffectPtrArray m_postEffects
 The post effects. More...
 
ToneMappingSPtr m_toneMapping
 The tone mapping implementation. More...
 
ToneMappingFactory m_toneMappingFactory
 The tone mapping implementation. More...
 

Static Protected Attributes

static uint32_t sm_uiCount
 The number of actually created render targets. More...
 

Detailed Description

Render target class.

Author
Sylvain DOREMUS
Version
0.6.1.0
Date
19/10/2011
Remarks
A render target draws a scene in a frame buffer that can then be used by a window to have a direct render, or a texture to have offscreen rendering

Constructor & Destructor Documentation

◆ RenderTarget()

C3D_API Castor3D::RenderTarget::RenderTarget ( Engine p_pRoot,
eTARGET_TYPE  p_eTargetType = eTARGET_TYPE_WINDOW 
)

Specified constructor

Parameters
[in]p_pRootThe engine root
[in]p_eTargetTypeThe render target type

◆ ~RenderTarget()

C3D_API Castor3D::RenderTarget::~RenderTarget ( )

Destructor.

Member Function Documentation

◆ AddPostEffect()

void Castor3D::RenderTarget::AddPostEffect ( PostEffectSPtr  p_effect)
inline

Adds a post effect to the list.

Parameters
[in]p_effectThe effect.

References m_postEffects.

◆ Cleanup()

C3D_API void Castor3D::RenderTarget::Cleanup ( )

Cleanup function.

◆ CreateDynamicTexture()

C3D_API DynamicTextureSPtr Castor3D::RenderTarget::CreateDynamicTexture ( uint8_t  p_cpuAccess,
uint8_t  p_gpuAccess 
) const

Creates a dynamic texture.

Parameters
[in]p_cpuAccessThe required CPU access (combination of eACCESS_TYPE).
[in]p_gpuAccessThe required GPU access (combination of eACCESS_TYPE).
Returns
The texture.

◆ GetCamera()

CameraSPtr Castor3D::RenderTarget::GetCamera ( ) const
inline

Retrieves the Camera.

Returns
The Camera

References m_pCamera.

◆ GetCameraLEye()

CameraSPtr Castor3D::RenderTarget::GetCameraLEye ( ) const
inline

Retrieves the left eye camera.

Returns
The camera

References m_pCameraLEye.

◆ GetCameraREye()

CameraSPtr Castor3D::RenderTarget::GetCameraREye ( ) const
inline

Retrieves the right eye camera.

Returns
The camera

References m_pCameraREye.

◆ GetDepthStencilState()

DepthStencilStateSPtr Castor3D::RenderTarget::GetDepthStencilState ( ) const
inline

Retrieves the DepthStencilState.

Returns
The DepthStencilState

References m_wpDepthStencilState.

◆ GetFrameBuffer()

FrameBufferSPtr Castor3D::RenderTarget::GetFrameBuffer ( ) const
inline

Retrieves the frame buffer.

Returns
The frame buffer

References m_pCurrentFrameBuffer.

◆ GetFrameBufferLEye()

FrameBufferSPtr Castor3D::RenderTarget::GetFrameBufferLEye ( ) const
inline

Retrieves the left eye frame buffer.

Returns
The frame buffer

References m_fbLeftEye.

◆ GetFrameBufferREye()

FrameBufferSPtr Castor3D::RenderTarget::GetFrameBufferREye ( ) const
inline

Retrieves the right eye frame buffer.

Returns
The frame buffer

References m_fbRightEye.

◆ GetIndex()

uint32_t Castor3D::RenderTarget::GetIndex ( ) const
inline
Returns
The target index.

References m_index.

◆ GetIntraOcularDistance()

real Castor3D::RenderTarget::GetIntraOcularDistance ( ) const
inline

Retrieves the intra ocular distance.

Returns
The intra ocular distance

References m_rIntraOcularDistance.

◆ GetPixelFormat()

Castor::ePIXEL_FORMAT Castor3D::RenderTarget::GetPixelFormat ( ) const
inline

Retrieves the window pixel format.

Returns
The window pixel format

References m_pixelFormat.

◆ GetPostEffects()

PostEffectPtrArray const& Castor3D::RenderTarget::GetPostEffects ( ) const
inline
Returns
The post effects array.

References m_postEffects.

◆ GetRasteriserState()

RasteriserStateSPtr Castor3D::RenderTarget::GetRasteriserState ( ) const
inline

Retrieves the RasteriserState.

Returns
The RasteriserState

References m_wpRasteriserState.

◆ GetSamplesCount()

int32_t Castor3D::RenderTarget::GetSamplesCount ( ) const
inline

Retrieves the samples count.

Returns
The samples count

References m_samplesCount.

◆ GetScene()

SceneSPtr Castor3D::RenderTarget::GetScene ( ) const
inline

Retrieves the Scene.

Returns
The Scene

References m_pScene.

◆ GetSize()

Castor::Size const& Castor3D::RenderTarget::GetSize ( ) const
inline

Retrieves the target size.

Returns
The size

Récupère les dimensions de la cible

Returns
Les dimensions

References m_size.

◆ GetTargetType()

eTARGET_TYPE Castor3D::RenderTarget::GetTargetType ( ) const
inline

Retrieves the target type.

Returns
The value

References m_eTargetType.

◆ GetTechnique()

RenderTechniqueSPtr Castor3D::RenderTarget::GetTechnique ( ) const
inline

Retrieves the RenderTechnique.

Returns
The RenderTechnique

References m_renderTechnique.

◆ GetTexture()

TextureUnit const& Castor3D::RenderTarget::GetTexture ( ) const
inline

Retrieves the texture.

Returns
The texture

References m_fbLeftEye.

◆ GetTextureLEye()

TextureUnit const& Castor3D::RenderTarget::GetTextureLEye ( ) const
inline

Retrieves the left eye texture.

Returns
The texture

References m_fbLeftEye.

◆ GetTextureREye()

TextureUnit const& Castor3D::RenderTarget::GetTextureREye ( ) const
inline

Retrieves the right eye texture.

Returns
The texture

References m_fbRightEye.

◆ GetToneMapping()

ToneMappingSPtr Castor3D::RenderTarget::GetToneMapping ( ) const
inline
Returns
The tone mapping implementation.

References m_toneMapping.

◆ GetViewportType()

C3D_API eVIEWPORT_TYPE Castor3D::RenderTarget::GetViewportType ( ) const

Retrieves the eVIEWPORT_TYPE.

Returns
The eVIEWPORT_TYPE

◆ Initialise()

C3D_API void Castor3D::RenderTarget::Initialise ( uint32_t  p_index)

Initialisation function.

Remarks
Initialises the buffers
Parameters
[in]p_indexThe base texture index

◆ IsInitialised()

bool Castor3D::RenderTarget::IsInitialised ( ) const
inline

Retrieves the intialisation status.

Returns
The intialisation status

References m_initialised.

◆ IsMultisampling()

bool Castor3D::RenderTarget::IsMultisampling ( ) const
inline

Retrieves the multisampling status.

Returns
The multisampling status

References m_bMultisampling.

◆ IsUsingStereo()

bool Castor3D::RenderTarget::IsUsingStereo ( ) const
inline

Retrieves the stereo status.

Returns
true if stereo is used

References m_bStereo.

◆ Render()

C3D_API void Castor3D::RenderTarget::Render ( uint32_t  p_dFrameTime)

Renders one frame.

Parameters
[in]p_dFrameTimeThe time elapsed since the last frame was rendered

Rend une image

Parameters
[in]p_dFrameTimeLe temps écoulé depuis le rendu de la dernière frame

◆ SetCamera()

C3D_API void Castor3D::RenderTarget::SetCamera ( CameraSPtr  p_pCamera)

Sets the camera.

Remarks
Defines also LEye and REye cameras
Parameters
[in]p_pCameraThe new camera

◆ SetIntraOcularDistance()

C3D_API void Castor3D::RenderTarget::SetIntraOcularDistance ( real  p_rIod)

Defines the intra ocular distance.

Parameters
[in]p_rIodThe intra ocular distance

◆ SetPixelFormat()

void Castor3D::RenderTarget::SetPixelFormat ( Castor::ePIXEL_FORMAT  val)
inline

Sets the window pixel format.

Parameters
[in]valThe new window pixel format

References m_pixelFormat.

◆ SetSamplesCount()

void Castor3D::RenderTarget::SetSamplesCount ( int32_t  val)
inline

Sets the samples count.

Parameters
[in]valThe new samples count

References m_samplesCount.

◆ SetScene()

void Castor3D::RenderTarget::SetScene ( SceneSPtr  p_scene)
inline

Sets the Scene.

Parameters
[in]p_sceneThe new Scene

References m_pScene.

◆ SetSize()

C3D_API void Castor3D::RenderTarget::SetSize ( Castor::Size const &  p_size)

Sets the target dimensions.

Remarks
This method must be called before initialisation, otherwise it will have no effect.
Parameters
[in]p_sizeThe new dimensions.

Définit les dimensions la cible.

Remarks
Cette méthode doit être appelée avant l'initialisation, sinon elle n'aura aucun effet.
Parameters
[in]p_sizeLes nouvelles dimensions.

◆ SetStereo()

void Castor3D::RenderTarget::SetStereo ( bool  p_bStereo)
inline

Defines the stereo status.

Parameters
[in]p_bStereotrue if stereo is to be used

References m_bStereo.

◆ SetTechnique() [1/2]

C3D_API void Castor3D::RenderTarget::SetTechnique ( Castor::String const &  p_name,
Parameters const &  p_parameters 
)

Defines the RenderTechnique.

Parameters
[in]p_nameThe RenderTechnique name.
[in]p_parametersThe RenderTechnique parameters.

◆ SetTechnique() [2/2]

void Castor3D::RenderTarget::SetTechnique ( RenderTechniqueSPtr  p_pTechnique)
inline

Defines the RenderTechnique.

Parameters
[in]p_pTechniqueThe RenderTechnique

References m_renderTechnique.

◆ SetToneMappingType()

C3D_API void Castor3D::RenderTarget::SetToneMappingType ( eTONE_MAPPING_TYPE  p_type,
Parameters const &  p_parameters 
)

Sets the tone mapping implementation type.

Parameters
[in]p_typeThe type.
[in]p_parametersThe parameters.

◆ SetViewportType()

C3D_API void Castor3D::RenderTarget::SetViewportType ( eVIEWPORT_TYPE  val)

Sets the eVIEWPORT_TYPE.

Parameters
[in]valThe new eVIEWPORT_TYPE

Member Data Documentation

◆ DefaultSamplerName

C3D_API const Castor::String Castor3D::RenderTarget::DefaultSamplerName
static

The render target default sampler name.

◆ m_bMultisampling

bool Castor3D::RenderTarget::m_bMultisampling
protected

Tells whether or not to use multisampling.

Referenced by IsMultisampling().

◆ m_bStereo

bool Castor3D::RenderTarget::m_bStereo
protected

Tells the window uses stereoscopic rendering.

Referenced by IsUsingStereo(), and SetStereo().

◆ m_eTargetType

eTARGET_TYPE Castor3D::RenderTarget::m_eTargetType
protected

The render target type.

Referenced by GetTargetType().

◆ m_fbLeftEye

stFRAME_BUFFER Castor3D::RenderTarget::m_fbLeftEye
protected

Frame buffer for left/middle eye.

Referenced by GetFrameBufferLEye(), GetTexture(), and GetTextureLEye().

◆ m_fbRightEye

stFRAME_BUFFER Castor3D::RenderTarget::m_fbRightEye
protected

Frame buffer for right eye.

Referenced by GetFrameBufferREye(), and GetTextureREye().

◆ m_index

uint32_t Castor3D::RenderTarget::m_index
protected

This render target's index.

Referenced by GetIndex().

◆ m_initialised

bool Castor3D::RenderTarget::m_initialised
protected

Tells if the target is initalised.

Referenced by IsInitialised().

◆ m_pCamera

CameraWPtr Castor3D::RenderTarget::m_pCamera
protected

The camera used to render the scene.

Referenced by GetCamera().

◆ m_pCameraLEye

CameraWPtr Castor3D::RenderTarget::m_pCameraLEye
protected

The left eye camera used to render the stereo scene.

Referenced by GetCameraLEye().

◆ m_pCameraREye

CameraWPtr Castor3D::RenderTarget::m_pCameraREye
protected

The right eye camera used to render the stereo scene.

Referenced by GetCameraREye().

◆ m_pCurrentCamera

CameraWPtr Castor3D::RenderTarget::m_pCurrentCamera
protected

The currently active camera (useful in stereoscopic rendering)

◆ m_pCurrentFrameBuffer

FrameBufferWPtr Castor3D::RenderTarget::m_pCurrentFrameBuffer
protected

The currently active frame buffer (useful in stereoscopic rendering)

Referenced by GetFrameBuffer().

◆ m_pixelFormat

Castor::ePIXEL_FORMAT Castor3D::RenderTarget::m_pixelFormat
protected

The target display format.

Referenced by GetPixelFormat(), and SetPixelFormat().

◆ m_postEffects

PostEffectPtrArray Castor3D::RenderTarget::m_postEffects
protected

The post effects.

Referenced by AddPostEffect(), and GetPostEffects().

◆ m_pScene

SceneWPtr Castor3D::RenderTarget::m_pScene
protected

The scene rendered in this render target.

Referenced by GetScene(), and SetScene().

◆ m_renderTechnique

RenderTechniqueSPtr Castor3D::RenderTarget::m_renderTechnique
protected

The technique used to render this target.

Referenced by GetTechnique(), and SetTechnique().

◆ m_rIntraOcularDistance

real Castor3D::RenderTarget::m_rIntraOcularDistance
protected

Intra ocular distance used in stereoscopic rendering.

Referenced by GetIntraOcularDistance().

◆ m_samplesCount

int32_t Castor3D::RenderTarget::m_samplesCount
protected

Defines the samples count if multisampling is activated.

Referenced by GetSamplesCount(), and SetSamplesCount().

◆ m_size

Castor::Size Castor3D::RenderTarget::m_size
protected

The target size.

Referenced by GetSize().

◆ m_techniqueName

Castor::String Castor3D::RenderTarget::m_techniqueName
protected

The render technique name.

◆ m_techniqueParameters

Parameters Castor3D::RenderTarget::m_techniqueParameters
protected

The render technique parameters.

◆ m_toneMapping

ToneMappingSPtr Castor3D::RenderTarget::m_toneMapping
protected

The tone mapping implementation.

Referenced by GetToneMapping().

◆ m_toneMappingFactory

ToneMappingFactory Castor3D::RenderTarget::m_toneMappingFactory
protected

The tone mapping implementation.

◆ m_wpDepthStencilState

DepthStencilStateWPtr Castor3D::RenderTarget::m_wpDepthStencilState
protected

Depth and stencil buffers states.

Referenced by GetDepthStencilState().

◆ m_wpRasteriserState

RasteriserStateWPtr Castor3D::RenderTarget::m_wpRasteriserState
protected

Rasteriser states.

Referenced by GetRasteriserState().

◆ sm_uiCount

uint32_t Castor3D::RenderTarget::sm_uiCount
staticprotected

The number of actually created render targets.


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