PixelLightAPI  .
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes
PLScene::SCRenderToTexture Class Reference

Render to texture scene container. More...

#include <SCRenderToTexture.h>

Inheritance diagram for PLScene::SCRenderToTexture:
Inheritance graph
[legend]

List of all members.

Public Types

enum  EDebugFlags { DebugNoTexturePreview = 1<<8 }
 Scene node debug flags (SceneNode debug flags extension) More...

Public Member Functions

 pl_enum (EDebugFlags) pl_enum_base(SceneContainer
 Surface formats.
 pl_enum (EFormat) pl_enum_value(R8G8B8
bits per green and blue component pl_enum_value (R8G8B8A8,"8 bits per red, green, blue and alpha component") pl_enum_endenum ESurfaceFlags
 Surface flags.
 pl_enum (ESurfaceFlags) pl_enum_value(Depth
Surface has a depth buffer pl_enum_value (Stencil,"Surface has a stencil buffer") pl_enum_value(Mipmaps
Surface has a depth buffer
Surface has mipmaps
pl_enum_end 
pl_class (PLS_RTTI_EXPORT, SCRenderToTexture,"PLScene", PLScene::SceneContainer,"Render to texture scene container") pl_attribute(Cube
Surface has a depth buffer
Surface has mipmaps
pl_enum_end Render to cube
texture If only Width is used
which must be a power of 
pl_attribute (Width, PLCore::uint16, 512, ReadWrite, GetSet,"Texture width","Min='16'") pl_attribute(Height
Surface has a depth buffer
Surface has mipmaps
pl_enum_end Render to cube
texture If only Width is used
which must be a power of
Texture there s no only used
if the painter is derived of 
pl_attribute (SceneName, PLCore::String,"Parent", ReadWrite, GetSet,"Name of the scene to renderer, only used if the painter is derived of 'SPScene'","") pl_attribute(CameraName
Surface has a depth buffer
Surface has mipmaps
pl_enum_end Render to cube
texture If only Width is used
which must be a power of
Texture there s no only used
if the painter is derived of
Name of the camera to only
used if the painter is derived
of 
pl_attribute (Flags, pl_flag_type(EFlags), NoCulling|NoRecursion, ReadWrite, GetSet,"Flags","") pl_attribute(DebugFlags
Surface has a depth buffer
Surface has mipmaps
pl_enum_end Render to cube
texture If only Width is used
which must be a power of
Texture there s no only used
if the painter is derived of
Name of the camera to only
used if the painter is derived
of 
pl_flag_type (EDebugFlags)
Surface has a depth buffer
Surface has mipmaps
pl_enum_end Render to cube
texture If only Width is used
which must be a power of
Texture there s no only used
if the painter is derived of
Name of the camera to only
used if the painter is derived
of Debug pl_constructor_0(DefaultConstructor,"Default
constructor","") pl_class_end
public PLS_API void 
SetCube (bool bValue)
PLS_API PLCore::uint16 GetWidth () const
PLS_API void SetWidth (PLCore::uint16 nValue)
PLS_API PLCore::uint16 GetHeight () const
PLS_API void SetHeight (PLCore::uint16 nValue)
PLS_API EFormat GetFormat () const
PLS_API void SetFormat (EFormat nValue)
PLS_API PLCore::uint32 GetSurfaceFlags () const
PLS_API void SetSurfaceFlags (PLCore::uint32 nValue)
PLS_API PLCore::String GetTextureName () const
PLS_API void SetTextureName (const PLCore::String &sValue)
PLS_API PLCore::String GetPainter () const
PLS_API void SetPainter (const PLCore::String &sValue)
PLS_API PLCore::String GetSceneRenderer () const
PLS_API void SetSceneRenderer (const PLCore::String &sValue)
PLS_API PLCore::String GetSceneName () const
PLS_API void SetSceneName (const PLCore::String &sValue)
PLS_API SCRenderToTexture ()
 Default constructor.
virtual PLS_API ~SCRenderToTexture ()
 Destructor.
PLS_API
PLRenderer::SurfaceTextureBuffer
GetSurfaceTextureBuffer () const
 Returns the texture buffer surface we render in.
PLS_API PLRenderer::TextureGetTexture () const
 Returns the resulting texture.
virtual PLS_API void DrawPre (PLRenderer::Renderer &cRenderer, const VisNode *pVisNode=nullptr) override
 This function is called before any solid parts of the scene are drawn.
virtual PLS_API void DrawDebug (PLRenderer::Renderer &cRenderer, const VisNode *pVisNode=nullptr) override
 This function is called when the debug parts of the scene are drawn.

Public Attributes

bits per red
Surface has a depth buffer
Surface has mipmaps
pl_enum_end 
bool
Surface has a depth buffer
Surface has mipmaps
pl_enum_end 
false
Surface has a depth buffer
Surface has mipmaps
pl_enum_end 
ReadWrite
Surface has a depth buffer
Surface has mipmaps
pl_enum_end 
GetSet
Surface has a depth buffer
Surface has mipmaps
pl_enum_end Render to cube
texture If 
true
Surface has a depth buffer
Surface has mipmaps
pl_enum_end Render to cube
texture If only Width is used
which must be a power of 
two
Surface has a depth buffer
Surface has mipmaps
pl_enum_end Render to cube
texture If only Width is used
which must be a power of 
ReadWrite
Surface has a depth buffer
Surface has mipmaps
pl_enum_end Render to cube
texture If only Width is used
which must be a power of 
GetSet
Surface has a depth buffer
Surface has mipmaps
pl_enum_end Render to cube
texture If only Width is used
which must be a power of
Texture 
height
Surface has a depth buffer
Surface has mipmaps
pl_enum_end Render to cube
texture If only Width is used
which must be a power of
Texture 
Min
Surface has a depth buffer
Surface has mipmaps
pl_enum_end Render to cube
texture If only Width is used
which must be a power of
Texture 
if
Surface has a depth buffer
Surface has mipmaps
pl_enum_end Render to cube
texture If only Width is used
which must be a power of
Texture there s no 
limitation
Surface has a depth buffer
Surface has mipmaps
pl_enum_end Render to cube
texture If only Width is used
which must be a power of
Texture there s no 
Min = ", ReadWrite, GetSet, "Name of the used scene renderer
Surface has a depth buffer
Surface has mipmaps
pl_enum_end Render to cube
texture If only Width is used
which must be a power of
Texture there s no only used
if the painter is derived of 
SPScene
Surface has a depth buffer
Surface has mipmaps
pl_enum_end Render to cube
texture If only Width is used
which must be a power of
Texture there s no only used
if the painter is derived of 
ReadWrite
Surface has a depth buffer
Surface has mipmaps
pl_enum_end Render to cube
texture If only Width is used
which must be a power of
Texture there s no only used
if the painter is derived of 
DirectValue
Surface has a depth buffer
Surface has mipmaps
pl_enum_end Render to cube
texture If only Width is used
which must be a power of
Texture there s no only used
if the painter is derived of
Name of the camera to 
use
Surface has a depth buffer
Surface has mipmaps
pl_enum_end Render to cube
texture If only Width is used
which must be a power of
Texture there s no only used
if the painter is derived of
Name of the camera to only
used if the painter is derived
of 
SPScene
Surface has a depth buffer
Surface has mipmaps
pl_enum_end Render to cube
texture If only Width is used
which must be a power of
Texture there s no only used
if the painter is derived of
Name of the camera to only
used if the painter is derived
of 
ReadWrite
Surface has a depth buffer
Surface has mipmaps
pl_enum_end Render to cube
texture If only Width is used
which must be a power of
Texture there s no only used
if the painter is derived of
Name of the camera to only
used if the painter is derived
of 
GetSet
Surface has a depth buffer
Surface has mipmaps
pl_enum_end Render to cube
texture If only Width is used
which must be a power of
Texture there s no only used
if the painter is derived of
Name of the camera to only
used if the painter is derived
of Debug 
flags

Protected Member Functions

virtual PLS_API void InitFunction () override
 This function is called when the scene node gets initialized.

Protected Attributes

bool m_bCube
PLCore::uint16 m_nWidth
PLCore::uint16 m_nHeight
EFormat m_nFormat
PLCore::uint32 m_nSurfaceFlags
PLCore::String m_sTextureName
PLCore::String m_sPainter
PLCore::String m_sSceneRenderer
PLCore::String m_sSceneName
PLCore::uint64 m_nFPSLimitLastTime
PLRenderer::SurfaceTextureBufferm_pSurfaceTextureBuffer
PLRenderer::TextureHandlerm_pTextureHandler

Detailed Description

Render to texture scene container.

Remarks:
This scene container can render it's sub-scene or another linked scene using a given camera into a texture. If you want to render the scene into a cube texture, set the variable 'Cube' to 'true'. In this case, only the position of the given camera is used. This for instance can be used to render correct dynamic reflections.
Note:
  • For 2D textures, non-power-of-two dimensions are supported
  • If a camera scene node is used and this node is inactive, the texture is not updated

Member Enumeration Documentation

Scene node debug flags (SceneNode debug flags extension)

Enumerator:
DebugNoTexturePreview 

Do not draw the texture preview


Constructor & Destructor Documentation

Default constructor.

virtual PLS_API PLScene::SCRenderToTexture::~SCRenderToTexture ( ) [virtual]

Destructor.


Member Function Documentation

Surface formats.

< 8 bits per red, green and blue component

< 8 bits per red, green, blue and alpha component

bits per green and blue component PLScene::SCRenderToTexture::pl_enum_value ( R8G8B8A8  ,
"8 bits per  red,
green  ,
blue and alpha component"   
) [inline]

Surface flags.

< Surface has a depth buffer

< Surface has a stencil buffer

< Surface has mipmaps

Surface has a depth buffer PLScene::SCRenderToTexture::pl_enum_value ( Stencil  ,
"Surface has a stencil buffer"   
)
Surface has a depth buffer Surface has mipmaps pl_enum_end PLScene::SCRenderToTexture::pl_class ( PLS_RTTI_EXPORT  ,
SCRenderToTexture  ,
"PLScene"  ,
PLScene::SceneContainer  ,
"Render to texture scene container"   
)
Surface has a depth buffer Surface has mipmaps pl_enum_end Render to cube texture If only Width is used which must be a power of PLScene::SCRenderToTexture::pl_attribute ( Width  ,
PLCore::uint16  ,
512  ,
ReadWrite  ,
GetSet  ,
"Texture width"   
)
Surface has a depth buffer Surface has mipmaps pl_enum_end Render to cube texture If only Width is used which must be a power of Texture there s no only used if the painter is derived of PLScene::SCRenderToTexture::pl_attribute ( SceneName  ,
PLCore::String  ,
"Parent"  ,
ReadWrite  ,
GetSet  ,
"Name of the scene to  renderer,
only used if the painter is derived of 'SPScene'"  ,
""   
)
Surface has a depth buffer Surface has mipmaps pl_enum_end Render to cube texture If only Width is used which must be a power of Texture there s no only used if the painter is derived of Name of the camera to only used if the painter is derived of PLScene::SCRenderToTexture::pl_attribute ( Flags  ,
pl_flag_type(EFlags ,
NoCulling NoRecursion,
ReadWrite  ,
GetSet  ,
"Flags"  ,
""   
)
Surface has a depth buffer Surface has mipmaps pl_enum_end Render to cube texture If only Width is used which must be a power of Texture there s no only used if the painter is derived of Name of the camera to only used if the painter is derived of PLScene::SCRenderToTexture::pl_flag_type ( EDebugFlags  )
Surface has a depth buffer Surface has mipmaps pl_enum_end Render to cube texture If only Width is used which must be a power of Texture there s no only used if the painter is derived of Name of the camera to only used if the painter is derived of Debug pl_constructor_0 (DefaultConstructor, "Default constructor", "") pl_class_end public PLS_API void PLScene::SCRenderToTexture::SetCube ( bool  bValue)
PLS_API PLCore::uint16 PLScene::SCRenderToTexture::GetWidth ( ) const
PLS_API void PLScene::SCRenderToTexture::SetWidth ( PLCore::uint16  nValue)
PLS_API PLCore::uint16 PLScene::SCRenderToTexture::GetHeight ( ) const
PLS_API void PLScene::SCRenderToTexture::SetHeight ( PLCore::uint16  nValue)
PLS_API EFormat PLScene::SCRenderToTexture::GetFormat ( ) const
PLS_API void PLScene::SCRenderToTexture::SetFormat ( EFormat  nValue)
PLS_API PLCore::uint32 PLScene::SCRenderToTexture::GetSurfaceFlags ( ) const
PLS_API void PLScene::SCRenderToTexture::SetSurfaceFlags ( PLCore::uint32  nValue)
PLS_API void PLScene::SCRenderToTexture::SetPainter ( const PLCore::String sValue)
PLS_API void PLScene::SCRenderToTexture::SetSceneName ( const PLCore::String sValue)

Returns the texture buffer surface we render in.

Returns:
The texture buffer surface we render in, a null pointer on error

Returns the resulting texture.

Returns:
The resulting texture, a null pointer on error
virtual PLS_API void PLScene::SCRenderToTexture::DrawPre ( PLRenderer::Renderer cRenderer,
const VisNode pVisNode = nullptr 
) [override, virtual]

This function is called before any solid parts of the scene are drawn.

Parameters:
[in]cRendererThe used renderer
[in]pVisNodeThe current visibility node of this scene node, can be a null pointer
Remarks:
The DrawPre(), DrawSolid(), DrawTransparent(), DrawDebug() and DrawPost() allows custom draw calls inside a scene rendering process. The function names indicate when each function is called during scene rendering. It's not predictable which render states are currently set if these functions are called and these draw functions will NOT interact automatically with 'uniform lighting and shadowing' performed on nodes providing a mesh. (GetMeshHandler()) So, try to avoid using these functions whenever possible and provide a scene node mesh instead. The default implementation does only informing the listeners, functions can be implemented in derived classes - only DrawDebug() provides a default implementation to draw for instance the bounding box of the scene node. From outside, this draw functions should ONLY be called if a node is active & visible & 'on the screen' & the draw function of the function is set. (see GetDrawFunctionFlags()) It's recommended to call these functions ONLY from inside a scene renderer! If you don't call the base implementation of a scene node draw function inside your derived draw function or if you are rendering the mesh of the node, you should call SetDraw() to mark this node as drawn. After the scene node was updated, this drawn-flag is reset automatically. Use this this information to avoid useless scene node updates. For instance do not update particle effects or other dynamic meshes if they are currently 'invisible'.
Note:
  • The default implementation only emits the SignalDrawPre signal
  • Should only be called if the draw function flag 'UseDrawPre' is set

Reimplemented from PLScene::SceneNode.

virtual PLS_API void PLScene::SCRenderToTexture::DrawDebug ( PLRenderer::Renderer cRenderer,
const VisNode pVisNode = nullptr 
) [override, virtual]

This function is called when the debug parts of the scene are drawn.

Parameters:
[in]cRendererThe used renderer
[in]pVisNodeThe current visibility node of this scene node, can be a null pointer
Note:
  • Should only be called if the 'UseDrawDebug' draw flag and the 'DebugEnabled' debug flag is set
  • Beside drawing scene node stuff, the default implementation emits the SignalDrawDebug signal
See also:

Reimplemented from PLScene::SceneNode.

virtual PLS_API void PLScene::SCRenderToTexture::InitFunction ( ) [override, protected, virtual]

This function is called when the scene node gets initialized.

Reimplemented from PLScene::SceneContainer.


Member Data Documentation

Surface has a depth buffer Surface has mipmaps pl_enum_end PLScene::SCRenderToTexture::bool
Surface has a depth buffer Surface has mipmaps pl_enum_end PLScene::SCRenderToTexture::false
Surface has a depth buffer Surface has mipmaps pl_enum_end PLScene::SCRenderToTexture::ReadWrite

Reimplemented from PLScene::SceneNode.

Surface has a depth buffer Surface has mipmaps pl_enum_end PLScene::SCRenderToTexture::GetSet

Reimplemented from PLScene::SceneNode.

Surface has a depth buffer Surface has mipmaps pl_enum_end Render to cube texture If PLScene::SCRenderToTexture::true
Surface has a depth buffer Surface has mipmaps pl_enum_end Render to cube texture If only Width is used which must be a power of PLScene::SCRenderToTexture::two
Surface has a depth buffer Surface has mipmaps pl_enum_end Render to cube texture If only Width is used which must be a power of PLScene::SCRenderToTexture::ReadWrite

Reimplemented from PLScene::SceneNode.

Surface has a depth buffer Surface has mipmaps pl_enum_end Render to cube texture If only Width is used which must be a power of PLScene::SCRenderToTexture::GetSet

Reimplemented from PLScene::SceneNode.

Surface has a depth buffer Surface has mipmaps pl_enum_end Render to cube texture If only Width is used which must be a power of Texture PLScene::SCRenderToTexture::height
Surface has a depth buffer Surface has mipmaps pl_enum_end Render to cube texture If only Width is used which must be a power of Texture PLScene::SCRenderToTexture::Min
Initial value:
")
        pl_attribute(FPSLimit,      float,                          30.0f,                  ReadWrite,  DirectValue,    "Frames per second limitation
Surface has a depth buffer Surface has mipmaps pl_enum_end Render to cube texture If only Width is used which must be a power of Texture PLScene::SCRenderToTexture::if
Surface has a depth buffer Surface has mipmaps pl_enum_end Render to cube texture If only Width is used which must be a power of Texture there s no PLScene::SCRenderToTexture::limitation
Surface has a depth buffer Surface has mipmaps pl_enum_end Render to cube texture If only Width is used which must be a power of Texture there s no PLScene::SCRenderToTexture::Min = ", ReadWrite, GetSet, "Name of the used scene renderer
Surface has a depth buffer Surface has mipmaps pl_enum_end Render to cube texture If only Width is used which must be a power of Texture there s no only used if the painter is derived of PLScene::SCRenderToTexture::SPScene
Surface has a depth buffer Surface has mipmaps pl_enum_end Render to cube texture If only Width is used which must be a power of Texture there s no only used if the painter is derived of PLScene::SCRenderToTexture::ReadWrite

Reimplemented from PLScene::SceneNode.

Surface has a depth buffer Surface has mipmaps pl_enum_end Render to cube texture If only Width is used which must be a power of Texture there s no only used if the painter is derived of PLScene::SCRenderToTexture::DirectValue
Surface has a depth buffer Surface has mipmaps pl_enum_end Render to cube texture If only Width is used which must be a power of Texture there s no only used if the painter is derived of Name of the camera to PLScene::SCRenderToTexture::use
Surface has a depth buffer Surface has mipmaps pl_enum_end Render to cube texture If only Width is used which must be a power of Texture there s no only used if the painter is derived of Name of the camera to only used if the painter is derived of PLScene::SCRenderToTexture::SPScene
Surface has a depth buffer Surface has mipmaps pl_enum_end Render to cube texture If only Width is used which must be a power of Texture there s no only used if the painter is derived of Name of the camera to only used if the painter is derived of PLScene::SCRenderToTexture::ReadWrite

Reimplemented from PLScene::SceneNode.

Surface has a depth buffer Surface has mipmaps pl_enum_end Render to cube texture If only Width is used which must be a power of Texture there s no only used if the painter is derived of Name of the camera to only used if the painter is derived of PLScene::SCRenderToTexture::GetSet

Reimplemented from PLScene::SceneNode.

Surface has a depth buffer Surface has mipmaps pl_enum_end Render to cube texture If only Width is used which must be a power of Texture there s no only used if the painter is derived of Name of the camera to only used if the painter is derived of Debug PLScene::SCRenderToTexture::flags

Reimplemented from PLScene::SceneNode.

Render to cube texture? If 'true', only 'Width' is used which must be a power of two

PLCore::uint16 PLScene::SCRenderToTexture::m_nWidth [protected]

Texture width

PLCore::uint16 PLScene::SCRenderToTexture::m_nHeight [protected]

Texture height

Texture format

PLCore::uint32 PLScene::SCRenderToTexture::m_nSurfaceFlags [protected]

Texture surface flags

Name of the resulting texture

Name of the used surface painter

Name of the used scene renderer, only used if the painter is derived of 'SPScene'

Name of the scene to renderer, only used if the painter is derived of 'SPScene'

Time when the last update was done

Render to texture buffer, can be a null pointer

The resulting texture (ALWAYS valid!)


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


PixelLight PixelLight 0.9.10-R1
Copyright (C) 2002-2011 by The PixelLight Team
Last modified Fri Dec 23 2011 15:51:25
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported