![]() |
Murl Engine API
Version 2018.3
|
The IFrameBuffer video object interface. More...
#include <murl_video_i_frame_buffer.h>
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.
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... | |
|
pure virtual |
Get the mutable Video::IObject interface.
|
pure virtual |
Get the constant Video::IObject interface.
Enable the frame buffer for rendering.
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. |
Disable the frame buffer.
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. |
Resolve the frame buffer.
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. |
|
pure virtual |
Attach the frame buffer to the current GPU program.
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. |
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.
frameCount | The current frame count. |
|
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.
format | The optional depth buffer format. |
|
pure virtual |
Get the internal format of the depth buffer.
|
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.
format | The optional stencil buffer format. |
|
pure virtual |
Get the internal format of the stencil buffer.
|
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.
texture | The target texture to attach. |
unit | The index of the texture. Currently, only index 0 is supported (multiple render targets not available). |
|
pure virtual |
Get the target color texture at a given unit.
unit | The index of the texture. Currently, only index 0 is supported (multiple render targets not available). |
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.
texture | The target texture to attach. |
|
pure virtual |
Get the target depth texture.
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.
texture | The target texture to attach. |
|
pure virtual |
Get the target stencil texture.
Enable/disable color de-linearization.
enabled | If true, color de-linearization is enabled. |
|
pure virtual |
Check if color de-linearization is enabled.
Enable/disable automatic MIP map generation.
enabled | If true, automatic MIP map generation is enabled. |
|
pure virtual |
Check if automatic MIP map generation is enabled.
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.
layer | The target layer. |
|
pure virtual |
Get the target texture layer for rendering.
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().
level | The target MIP level. |
|
pure virtual |
Get the target MIP level for rendering.
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.
numSamples | The number of samples. |
|
pure virtual |
Get the number of samples for multisample anti-aliasing.
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.
sortOrder | The global order of this frame buffer. |
|
pure virtual |
Get the frame buffers's global sort order.
|
pure virtual |
Get the horizontal output texture/render buffer size in pixels.
|
pure virtual |
Get the vertical output texture/render buffer size in pixels.
|
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.
|
pure virtual |
Get the offset matrix for a given target index.
targetIndex | The target index, from 0 to GetNumberOfTargets()-1. |
|
pure virtual |
Check if the frame buffer is complete.
Detach a texture from all binding points it is present.
texture | The texture to detach. |