#ifndef _VisibilityTerrainSceneManager_H__ #define _VisibilityTerrainSceneManager_H__ #include #include #include #include #include #include "OgreOctreeHierarchyInterface.h" #include "VisibilityManager.h" namespace Ogre { /** This class extends the terrain scene manager, using occlusion queries for visibility culling. */ class VisibilityTerrainSceneManager: public TerrainSceneManager { public: VisibilityTerrainSceneManager(GtpVisibility::VisibilityManager *visManager); ~VisibilityTerrainSceneManager(); void _renderVisibleObjects(); void _findVisibleObjects(Camera* cam, bool onlyShadowCasters); void _updateSceneGraph(Camera* cam); /** Sets the given option for the SceneManager @remarks Options are: "Algorithm", int *; */ virtual bool setOption( const String &, const void * ); /** Gets the given option for the Scene VisibilityManager. @remarks See setOption */ virtual bool getOption( const String &, void * ); bool getOptionValues( const String & key, StringVector &refValueList ); bool getOptionKeys( StringVector &refKeys ); /** Sets the visibility manager. @param visManager the visibility manager */ void setVisibilityManager(GtpVisibility::VisibilityManager *visManager); /** See set. */ GtpVisibility::VisibilityManager *getVisibilityManager(); /** Render a set of objects, see renderSingleObject for param definitions Override so we can handle delayed rendering of transparent objects */ virtual void renderObjects(const RenderPriorityGroup::TransparentRenderablePassList& objs, bool doLightIteration, const LightList* manualLightList = 0); /** Writes out stats into the Ogre log file. */ void WriteLog(); /** Override pass so we can do the z-fail pass. */ Pass* setPass(Pass* pass); /** Override from SceneManager so we can skip all but first pass for depth pass. */ bool validatePassForRendering(Pass* pass); void RenderItemBuffer(RenderPriorityGroup* pGroup); void RenderSingleObjectForItemBuffer(Renderable *rend); void renderQueueGroupObjects(RenderQueueGroup* pGroup); /** Override from SceneManager so that sub entities can be assigned an id for item buffer */ Entity* createEntity(const String& entityName, const String& meshName); protected: /** Creates material for depth pass, e.g., a pass that only fills the depth buffer. */ void InitDepthPass(); /** Creates material for item buffer. */ void InitItemBufferPass(); /** Fills render queue so that a visualization can be rendered. */ void ShowVisualization(Camera *cam); OctreeHierarchyInterface *mHierarchyInterface; GtpVisibility::VisibilityManager *mVisibilityManager; bool mShowVisualization; bool mSkipTransparents; bool mVisualizeCulledNodes; bool mRenderNodesForViz; bool mRenderNodesContentForViz; bool mDelayRenderTransparents; bool mUseDepthPass; bool mRenderDepthPass; bool mRenderItemBuffer; Pass *mDepthPass; Pass *mItemBufferPass; int mCurrentEntityId; }; } // namespace Ogre #endif // CullingTerrainSceneManager_H