\newcommand{\tab}{\hspace{2mm}} \chapter{Overview} The visibility work package aims to develop methods for making use of restricted visibility in large scenes. The major goal of these methods is to avoid wasting of the computational power on currently invisible parts of the scene. To address this goal we develop new methods for online visibility culling and offline visibility preprocessing. The online visibility culling is either used to render only visible part of the scene or to provide queries which determine visible part of the scene in runtime. Visibility preprocessing provides partitioning of the view space into view cells and for each view cell it calculates a potentially visible set. \section{Module Class Hierarchy} The visibility work package consist of a module which is integrated into the game engine and an external module which deals with preprocessing. One of the goals of the design of the module class hierarchy has been easy portability of the developed methods to other game engines. The resulting class structure clearly separates the actual engine dependent parts from the game engine independent algorithmic parts. We have used name spaces to separate the engine dependent parts (name space Ogre) from the engine independent parts (name space GtpVisibility). The external visibility preprocessing module defines its own name space (GtpVisibilityPreprocessor). An overview of the important classes of the visibility work package and their integration into the Ogre engine is depicted in Figure~\ref{fig:classes}. \begin{figure}[htb] \centerline{ \includegraphics[angle=270,width=1.0\textwidth]{../classes} } \caption{Overview of the visibility work packages classes and their integration into the Ogre game engine.} \label{fig:classes} \end{figure} The diagram shows that the module integrated into the engine consists of three main parts (CullingManager, QueryManager, PreprocessingManager) which are encapsulated in a helper class (Visibility Manager). The helper class then deals with the initialization of the contained parts and allows an easy communication between them. \section{Visibility Culling} Visibility culling seamlessly integrates into the rendering loop and eliminates most invisible objects from being send to the pipeline. Visibility culling is implemented by instances of the CullingManager class. We will provide several implementations which can be easily switched at runtime and so the best technique for the particular scene and scene representation can be selected. Note that the Ogre integration design allows to exploit all already existing methods for scene management, such as octree, BSP tree, or plain scene graph. \section{Visibility Queries} Visibility queries determine the visible geometry for a given view point in the scene. Additionally they can also report the visible scene hierarchy nodes. Visibility queries are implemented by instances of the QueryManager class. Note that some of these instances will make use of the preprocessed visibility data through the use of PreprocessingManager. \section{Visibility Preprocessing} Visibility preprocessing precalculates visibility for all viewpoints corresponding to cells of a view space partitioning. The visibility preprocessor is implemented as a standalone module which imports files generated by the PreprocessingManager. The results of the visibility computation will be exported to the file which can then be loaded by the PreprocessingManager and used inside the engine. Apart from the scene definition file the preprocessor will be able to import the view cell definition. In this case it will assume the view cells have to be described as meshes satisfying set of requirements. Alternatively the module can generate view cells by automatic view space partitioning. %{\textbullet}\tab\textbf{Construction module for tree multiresolution models.}