OGRE-Next
3.0.0
Object-Oriented Graphics Rendering Engine
|
An abstract class that contains a depth/stencil buffer. More...
#include <OgreDepthBuffer.h>
Public Types | |
enum | DepthFormatsMask { DFM_D32 = 1u << 0u , DFM_D24 = 1u << 1u , DFM_D16 = 1u << 2u , DFM_S8 = 1u << 3u } |
enum | PoolId { POOL_NO_DEPTH = 0 , OGRE_DEPRECATED_ENUM_VER =( 3 ) = 0 , POOL_DEFAULT = 1 , OGRE_DEPRECATED_ENUM_VER =( 3 ) = 0 , NO_POOL_EXPLICIT_RTV = 65534 , POOL_INVALID = 65535 } |
Static Public Attributes | |
static uint8 | AvailableDepthFormats |
During initialization DefaultDepthBufferFormat is overriden with a supported format. More... | |
static PixelFormatGpu | DefaultDepthBufferFormat |
An abstract class that contains a depth/stencil buffer.
Depth Buffers can be attached to render targets. Note we handle Depth & Stencil together. DepthBuffer 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 Ogre with POOL IDs. 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 RenderTarget if it's dimensions are bigger and have the same bit depth and same multisample settings. Depth Buffers are created automatically for new RTs when needed, and stored in the pool where the RenderTarget should have drawn from. By default, all RTs have the Id POOL_DEFAULT, which means all depth buffers are stored by default in that pool. By choosing a different Pool Id for a specific RenderTarget, that RT will only retrieve depth buffers from that pool, therefore not conflicting with sharing depth buffers with other RTs (such as shadows maps). Setting an RT to POOL_MANUAL_USAGE means Ogre won't manage the DepthBuffer for you (not recommended) RTs with POOL_NO_DEPTH are very useful when you don't want to create a DepthBuffer for it. You can still manually attach a depth buffer though as internally POOL_NO_DEPTH & POOL_MANUAL_USAGE are handled in the same way.
Behavior is consistent across all render systems, if, and only if, the same RSC flags are set RSC flags that affect this class are:
Enumerator | |
---|---|
POOL_NO_DEPTH | |
OGRE_DEPRECATED_ENUM_VER | Deprecated. Do NOT use this flag directly. It made sense in Ogre 2.1 It no longer makes sense externally in Ogre 2.2 Depth buffers are now created like regular TextureGpu and are set directly to RTV (RenderTextureViews) aka RenderPassDescriptor See https://forums.ogre3d.org/viewtopic.php?p=548491#p548491 See samples that setup depth RTVs such as: Samples/Media/2.0/scripts/Compositors/IrradianceFieldRaster.compositor Samples/Media/2.0/scripts/Compositors/StencilTest.compositor Samples/Media/2.0/scripts/Compositors/Tutorial_ReconstructPosFromDepth.compositor See https://ogrecave.github.io/ogre-next/api/latest/_ogre22_changes.html for documentation about RTVs. |
POOL_DEFAULT | |
OGRE_DEPRECATED_ENUM_VER | Deprecated. Do NOT use this flag directly. It made sense in Ogre 2.1 It no longer makes sense externally in Ogre 2.2 Depth buffers are now created like regular TextureGpu and are set directly to RTV (RenderTextureViews) aka RenderPassDescriptor See https://forums.ogre3d.org/viewtopic.php?p=548491#p548491 See samples that setup depth RTVs such as: Samples/Media/2.0/scripts/Compositors/IrradianceFieldRaster.compositor Samples/Media/2.0/scripts/Compositors/StencilTest.compositor Samples/Media/2.0/scripts/Compositors/Tutorial_ReconstructPosFromDepth.compositor See https://ogrecave.github.io/ogre-next/api/latest/_ogre22_changes.html for documentation about RTVs. |
NO_POOL_EXPLICIT_RTV | The depth buffer doesn't come from a pool, either because the TextureGpu is already a depth buffer, or it's explicitly set in an RTV. |
POOL_INVALID |
|
static |
During initialization DefaultDepthBufferFormat is overriden with a supported format.
This can be troublesome when creating the first render window, as you cannot tell Ogre which format do you wish to use for that window.
That's where AvailableDepthFormats comes in:
Before initialization user can set this mask to inform which formats they want to use. Ogre will go from best format to worst until a supported one is found. The default value is all bits set.
Set this to 0 to never use depth buffers. If you only wish render windows to not use depth buffers, then create the window with miscParam["depth_buffer"] = "no";
After initialization the mask is left untouched
|
static |