![]() |
Public API Reference |
![]() |
Standard setup functor for portals. More...
#include <csplugincommon/rendermanager/portalsetup.h>
Classes | |
struct | ContextSetupData |
Data that needs to be passed between portal setup steps by the context setup function. More... | |
Public Member Functions | |
void | operator() (typename RenderTreeType::ContextNode &context, ContextSetupData &setupData) |
Operator doing the actual work. | |
StandardPortalSetup (PersistentData &persistentData, ContextSetup &cfun) | |
Constructor. |
Standard setup functor for portals.
Iterates over all portals in a context and sets up new contexts to render the part of the scene "behind" the portal. Depending on the settings of a portal, it is either rendered to the same target as the context or a new texture (in which case the original context is augmented with a mesh rendering that texture).
Usage: instiate. Application after the visible meshes were determined, but before mesh sorting. Example:
// Type for portal setup typedef CS::RenderManager::StandardPortalSetup<RenderTreeType, ContextSetupType> PortalSetupType; // Assumes there is an argument 'PortalSetupType::ContextSetupData& portalSetupData' // to the current method, taking data from the previous portal (if any) // Keep track of the portal recursions to avoid infinite portal recursions if (recurseCount > 30) return; // Set up all portals { recurseCount++; // Data needed to be passed between portal setup steps PortalSetupType portalSetup (rmanager->portalPersistent, *this); // Actual setup portalSetup (context, portalSetupData); recurseCount--; }
The template parameter RenderTree gives the render tree type. The parameter ContextSetup gives a class used to set up the contexts for the rendering of the scene behind a portal. It must provide an implementation of operator() (RenderTree::ContextNode& context, PortalSetupType::ContextSetupData& portalSetupData).
Definition at line 279 of file portalsetup.h.
CS::RenderManager::StandardPortalSetup< RenderTreeType, ContextSetup >::StandardPortalSetup | ( | PersistentData & | persistentData, |
ContextSetup & | cfun | ||
) | [inline] |
Constructor.
Definition at line 299 of file portalsetup.h.
void CS::RenderManager::StandardPortalSetup< RenderTreeType, ContextSetup >::operator() | ( | typename RenderTreeType::ContextNode & | context, |
ContextSetupData & | setupData | ||
) | [inline] |
Operator doing the actual work.
Goes over the portals in the given context and sets up rendering of behind the portals.
Definition at line 307 of file portalsetup.h.