\hypertarget{class_ogre_1_1_depth_buffer}{}\doxysection{Ogre\+::Depth\+Buffer Class Reference}
\label{class_ogre_1_1_depth_buffer}\index{Ogre::DepthBuffer@{Ogre::DepthBuffer}}


An abstract class that contains a depth/stencil buffer.  




{\ttfamily \#include $<$Ogre\+Depth\+Buffer.\+h$>$}



Inheritance diagram for Ogre\+::Depth\+Buffer\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{class_ogre_1_1_depth_buffer__inherit__graph}
\end{center}
\end{figure}
\doxysubsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
enum \mbox{\hyperlink{group___render_system_ga9854c57374adef41216bae68544a5b7e}{Pool\+Id}} \{ \mbox{\hyperlink{group___render_system_gga9854c57374adef41216bae68544a5b7ea569228ed0fdd8d428a5117026b6d010e}{P\+O\+O\+L\+\_\+\+N\+O\+\_\+\+D\+E\+P\+TH}} = 0, 
\mbox{\hyperlink{group___render_system_gga9854c57374adef41216bae68544a5b7ea2d5409ddce167e1db415f09ee2160440}{P\+O\+O\+L\+\_\+\+M\+A\+N\+U\+A\+L\+\_\+\+U\+S\+A\+GE}} = 0, 
\mbox{\hyperlink{group___render_system_gga9854c57374adef41216bae68544a5b7ea00a687046bfe7a9ebd7f34256d3fbcca}{P\+O\+O\+L\+\_\+\+D\+E\+F\+A\+U\+LT}} = 1
 \}
\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{group___render_system_ga90ab98914c730458fccb9780f850b905}{Depth\+Buffer}} (\mbox{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}} pool\+Id, \mbox{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}} bit\+Depth, \mbox{\hyperlink{namespace_ogre_adf2a0cf2e77143b5ee1d38a75e289545}{uint32}} width, \mbox{\hyperlink{namespace_ogre_adf2a0cf2e77143b5ee1d38a75e289545}{uint32}} height, \mbox{\hyperlink{namespace_ogre_adf2a0cf2e77143b5ee1d38a75e289545}{uint32}} fsaa, const \mbox{\hyperlink{namespace_ogre_af73bbdc8bed8a3e6fcd56bb8fa188c45}{String}} \&fsaa\+Hint, bool manual)
\item 
virtual \mbox{\hyperlink{group___render_system_ga23ee0fd93e778767b81bebd382bb4306}{$\sim$\+Depth\+Buffer}} ()
\item 
virtual void \mbox{\hyperlink{group___render_system_ga26c4ce1003ddab1ed7e3befecb0888a1}{\+\_\+notify\+Render\+Target\+Attached}} (\mbox{\hyperlink{class_ogre_1_1_render_target}{Render\+Target}} $\ast$render\+Target)
\begin{DoxyCompactList}\small\item\em Called when a \mbox{\hyperlink{class_ogre_1_1_render_target}{Render\+Target}} is attaches this \mbox{\hyperlink{class_ogre_1_1_depth_buffer}{Depth\+Buffer}}. \end{DoxyCompactList}\item 
virtual void \mbox{\hyperlink{group___render_system_ga227b541ef2ae3de53334c10397a08f99}{\+\_\+notify\+Render\+Target\+Detached}} (\mbox{\hyperlink{class_ogre_1_1_render_target}{Render\+Target}} $\ast$render\+Target)
\begin{DoxyCompactList}\small\item\em Called when a \mbox{\hyperlink{class_ogre_1_1_render_target}{Render\+Target}} is detaches from this \mbox{\hyperlink{class_ogre_1_1_depth_buffer}{Depth\+Buffer}}. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{group___render_system_ga7af5c611687492846891914dcac303d2}{\+\_\+set\+Pool\+Id}} (\mbox{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}} pool\+Id)
\begin{DoxyCompactList}\small\item\em Sets the pool id in which this \mbox{\hyperlink{class_ogre_1_1_depth_buffer}{Depth\+Buffer}} lives. \end{DoxyCompactList}\item 
virtual \mbox{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}} \mbox{\hyperlink{group___render_system_ga0da54b20b25ac5313fc8c142e8b35168}{get\+Bit\+Depth}} () const
\item 
\mbox{\hyperlink{namespace_ogre_adf2a0cf2e77143b5ee1d38a75e289545}{uint32}} \mbox{\hyperlink{group___render_system_ga37ddc9b5fc1fd8c5cf50e1b865d2b2fb}{get\+F\+S\+AA}} () const
\item 
\mbox{\hyperlink{namespace_ogre_adf2a0cf2e77143b5ee1d38a75e289545}{uint32}} \mbox{\hyperlink{group___render_system_ga242e53843f55de3983e6f070e88c19ae}{get\+Fsaa}} () const
\item 
const \mbox{\hyperlink{namespace_ogre_af73bbdc8bed8a3e6fcd56bb8fa188c45}{String}} \& \mbox{\hyperlink{group___render_system_ga9662342362034428346e0676fb9d1ac7}{get\+F\+S\+A\+A\+Hint}} () const
\item 
const \mbox{\hyperlink{namespace_ogre_af73bbdc8bed8a3e6fcd56bb8fa188c45}{String}} \& \mbox{\hyperlink{group___render_system_ga1b4eca5bc2774b80081a2f5aba90c58c}{get\+Fsaa\+Hint}} () const
\item 
virtual \mbox{\hyperlink{namespace_ogre_adf2a0cf2e77143b5ee1d38a75e289545}{uint32}} \mbox{\hyperlink{group___render_system_gaf95e6998e74db40257cb2ca5cab4bdf4}{get\+Height}} () const
\item 
virtual \mbox{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}} \mbox{\hyperlink{group___render_system_ga82b30e2ad5de1ac4678fda52ccbaf28f}{get\+Pool\+Id}} () const
\begin{DoxyCompactList}\small\item\em Gets the pool id in which this \mbox{\hyperlink{class_ogre_1_1_depth_buffer}{Depth\+Buffer}} lives. \end{DoxyCompactList}\item 
virtual \mbox{\hyperlink{namespace_ogre_adf2a0cf2e77143b5ee1d38a75e289545}{uint32}} \mbox{\hyperlink{group___render_system_gae5095fe367bf95d08dee2da03810beb2}{get\+Width}} () const
\item 
virtual bool \mbox{\hyperlink{group___render_system_gae959f6dd77e0e8b6aa9b7c6a3d2d3f5d}{is\+Compatible}} (\mbox{\hyperlink{class_ogre_1_1_render_target}{Render\+Target}} $\ast$render\+Target) const
\begin{DoxyCompactList}\small\item\em Returns whether the specified \mbox{\hyperlink{class_ogre_1_1_render_target}{Render\+Target}} is compatible with this \mbox{\hyperlink{class_ogre_1_1_depth_buffer}{Depth\+Buffer}} That is, this \mbox{\hyperlink{class_ogre_1_1_depth_buffer}{Depth\+Buffer}} can be attached to that \mbox{\hyperlink{class_ogre_1_1_render_target}{Render\+Target}}. \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{group___render_system_ga4a3de78684016598642ad2d00e5caa86}{is\+Manual}} () const
\begin{DoxyCompactList}\small\item\em Manual Depth\+Buffers are cleared in \mbox{\hyperlink{class_ogre_1_1_render_system}{Render\+System}}\textquotesingle{}s destructor. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
An abstract class that contains a depth/stencil buffer. 

Depth Buffers can be attached to render targets. Note we handle Depth \& Stencil together. \mbox{\hyperlink{class_ogre_1_1_depth_buffer}{Depth\+Buffer}} sharing is handled automatically for you. However, there are times where you want to specifically control depth buffers to achieve certain effects or increase performance. You can control this by hinting \mbox{\hyperlink{namespace_ogre}{Ogre}} with P\+O\+OL I\+Ds. Created depth buffers can live in different pools, or all together in the same one. Usually, a depth buffer can only be attached to a \mbox{\hyperlink{class_ogre_1_1_render_target}{Render\+Target}} if it\textquotesingle{}s dimensions are bigger and have the same bit depth and same multisample settings. Depth Buffers are created automatically for new R\+Ts when needed, and stored in the pool where the \mbox{\hyperlink{class_ogre_1_1_render_target}{Render\+Target}} should have drawn from. By default, all R\+Ts have the \mbox{\hyperlink{class_ogre_1_1_id}{Id}} P\+O\+O\+L\+\_\+\+D\+E\+F\+A\+U\+LT, which means all depth buffers are stored by default in that pool. By choosing a different \mbox{\hyperlink{class_ogre_1_1_pool}{Pool}} \mbox{\hyperlink{class_ogre_1_1_id}{Id}} for a specific \mbox{\hyperlink{class_ogre_1_1_render_target}{Render\+Target}}, that RT will only retrieve depth buffers from {\itshape that} pool, therefore not conflicting with sharing depth buffers with other R\+Ts (such as shadows maps). Setting an RT to P\+O\+O\+L\+\_\+\+M\+A\+N\+U\+A\+L\+\_\+\+U\+S\+A\+GE means \mbox{\hyperlink{namespace_ogre}{Ogre}} won\textquotesingle{}t manage the \mbox{\hyperlink{class_ogre_1_1_depth_buffer}{Depth\+Buffer}} for you (not recommended) R\+Ts with P\+O\+O\+L\+\_\+\+N\+O\+\_\+\+D\+E\+P\+TH are very useful when you don\textquotesingle{}t want to create a \mbox{\hyperlink{class_ogre_1_1_depth_buffer}{Depth\+Buffer}} for it. You can still manually attach a depth buffer though as internally P\+O\+O\+L\+\_\+\+N\+O\+\_\+\+D\+E\+P\+TH \& P\+O\+O\+L\+\_\+\+M\+A\+N\+U\+A\+L\+\_\+\+U\+S\+A\+GE are handled in the same way.

Behavior is consistent across all render systems, if, and only if, the same R\+SC flags are set R\+SC flags that affect this class are\+: R\+S\+C\+\_\+\+R\+T\+T\+\_\+\+M\+A\+I\+N\+\_\+\+D\+E\+P\+T\+H\+B\+U\+F\+F\+E\+R\+\_\+\+A\+T\+T\+A\+C\+H\+A\+B\+LE\+: some A\+P\+Is (ie. Open\+GL w/ F\+BO) don\textquotesingle{}t allow using the main depth buffer for offscreen R\+T\+Ts. When this flag is set, the depth buffer can be shared between the main window and an R\+TT. R\+S\+C\+\_\+\+R\+T\+T\+\_\+\+D\+E\+P\+T\+H\+B\+U\+F\+F\+E\+R\+\_\+\+R\+E\+S\+O\+L\+U\+T\+I\+O\+N\+\_\+\+L\+E\+S\+S\+E\+Q\+U\+AL\+: When this flag isn\textquotesingle{}t set, the depth buffer can only be shared across R\+T\+Ts who have the E\+X\+A\+CT same resolution. When it\textquotesingle{}s set, it can be shared with R\+T\+Ts as long as they have a resolution less or equal than the depth buffer\textquotesingle{}s.

\begin{DoxyRemark}{Remarks}
Design discussion \href{http://www.ogre3d.org/forums/viewtopic.php?f=4&t=53534&p=365582}{\texttt{ http\+://www.\+ogre3d.\+org/forums/viewtopic.\+php?f=4\&t=53534\&p=365582}} 
\end{DoxyRemark}
\begin{DoxyAuthor}{Author}
Matias N. Goldberg 
\end{DoxyAuthor}
\begin{DoxyVersion}{Version}
1.\+0 
\end{DoxyVersion}


The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{_ogre_depth_buffer_8h}{Ogre\+Depth\+Buffer.\+h}}\end{DoxyCompactItemize}
