CrystalSpace

Public API Reference

CS::RenderManager::LightSetup< RenderTree, LayerConfigType, ShadowHandler > Class Template Reference

For each mesh determine the array of affecting lights and generate shader vars for it. More...

#include <csplugincommon/rendermanager/lightsetup.h>

List of all members.

Classes

struct  CachedLightData
 Data persistently stored for every light. More...
struct  PersistentData
 Data used by the light setup helper that needs to persist over multiple frames. More...

Public Member Functions

const PostLightingLayers & GetPostLightingLayers () const
 Return the render layers, adjusted for possible additional layers needed by lighting/shadowing.
 LightSetup (PersistentData &persist, iLightManager *lightmgr, SVArrayHolder &svArrays, const LayerConfigType &layerConfig, ShadowParamType &shadowParam)
 Construct.
void operator() (typename RenderTree::MeshNode *node)
 Set up lighting for a mesh combination Selects the lights affecting the mesh and sets up the light shader vars in the render layers according to the layers configuration.

Protected Member Functions

template<typename _ShadowHandler >
size_t HandleLights (_ShadowHandler &shadows, size_t overallPass, LightingSorter &sortedLights, size_t layer, LayerHelper< RenderTree, LayerConfigType, PostLightingLayers > &layers, const LayerConfigType &layerConfig, typename RenderTree::MeshNode::SingleMesh &mesh, typename RenderTree::MeshNode *node)
 Set up lighting for a mesh/light combination Given the lights affecting the mesh it sets up the light shader vars in the render layers according to the layers configuration.

Detailed Description

template<typename RenderTree, typename LayerConfigType, typename ShadowHandler = ShadowNone<RenderTree, LayerConfigType>>
class CS::RenderManager::LightSetup< RenderTree, LayerConfigType, ShadowHandler >

For each mesh determine the array of affecting lights and generate shader vars for it.

Usage: together with iteration over each mesh node. Must be done after shader and shader SV (usually SetupStandardShader()) and before ticket setup. Example:

 RenderManager::LightSetupType::ShadowParamType shadowParam;
 RenderManager::LightSetupType lightSetup (
   rmanager->lightPersistent, rmanager->lightManager,
   context.svArrays, layerConfig, shadowParam);
 ForEachMeshNode (context, lightSetup);

The template parameter RenderTree gives the render tree type. The parameter LayerConfigType gives a class that is used for providing the rendering layer setup. ShadowHandler is an optional class that provides shadow handling for each mesh/light combination (default to no shadows).

Definition at line 402 of file lightsetup.h.


Constructor & Destructor Documentation

template<typename RenderTree , typename LayerConfigType , typename ShadowHandler = ShadowNone<RenderTree, LayerConfigType>>
CS::RenderManager::LightSetup< RenderTree, LayerConfigType, ShadowHandler >::LightSetup ( PersistentData persist,
iLightManager lightmgr,
SVArrayHolder svArrays,
const LayerConfigType &  layerConfig,
ShadowParamType &  shadowParam 
) [inline]

Construct.

Definition at line 748 of file lightsetup.h.


Member Function Documentation

template<typename RenderTree , typename LayerConfigType , typename ShadowHandler = ShadowNone<RenderTree, LayerConfigType>>
const PostLightingLayers& CS::RenderManager::LightSetup< RenderTree, LayerConfigType, ShadowHandler >::GetPostLightingLayers (  )  const [inline]

Return the render layers, adjusted for possible additional layers needed by lighting/shadowing.

Definition at line 949 of file lightsetup.h.

template<typename RenderTree , typename LayerConfigType , typename ShadowHandler = ShadowNone<RenderTree, LayerConfigType>>
template<typename _ShadowHandler >
size_t CS::RenderManager::LightSetup< RenderTree, LayerConfigType, ShadowHandler >::HandleLights ( _ShadowHandler &  shadows,
size_t  overallPass,
LightingSorter sortedLights,
size_t  layer,
LayerHelper< RenderTree, LayerConfigType, PostLightingLayers > &  layers,
const LayerConfigType &  layerConfig,
typename RenderTree::MeshNode::SingleMesh mesh,
typename RenderTree::MeshNode node 
) [inline, protected]

Set up lighting for a mesh/light combination Given the lights affecting the mesh it sets up the light shader vars in the render layers according to the layers configuration.

Definition at line 420 of file lightsetup.h.

template<typename RenderTree , typename LayerConfigType , typename ShadowHandler = ShadowNone<RenderTree, LayerConfigType>>
void CS::RenderManager::LightSetup< RenderTree, LayerConfigType, ShadowHandler >::operator() ( typename RenderTree::MeshNode node  )  [inline]

Set up lighting for a mesh combination Selects the lights affecting the mesh and sets up the light shader vars in the render layers according to the layers configuration.

Definition at line 769 of file lightsetup.h.


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

Generated for Crystal Space 2.1 by doxygen 1.6.1