The IFrameBuffer video object interface. More...

#include "murl_video_i_frame_buffer.h"

Inherited by Murl::Video::FrameBuffer.

Public Member Functions

virtual IObjectGetObjectInterface ()=0
 Get the mutable Video::IObject interface. More...
 
virtual const IObjectGetObjectInterface () 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 ITextureGetTargetColorTexture (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 ITextureGetTargetDepthTexture () 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 ITextureGetTargetStencilTexture () 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 MatrixGetViewOffsetMatrix (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]

virtual IObject* Murl::Video::IFrameBuffer::GetObjectInterface ( )
pure virtual

Get the mutable Video::IObject interface.

Returns
The IObject interface.

◆ GetObjectInterface() [2/2]

virtual const IObject* Murl::Video::IFrameBuffer::GetObjectInterface ( ) const
pure virtual

Get the constant Video::IObject interface.

Returns
The IObject interface.

◆ Enable()

virtual Bool Murl::Video::IFrameBuffer::Enable ( UInt32  targetIndex)
pure virtual

Enable the frame buffer for rendering.

Parameters
targetIndexThe 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()

virtual Bool Murl::Video::IFrameBuffer::Disable ( UInt32  targetIndex)
pure virtual

Disable the frame buffer.

Parameters
targetIndexThe 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()

virtual Bool Murl::Video::IFrameBuffer::Resolve ( UInt32  targetIndex)
pure virtual

Resolve the frame buffer.

Parameters
targetIndexThe 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()

virtual Bool Murl::Video::IFrameBuffer::Set ( IProgram currentProgram,
UInt32  targetIndex 
)
pure virtual

Attach the frame buffer to the current GPU program.

Parameters
currentProgramThe current GPU program.
targetIndexThe 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()

virtual Bool Murl::Video::IFrameBuffer::TouchTextures ( UInt32  frameCount)
pure virtual

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
frameCountThe current frame count.
Returns
true if successful.

◆ SetDepthBufferFormat()

virtual Bool Murl::Video::IFrameBuffer::SetDepthBufferFormat ( IEnums::DepthBufferFormat  format)
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
formatThe optional depth buffer format.
Returns
true if successful.

◆ GetDepthBufferFormat()

virtual IEnums::DepthBufferFormat Murl::Video::IFrameBuffer::GetDepthBufferFormat ( ) const
pure virtual

Get the internal format of the depth buffer.

Returns
The optional depth buffer format.

◆ SetStencilBufferFormat()

virtual Bool Murl::Video::IFrameBuffer::SetStencilBufferFormat ( IEnums::StencilBufferFormat  format)
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
formatThe optional stencil buffer format.
Returns
true if successful.

◆ GetStencilBufferFormat()

virtual IEnums::StencilBufferFormat Murl::Video::IFrameBuffer::GetStencilBufferFormat ( ) const
pure virtual

Get the internal format of the stencil buffer.

Returns
The optional stencil buffer format.

◆ SetTargetColorTexture()

virtual Bool Murl::Video::IFrameBuffer::SetTargetColorTexture ( ITexture texture,
UInt32  unit 
)
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
textureThe target texture to attach.
unitThe index of the texture. Currently, only index 0 is supported (multiple render targets not available).
Returns
true if successful.

◆ GetTargetColorTexture()

virtual ITexture* Murl::Video::IFrameBuffer::GetTargetColorTexture ( UInt32  unit) const
pure virtual

Get the target color texture at a given unit.

Parameters
unitThe 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()

virtual Bool Murl::Video::IFrameBuffer::SetTargetDepthTexture ( ITexture texture)
pure virtual

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
textureThe target texture to attach.
Returns
true if successful.

◆ GetTargetDepthTexture()

virtual ITexture* Murl::Video::IFrameBuffer::GetTargetDepthTexture ( ) const
pure virtual

Get the target depth texture.

Returns
The attached texture, or null if not set.

◆ SetTargetStencilTexture()

virtual Bool Murl::Video::IFrameBuffer::SetTargetStencilTexture ( ITexture texture)
pure virtual

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
textureThe target texture to attach.
Returns
true if successful.

◆ GetTargetStencilTexture()

virtual ITexture* Murl::Video::IFrameBuffer::GetTargetStencilTexture ( ) const
pure virtual

Get the target stencil texture.

Returns
The attached texture, or null if not set.

◆ SetDelinearizationEnabled()

virtual Bool Murl::Video::IFrameBuffer::SetDelinearizationEnabled ( Bool  enabled)
pure virtual

Enable/disable color de-linearization.

Parameters
enabledIf true, color de-linearization is enabled.
Returns
true if successful.

◆ IsDelinearizationEnabled()

virtual Bool Murl::Video::IFrameBuffer::IsDelinearizationEnabled ( ) const
pure virtual

Check if color de-linearization is enabled.

Returns
true if color de-linearization is enabled.

◆ SetMipMapGenerationEnabled()

virtual Bool Murl::Video::IFrameBuffer::SetMipMapGenerationEnabled ( Bool  enabled)
pure virtual

Enable/disable automatic MIP map generation.

Parameters
enabledIf true, automatic MIP map generation is enabled.
Returns
true if successful.

◆ IsMipMapGenerationEnabled()

virtual Bool Murl::Video::IFrameBuffer::IsMipMapGenerationEnabled ( ) const
pure virtual

Check if automatic MIP map generation is enabled.

Returns
true if automatic MIP map generation is enabled.

◆ SetTargetLayer()

virtual Bool Murl::Video::IFrameBuffer::SetTargetLayer ( UInt32  layer)
pure virtual

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
layerThe target layer.
Returns
true if successful.

◆ GetTargetLayer()

virtual UInt32 Murl::Video::IFrameBuffer::GetTargetLayer ( ) const
pure virtual

Get the target texture layer for rendering.

Returns
The MIP level.

◆ SetTargetMipLevel()

virtual Bool Murl::Video::IFrameBuffer::SetTargetMipLevel ( UInt32  level)
pure virtual

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
levelThe target MIP level.
Returns
true if successful.

◆ GetTargetMipLevel()

virtual UInt32 Murl::Video::IFrameBuffer::GetTargetMipLevel ( ) const
pure virtual

Get the target MIP level for rendering.

Returns
The MIP level.

◆ SetNumberOfSamples()

virtual Bool Murl::Video::IFrameBuffer::SetNumberOfSamples ( UInt32  numSamples)
pure virtual

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
numSamplesThe number of samples.
Returns
true if successful.

◆ GetNumberOfSamples()

virtual UInt32 Murl::Video::IFrameBuffer::GetNumberOfSamples ( ) const
pure virtual

Get the number of samples for multisample anti-aliasing.

Returns
The number of samples.

◆ SetSortOrder()

virtual Bool Murl::Video::IFrameBuffer::SetSortOrder ( SInt32  sortOrder)
pure virtual

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
sortOrderThe global order of this frame buffer.
Returns
true if successful.

◆ GetSortOrder()

virtual SInt32 Murl::Video::IFrameBuffer::GetSortOrder ( ) const
pure virtual

Get the frame buffers's global sort order.

Returns
The global order.

◆ GetSizeX()

virtual UInt32 Murl::Video::IFrameBuffer::GetSizeX ( ) const
pure virtual

Get the horizontal output texture/render buffer size in pixels.

Returns
The size in pixels.

◆ GetSizeY()

virtual UInt32 Murl::Video::IFrameBuffer::GetSizeY ( ) const
pure virtual

Get the vertical output texture/render buffer size in pixels.

Returns
The size in pixels.

◆ GetNumberOfTargets()

virtual UInt32 Murl::Video::IFrameBuffer::GetNumberOfTargets ( ) const
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()

virtual const Matrix& Murl::Video::IFrameBuffer::GetViewOffsetMatrix ( UInt32  targetIndex) const
pure virtual

Get the offset matrix for a given target index.

Parameters
targetIndexThe target index, from 0 to GetNumberOfTargets()-1.
Returns
The offset matrix.

◆ IsComplete()

virtual Bool Murl::Video::IFrameBuffer::IsComplete ( ) const
pure virtual

Check if the frame buffer is complete.

Returns
true if complete.

◆ DetachTexture()

virtual Bool Murl::Video::IFrameBuffer::DetachTexture ( ITexture texture)
pure virtual

Detach a texture from all binding points it is present.

Parameters
textureThe texture to detach.
Returns
true if OK.

The documentation for this interface was generated from the following file:
  • murl_video_i_frame_buffer.h


Copyright © 2011-2024 Spraylight GmbH.