Castor3D  ..
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Castor3D::RenderTechnique Class Referenceabstract

Render technique base class. More...

+ Inheritance diagram for Castor3D::RenderTechnique:
+ Collaboration diagram for Castor3D::RenderTechnique:

Classes

struct  stFRAME_BUFFER
 Internal struct holding a complete frame buffer. More...
 
struct  stRENDER_NODES
 The render nodes for a specific scene. More...
 
struct  stSCENE_RENDER_NODES
 The render nodes for a specific scene. More...
 

Public Member Functions

virtual C3D_API ~RenderTechnique ()
 Destructor. More...
 
C3D_API bool Create ()
 Creation function. More...
 
C3D_API void Destroy ()
 Destruction function. More...
 
C3D_API bool Initialise (uint32_t &p_index)
 Initialisation function. More...
 
C3D_API void Cleanup ()
 Cleanup function. More...
 
C3D_API void Update ()
 Update function. More...
 
C3D_API void AddScene (Scene &p_scene)
 Adds a scene rendered through this technique. More...
 
C3D_API void Render (Scene &p_scene, Camera &p_camera, uint32_t p_frameTime)
 Render function. More...
 
C3D_API Castor::String GetPixelShaderSource (uint32_t p_flags) const
 Retrieves the pixel shader source matching the given flags. More...
 
Castor::String const & GetName () const
 
Castor::Size const & GetSize () const
 
DynamicTexture const & GetResult () const
 

Protected Member Functions

C3D_API RenderTechnique (Castor::String const &p_name, RenderTarget &p_renderTarget, RenderSystem *p_renderSystem, Parameters const &p_params)
 Constructor. More...
 
virtual C3D_API Castor::String DoGetPixelShaderSource (uint32_t p_flags) const
 Retrieves the pixel shader source matching the given flags. More...
 
virtual C3D_API bool DoCreate ()=0
 Creation function. More...
 
virtual C3D_API void DoDestroy ()=0
 Destruction function. More...
 
virtual C3D_API bool DoInitialise (uint32_t &p_index)=0
 Initialisation function. More...
 
virtual C3D_API void DoCleanup ()=0
 Cleanup function. More...
 
virtual C3D_API bool DoBeginRender (Scene &p_scene)=0
 Render begin function. More...
 
virtual C3D_API void DoRender (stSCENE_RENDER_NODES &p_nodes, Camera &p_camera, uint32_t p_frameTime)=0
 Render function. More...
 
virtual C3D_API void DoEndRender (Scene &p_scene)=0
 Render end function. More...
 
C3D_API void DoSortRenderNodes (stSCENE_RENDER_NODES &p_nodes)
 Sorts scene render nodes. More...
 
C3D_API void DoBindPass (Scene &p_scene, Pipeline &p_pipeline, GeometryRenderNode &p_node, uint64_t p_excludedMtxFlags)
 Binds the given pass. More...
 
C3D_API void DoUnbindPass (Scene &p_scene, GeometryRenderNode &p_renderNode)
 Unbinds the render node's pass. More...
 
C3D_API void DoBindPass (Scene &p_scene, Pipeline &p_pipeline, BillboardRenderNode &p_node, uint64_t p_excludedMtxFlags)
 Binds the given pass. More...
 
C3D_API void DoUnbindPass (Scene &p_scene, BillboardRenderNode &p_renderNode)
 Unbinds the render node's pass. More...
 
C3D_API void DoRenderSubmeshesNonInstanced (Scene &p_scene, Camera const &p_camera, Pipeline &p_pipeline, SubmeshRenderNodesByProgramMap &p_nodes)
 Renders non instanced submeshes. More...
 
C3D_API void DoRenderSubmeshesInstanced (Scene &p_scene, Camera const &p_camera, Pipeline &p_pipeline, SubmeshRenderNodesByProgramMap &p_nodes)
 Renders instanced submeshes. More...
 
C3D_API void DoRenderSubmeshesNonInstanced (Scene &p_scene, Camera const &p_camera, Pipeline &p_pipeline, GeometryRenderNodeByDistanceMMap &p_nodes)
 Renders distance sorted submeshes. More...
 
C3D_API void DoRenderSubmeshes (Scene &p_scene, Camera const &p_camera, Pipeline &p_pipeline, SubmeshRenderNodesByProgramMap &p_nodes)
 Renders submeshes. More...
 
C3D_API void DoRenderBillboards (Scene &p_scene, Camera const &p_camera, Pipeline &p_pipeline, BillboardRenderNodeByDistanceMMap &p_nodes)
 Renders billboards. More...
 
C3D_API void DoRenderBillboards (Scene &p_scene, Camera const &p_camera, Pipeline &p_pipeline, BillboardRenderNodesByProgramMap &p_nodes)
 Renders billboards. More...
 
C3D_API void DoResortAlpha (SubmeshRenderNodesByProgramMap p_input, Camera const &p_camera, GeometryRenderNodeByDistanceMMap &p_output)
 Sorts the given render nodes by distance to the camera. More...
 
C3D_API void DoResortAlpha (BillboardRenderNodesByProgramMap p_input, Camera const &p_camera, BillboardRenderNodeByDistanceMMap &p_output)
 Sorts the given render nodes by distance to the camera. More...
 
C3D_API void DoRender (Castor::Size const &p_size, stSCENE_RENDER_NODES &p_nodes, Camera &p_camera, uint32_t p_frameTime)
 Render function. More...
 

Protected Attributes

Castor::String m_name
 The technique name. More...
 
bool m_initialised
 The technique intialisation status. More...
 
RenderTargetm_renderTarget
 The parent render target. More...
 
RenderSystemm_renderSystem
 The render system. More...
 
Castor::Size m_size
 The render area dimension. More...
 
std::map< Castor::String, stSCENE_RENDER_NODESm_scenesRenderNodes
 The scenes rendered through this technique. More...
 
stFRAME_BUFFER m_frameBuffer
 The HDR frame buffer. More...
 
RasteriserStateWPtr m_wpFrontRasteriserState
 The rasteriser state to cull front faces. More...
 
RasteriserStateWPtr m_wpBackRasteriserState
 The rasteriser state to cull back faces. More...
 

Detailed Description

Render technique base class.

Author
Sylvain DOREMUS
Version
0.7.0.0
Date
12/11/2012
Remarks
A render technique is the description of a way to render a render target

Constructor & Destructor Documentation

◆ RenderTechnique()

C3D_API Castor3D::RenderTechnique::RenderTechnique ( Castor::String const &  p_name,
RenderTarget p_renderTarget,
RenderSystem p_renderSystem,
Parameters const &  p_params 
)
protected

Constructor.

Parameters
[in]p_nameThe technique name
[in]p_renderTargetThe render target for this technique
[in]p_renderSystemThe render system
[in]p_paramsThe technique parameters

◆ ~RenderTechnique()

virtual C3D_API Castor3D::RenderTechnique::~RenderTechnique ( )
virtual

Destructor.

Member Function Documentation

◆ AddScene()

C3D_API void Castor3D::RenderTechnique::AddScene ( Scene p_scene)

Adds a scene rendered through this technique.

Parameters
[in]p_sceneThe scene.

◆ Cleanup()

C3D_API void Castor3D::RenderTechnique::Cleanup ( )

Cleanup function.

◆ Create()

C3D_API bool Castor3D::RenderTechnique::Create ( )

Creation function.

Returns
true if OK

◆ Destroy()

C3D_API void Castor3D::RenderTechnique::Destroy ( )

Destruction function.

◆ DoBeginRender()

virtual C3D_API bool Castor3D::RenderTechnique::DoBeginRender ( Scene p_scene)
protectedpure virtual

Render begin function.

Remarks
At the end of this method, the frame buffer that will receive draw calls must be bound.
Parameters
[in]p_sceneThe scene to render
Returns
true if ok.

◆ DoBindPass() [1/2]

C3D_API void Castor3D::RenderTechnique::DoBindPass ( Scene p_scene,
Pipeline p_pipeline,
GeometryRenderNode p_node,
uint64_t  p_excludedMtxFlags 
)
protected

Binds the given pass.

Parameters
[in]p_sceneThe rendered scene.
[in]p_pipelineThe render pipeline.
[in]p_nodeThe render node.
[in]p_excludedMtxFlagsCombination of MASK_MTXMODE, to be excluded from matrices used in program.

◆ DoBindPass() [2/2]

C3D_API void Castor3D::RenderTechnique::DoBindPass ( Scene p_scene,
Pipeline p_pipeline,
BillboardRenderNode p_node,
uint64_t  p_excludedMtxFlags 
)
protected

Binds the given pass.

Parameters
[in]p_sceneThe rendered scene.
[in]p_pipelineThe render pipeline.
[in]p_nodeThe render node.
[in]p_excludedMtxFlagsCombination of MASK_MTXMODE, to be excluded from matrices used in program.

◆ DoCleanup()

virtual C3D_API void Castor3D::RenderTechnique::DoCleanup ( )
protectedpure virtual

Cleanup function.

◆ DoCreate()

virtual C3D_API bool Castor3D::RenderTechnique::DoCreate ( )
protectedpure virtual

Creation function.

Returns
true if OK

◆ DoDestroy()

virtual C3D_API void Castor3D::RenderTechnique::DoDestroy ( )
protectedpure virtual

Destruction function.

◆ DoEndRender()

virtual C3D_API void Castor3D::RenderTechnique::DoEndRender ( Scene p_scene)
protectedpure virtual

Render end function.

Remarks
At the end of this method, no frame buffer must be bound.
Parameters
[in]p_sceneThe scene to render

◆ DoGetPixelShaderSource()

virtual C3D_API Castor::String Castor3D::RenderTechnique::DoGetPixelShaderSource ( uint32_t  p_flags) const
protectedvirtual

Retrieves the pixel shader source matching the given flags.

Parameters
[in]p_flagsA combination of eTEXTURE_CHANNEL

◆ DoInitialise()

virtual C3D_API bool Castor3D::RenderTechnique::DoInitialise ( uint32_t &  p_index)
protectedpure virtual

Initialisation function.

Parameters
[in]p_indexThe base texture index
Returns
true if ok

◆ DoRender() [1/2]

virtual C3D_API void Castor3D::RenderTechnique::DoRender ( stSCENE_RENDER_NODES p_nodes,
Camera p_camera,
uint32_t  p_frameTime 
)
protectedpure virtual

Render function.

Parameters
[in]p_nodesThe nodes to render.
[in]p_cameraThe camera through which the scene is viewed.
[in]p_frameTimeThe time elapsed since last frame was rendered.
Returns
true if ok

◆ DoRender() [2/2]

C3D_API void Castor3D::RenderTechnique::DoRender ( Castor::Size const &  p_size,
stSCENE_RENDER_NODES p_nodes,
Camera p_camera,
uint32_t  p_frameTime 
)
protected

Render function.

Parameters
[in]p_sizeThe render target dimensions.
[in]p_nodesThe scene render nodes.
[in]p_cameraThe camera through which the scene is viewed.
[in]p_frameTimeThe time elapsed since last frame was rendered.
Returns
true if ok

◆ DoRenderBillboards() [1/2]

C3D_API void Castor3D::RenderTechnique::DoRenderBillboards ( Scene p_scene,
Camera const &  p_camera,
Pipeline p_pipeline,
BillboardRenderNodeByDistanceMMap &  p_nodes 
)
protected

Renders billboards.

Parameters
[in]p_sceneThe rendered scene.
[in]p_cameraThe camera through which the scene is viewed.
[in]p_pipelineThe render pipeline.
[in]p_nodesThe render nodes.

◆ DoRenderBillboards() [2/2]

C3D_API void Castor3D::RenderTechnique::DoRenderBillboards ( Scene p_scene,
Camera const &  p_camera,
Pipeline p_pipeline,
BillboardRenderNodesByProgramMap &  p_nodes 
)
protected

Renders billboards.

Parameters
[in]p_sceneThe rendered scene.
[in]p_cameraThe camera through which the scene is viewed.
[in]p_pipelineThe render pipeline.
[in]p_nodesThe render nodes.

◆ DoRenderSubmeshes()

C3D_API void Castor3D::RenderTechnique::DoRenderSubmeshes ( Scene p_scene,
Camera const &  p_camera,
Pipeline p_pipeline,
SubmeshRenderNodesByProgramMap &  p_nodes 
)
protected

Renders submeshes.

Parameters
[in]p_sceneThe rendered scene.
[in]p_cameraThe camera through which the scene is viewed.
[in]p_pipelineThe render pipeline.
[in]p_nodesThe render nodes.

◆ DoRenderSubmeshesInstanced()

C3D_API void Castor3D::RenderTechnique::DoRenderSubmeshesInstanced ( Scene p_scene,
Camera const &  p_camera,
Pipeline p_pipeline,
SubmeshRenderNodesByProgramMap &  p_nodes 
)
protected

Renders instanced submeshes.

Parameters
[in]p_sceneThe rendered scene.
[in]p_cameraThe camera through which the scene is viewed.
[in]p_pipelineThe render pipeline.
[in]p_nodesThe render nodes.

◆ DoRenderSubmeshesNonInstanced() [1/2]

C3D_API void Castor3D::RenderTechnique::DoRenderSubmeshesNonInstanced ( Scene p_scene,
Camera const &  p_camera,
Pipeline p_pipeline,
SubmeshRenderNodesByProgramMap &  p_nodes 
)
protected

Renders non instanced submeshes.

Parameters
[in]p_sceneThe rendered scene.
[in]p_cameraThe camera through which the scene is viewed.
[in]p_pipelineThe render pipeline.
[in]p_nodesThe render nodes.

◆ DoRenderSubmeshesNonInstanced() [2/2]

C3D_API void Castor3D::RenderTechnique::DoRenderSubmeshesNonInstanced ( Scene p_scene,
Camera const &  p_camera,
Pipeline p_pipeline,
GeometryRenderNodeByDistanceMMap &  p_nodes 
)
protected

Renders distance sorted submeshes.

Parameters
[in]p_sceneThe rendered scene.
[in]p_cameraThe camera through which the scene is viewed.
[in]p_pipelineThe render pipeline.
[in]p_nodesThe render nodes.

◆ DoResortAlpha() [1/2]

C3D_API void Castor3D::RenderTechnique::DoResortAlpha ( SubmeshRenderNodesByProgramMap  p_input,
Camera const &  p_camera,
GeometryRenderNodeByDistanceMMap &  p_output 
)
protected

Sorts the given render nodes by distance to the camera.

Parameters
[in]p_inputThe unsorted render nodes.
[in]p_cameraThe camera.
[out]p_outputThe sorted render nodes.

◆ DoResortAlpha() [2/2]

C3D_API void Castor3D::RenderTechnique::DoResortAlpha ( BillboardRenderNodesByProgramMap  p_input,
Camera const &  p_camera,
BillboardRenderNodeByDistanceMMap &  p_output 
)
protected

Sorts the given render nodes by distance to the camera.

Parameters
[in]p_inputThe unsorted render nodes.
[in]p_cameraThe camera.
[out]p_outputThe sorted render nodes.

◆ DoSortRenderNodes()

C3D_API void Castor3D::RenderTechnique::DoSortRenderNodes ( stSCENE_RENDER_NODES p_nodes)
protected

Sorts scene render nodes.

Parameters
[in,out]p_nodesThe nodes.

◆ DoUnbindPass() [1/2]

C3D_API void Castor3D::RenderTechnique::DoUnbindPass ( Scene p_scene,
GeometryRenderNode p_renderNode 
)
protected

Unbinds the render node's pass.

Parameters
[in]p_sceneThe scene.
[in]p_renderNodeThe render node.

◆ DoUnbindPass() [2/2]

C3D_API void Castor3D::RenderTechnique::DoUnbindPass ( Scene p_scene,
BillboardRenderNode p_renderNode 
)
protected

Unbinds the render node's pass.

Parameters
[in]p_sceneThe scene.
[in]p_renderNodeThe render node.

◆ GetName()

Castor::String const& Castor3D::RenderTechnique::GetName ( ) const
inline
Returns
The technique name.

References m_name.

◆ GetPixelShaderSource()

C3D_API Castor::String Castor3D::RenderTechnique::GetPixelShaderSource ( uint32_t  p_flags) const

Retrieves the pixel shader source matching the given flags.

Parameters
[in]p_flagsA combination of eTEXTURE_CHANNEL

◆ GetResult()

DynamicTexture const& Castor3D::RenderTechnique::GetResult ( ) const
inline
Returns
The colour texture holding the render's result.

References Castor3D::RenderTechnique::stFRAME_BUFFER::m_colourTexture, and m_frameBuffer.

◆ GetSize()

Castor::Size const& Castor3D::RenderTechnique::GetSize ( ) const
inline
Returns
The render area dimensions.

References m_size.

◆ Initialise()

C3D_API bool Castor3D::RenderTechnique::Initialise ( uint32_t &  p_index)

Initialisation function.

Parameters
[in]p_indexThe base texture index
Returns
true if ok

◆ Render()

C3D_API void Castor3D::RenderTechnique::Render ( Scene p_scene,
Camera p_camera,
uint32_t  p_frameTime 
)

Render function.

Parameters
[in]p_sceneThe scene to render
[in]p_cameraThe camera through which the scene is viewed
[in]p_frameTimeThe time elapsed since last frame was rendered

◆ Update()

C3D_API void Castor3D::RenderTechnique::Update ( )

Update function.

Remarks
Updates the scenes render nodes, if needed.

Member Data Documentation

◆ m_frameBuffer

stFRAME_BUFFER Castor3D::RenderTechnique::m_frameBuffer
protected

The HDR frame buffer.

Referenced by GetResult().

◆ m_initialised

bool Castor3D::RenderTechnique::m_initialised
protected

The technique intialisation status.

◆ m_name

Castor::String Castor3D::RenderTechnique::m_name
protected

The technique name.

Referenced by GetName().

◆ m_renderSystem

RenderSystem* Castor3D::RenderTechnique::m_renderSystem
protected

The render system.

◆ m_renderTarget

RenderTarget* Castor3D::RenderTechnique::m_renderTarget
protected

The parent render target.

◆ m_scenesRenderNodes

std::map< Castor::String, stSCENE_RENDER_NODES > Castor3D::RenderTechnique::m_scenesRenderNodes
protected

The scenes rendered through this technique.

◆ m_size

Castor::Size Castor3D::RenderTechnique::m_size
protected

The render area dimension.

Referenced by GetSize().

◆ m_wpBackRasteriserState

RasteriserStateWPtr Castor3D::RenderTechnique::m_wpBackRasteriserState
protected

The rasteriser state to cull back faces.

◆ m_wpFrontRasteriserState

RasteriserStateWPtr Castor3D::RenderTechnique::m_wpFrontRasteriserState
protected

The rasteriser state to cull front faces.


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