The IFrameBuffer video object interface. More...
#include "murl_video_i_frame_buffer.h"
Inherited by Murl::Video::FrameBuffer.
Public Member Functions | |
virtual IObject * | GetObjectInterface ()=0 |
Get the mutable Video::IObject interface. More... | |
virtual const IObject * | GetObjectInterface () const =0 |
Get the constant Video::IObject interface. More... | |
virtual Bool | Enable (UInt32 targetIndex)=0 |
Enable the frame buffer for rendering. More... | |
virtual Bool | Disable (UInt32 targetIndex)=0 |
Disable the frame buffer. More... | |
virtual Bool | Resolve (UInt32 targetIndex)=0 |
Resolve the frame buffer. More... | |
virtual Bool | Set (IProgram *currentProgram, UInt32 targetIndex)=0 |
Attach the frame buffer to the current GPU program. More... | |
virtual Bool | TouchTextures (UInt32 frameCount)=0 |
Touch the frame buffer after rendering. More... | |
virtual Bool | SetDepthBufferFormat (IEnums::DepthBufferFormat format)=0 |
Set the internal format of the depth buffer. More... | |
virtual IEnums::DepthBufferFormat | GetDepthBufferFormat () const =0 |
Get the internal format of the depth buffer. More... | |
virtual Bool | SetStencilBufferFormat (IEnums::StencilBufferFormat format)=0 |
Set the internal format of the stencil buffer. More... | |
virtual IEnums::StencilBufferFormat | GetStencilBufferFormat () const =0 |
Get the internal format of the stencil buffer. More... | |
virtual Bool | SetTargetColorTexture (ITexture *texture, UInt32 unit)=0 |
Set an optional target texture receiving the color output. More... | |
virtual ITexture * | GetTargetColorTexture (UInt32 unit) const =0 |
Get the target color texture at a given unit. More... | |
virtual Bool | SetTargetDepthTexture (ITexture *texture)=0 |
Set an optional target texture receiving the depth output. More... | |
virtual ITexture * | GetTargetDepthTexture () const =0 |
Get the target depth texture. More... | |
virtual Bool | SetTargetStencilTexture (ITexture *texture)=0 |
Set an optional target texture receiving the stencil output. More... | |
virtual ITexture * | GetTargetStencilTexture () const =0 |
Get the target stencil texture. More... | |
virtual Bool | SetDelinearizationEnabled (Bool enabled)=0 |
Enable/disable color de-linearization. More... | |
virtual Bool | IsDelinearizationEnabled () const =0 |
Check if color de-linearization is enabled. More... | |
virtual Bool | SetMipMapGenerationEnabled (Bool enabled)=0 |
Enable/disable automatic MIP map generation. More... | |
virtual Bool | IsMipMapGenerationEnabled () const =0 |
Check if automatic MIP map generation is enabled. More... | |
virtual Bool | SetTargetLayer (UInt32 layer)=0 |
Set the target texture layer when rendering to an array texture. More... | |
virtual UInt32 | GetTargetLayer () const =0 |
Get the target texture layer for rendering. More... | |
virtual Bool | SetTargetMipLevel (UInt32 level)=0 |
Set the target MIP level when rendering to (a) mip-mapped texture(s). More... | |
virtual UInt32 | GetTargetMipLevel () const =0 |
Get the target MIP level for rendering. More... | |
virtual Bool | SetNumberOfSamples (UInt32 numSamples)=0 |
Set the number of samples for multisample anti-aliasing. More... | |
virtual UInt32 | GetNumberOfSamples () const =0 |
Get the number of samples for multisample anti-aliasing. More... | |
virtual Bool | SetSortOrder (SInt32 sortOrder)=0 |
Set the frame buffers's absolute sort order. More... | |
virtual SInt32 | GetSortOrder () const =0 |
Get the frame buffers's global sort order. More... | |
virtual UInt32 | GetSizeX () const =0 |
Get the horizontal output texture/render buffer size in pixels. More... | |
virtual UInt32 | GetSizeY () const =0 |
Get the vertical output texture/render buffer size in pixels. More... | |
virtual UInt32 | GetNumberOfTargets () const =0 |
Get the number of targets. More... | |
virtual const Matrix & | GetViewOffsetMatrix (UInt32 targetIndex) const =0 |
Get the offset matrix for a given target index. More... | |
virtual Bool | IsComplete () const =0 |
Check if the frame buffer is complete. More... | |
virtual Bool | DetachTexture (ITexture *texture)=0 |
Detach a texture from all binding points it is present. More... | |
Detailed Description
The IFrameBuffer video object interface.
This interface represents a frame buffer render target used for off-screen rendering. It encapsulates different optional target textures or render buffers for color, depth and/or stencil output.
Used internally by Graph::FrameBuffer.
Member Function Documentation
◆ GetObjectInterface() [1/2]
|
pure virtual |
Get the mutable Video::IObject interface.
- Returns
- The IObject interface.
◆ GetObjectInterface() [2/2]
|
pure virtual |
Get the constant Video::IObject interface.
- Returns
- The IObject interface.
◆ Enable()
Enable the frame buffer for rendering.
- Parameters
-
targetIndex The target index. Must be 0 when rendering to a 2D texture, or in the range from 0 to 5 when rendering to a cube map.
- Returns
- true if successful.
◆ Disable()
Disable the frame buffer.
- Parameters
-
targetIndex The target index. Must be 0 when rendering to a 2D texture, or in the range from 0 to 5 when rendering to a cube map.
- Returns
- true if successful.
◆ Resolve()
Resolve the frame buffer.
- Parameters
-
targetIndex The target index. Must be 0 when rendering to a 2D texture, or in the range from 0 to 5 when rendering to a cube map.
- Returns
- true if successful.
◆ Set()
|
pure virtual |
Attach the frame buffer to the current GPU program.
- Parameters
-
currentProgram The current GPU program. targetIndex The target index. Must be 0 when rendering to a 2D texture, or in the range from 0 to 5 when rendering to a cube map.
- Returns
- true if successful.
◆ TouchTextures()
Touch the frame buffer after rendering.
Especially on mobile devices, some flawed graphics driver implementations run into trouble when a frame buffer is updated but the generated textures are not used for rendering, which is a perfectly valid use case for e.g. pre-rendering some scenery to an offscreen buffer for later use. To overcome these problems, the renderer briefly activates the output textures for all frame buffers that are updated in a given frame.
- Parameters
-
frameCount The current frame count.
- Returns
- true if successful.
◆ SetDepthBufferFormat()
|
pure virtual |
Set the internal format of the depth buffer.
If an explicit depth texture is defined via SetTargetDepthTexture(), the given value is ignored. If format is set to a value other than IEnums::DEPTH_BUFFER_FORMAT_NONE, an internal render buffer is created to hold intermediate depth information of the given format. If format is IEnums::DEPTH_BUFFER_FORMAT_NONE, depth buffering is disabled.
- Parameters
-
format The optional depth buffer format.
- Returns
- true if successful.
◆ GetDepthBufferFormat()
|
pure virtual |
Get the internal format of the depth buffer.
- Returns
- The optional depth buffer format.
◆ SetStencilBufferFormat()
|
pure virtual |
Set the internal format of the stencil buffer.
If an explicit stencil texture is defined via SetTargetStencilTexture(), the given value is ignored. If format is set to a value other than IEnums::STENCIL_BUFFER_FORMAT_NONE, an internal render buffer is created to hold intermediate stencil information of the given format. If format is IEnums::STENCIL_BUFFER_FORMAT_NONE, stencil buffering is disabled.
- Parameters
-
format The optional stencil buffer format.
- Returns
- true if successful.
◆ GetStencilBufferFormat()
|
pure virtual |
Get the internal format of the stencil buffer.
- Returns
- The optional stencil buffer format.
◆ SetTargetColorTexture()
|
pure virtual |
Set an optional target texture receiving the color output.
If no color texture is defined, the color output of the rendering is discarded.
- Parameters
-
texture The target texture to attach. unit The index of the texture. Currently, only index 0 is supported (multiple render targets not available).
- Returns
- true if successful.
◆ GetTargetColorTexture()
|
pure virtual |
Get the target color texture at a given unit.
- Parameters
-
unit The index of the texture. Currently, only index 0 is supported (multiple render targets not available).
- Returns
- The attached texture, or null if not set.
◆ SetTargetDepthTexture()
Set an optional target texture receiving the depth output.
If no depth texture is defined, the format set via SetDepthBufferFormat() is used to possibly create an internal render buffer.
- Parameters
-
texture The target texture to attach.
- Returns
- true if successful.
◆ GetTargetDepthTexture()
|
pure virtual |
Get the target depth texture.
- Returns
- The attached texture, or null if not set.
◆ SetTargetStencilTexture()
Set an optional target texture receiving the stencil output.
If no stencil texture is defined, the format set via SetStencilBufferFormat() is used to possibly create an internal render buffer. It is possible to attach the same texture as both a depth and stencil target, in this case the texture's pixel format must be set to IEnums::PIXEL_FORMAT_D24_S8.
- Parameters
-
texture The target texture to attach.
- Returns
- true if successful.
◆ GetTargetStencilTexture()
|
pure virtual |
Get the target stencil texture.
- Returns
- The attached texture, or null if not set.
◆ SetDelinearizationEnabled()
Enable/disable color de-linearization.
- Parameters
-
enabled If true, color de-linearization is enabled.
- Returns
- true if successful.
◆ IsDelinearizationEnabled()
|
pure virtual |
Check if color de-linearization is enabled.
- Returns
- true if color de-linearization is enabled.
◆ SetMipMapGenerationEnabled()
Enable/disable automatic MIP map generation.
- Parameters
-
enabled If true, automatic MIP map generation is enabled.
- Returns
- true if successful.
◆ IsMipMapGenerationEnabled()
|
pure virtual |
Check if automatic MIP map generation is enabled.
- Returns
- true if automatic MIP map generation is enabled.
◆ SetTargetLayer()
Set the target texture layer when rendering to an array texture.
By default, the output is rendered to layer 0. This value is ignored for non-array textures.
- Parameters
-
layer The target layer.
- Returns
- true if successful.
◆ GetTargetLayer()
|
pure virtual |
Get the target texture layer for rendering.
- Returns
- The MIP level.
◆ SetTargetMipLevel()
Set the target MIP level when rendering to (a) mip-mapped texture(s).
By default, the output is rendered to a texture's base level, i.e. level=0. This value is ignored if automatic MIP map generation is enabled via SetMipMapGenerationEnabled().
- Parameters
-
level The target MIP level.
- Returns
- true if successful.
◆ GetTargetMipLevel()
|
pure virtual |
Get the target MIP level for rendering.
- Returns
- The MIP level.
◆ SetNumberOfSamples()
Set the number of samples for multisample anti-aliasing.
A value of 0 or 1 disables multisampling. A value greater than 1 enables multisampling for this frame buffer, with the given number of samples clamped to the maximum allowed value indicated by the GPU.
- Parameters
-
numSamples The number of samples.
- Returns
- true if successful.
◆ GetNumberOfSamples()
|
pure virtual |
Get the number of samples for multisample anti-aliasing.
- Returns
- The number of samples.
◆ SetSortOrder()
Set the frame buffers's absolute sort order.
Frame buffers are generally processed in the order in which they receive drawables during rendering. If a frame buffer depends on another frame buffer, which should be updated before it is used, it is often desired to specify an explicit order in which the frame buffers are processed globally. Setting a higher sort order results in the frame buffer always being processed after all frame buffers with a lower order have been updated. Frame buffers with the same sort order are processed in the order in which they get filled with drawables. Note: The back buffer is always processed last.
- Parameters
-
sortOrder The global order of this frame buffer.
- Returns
- true if successful.
◆ GetSortOrder()
|
pure virtual |
Get the frame buffers's global sort order.
- Returns
- The global order.
◆ GetSizeX()
|
pure virtual |
Get the horizontal output texture/render buffer size in pixels.
- Returns
- The size in pixels.
◆ GetSizeY()
|
pure virtual |
Get the vertical output texture/render buffer size in pixels.
- Returns
- The size in pixels.
◆ GetNumberOfTargets()
|
pure virtual |
Get the number of targets.
If the frame buffer is used to render to a 2D texture, this method returns 1. If rendering to a cube map, 6 is returned.
- Returns
- The number of targets.
◆ GetViewOffsetMatrix()
|
pure virtual |
Get the offset matrix for a given target index.
- Parameters
-
targetIndex The target index, from 0 to GetNumberOfTargets()-1.
- Returns
- The offset matrix.
◆ IsComplete()
|
pure virtual |
Check if the frame buffer is complete.
- Returns
- true if complete.
◆ DetachTexture()
Detach a texture from all binding points it is present.
- Parameters
-
texture The texture to detach.
- Returns
- true if OK.
The documentation for this interface was generated from the following file:
- murl_video_i_frame_buffer.h