The IFrameBuffer graph node interface. More...
#include "murl_graph_i_frame_buffer.h"
Public Member Functions | |
virtual INode * | GetNodeInterface ()=0 |
Get the mutable Graph::INode interface. More... | |
virtual const INode * | GetNodeInterface () const =0 |
Get the constant Graph::INode interface. More... | |
virtual ITextureNodeTarget * | GetColorTextureNodeTarget ()=0 |
Get the mutable Graph::ITextureNodeTarget color buffer container. More... | |
virtual const ITextureNodeTarget * | GetColorTextureNodeTarget () const =0 |
Get the constant Graph::ITextureNodeTarget color buffer container. More... | |
virtual ITextureNodeTarget * | GetDepthTextureNodeTarget ()=0 |
Get the mutable Graph::ITextureNodeTarget depth buffer container. More... | |
virtual const ITextureNodeTarget * | GetDepthTextureNodeTarget () const =0 |
Get the constant Graph::ITextureNodeTarget depth buffer container. More... | |
virtual ITextureNodeTarget * | GetStencilTextureNodeTarget ()=0 |
Get the mutable Graph::ITextureNodeTarget stencil buffer container. More... | |
virtual const ITextureNodeTarget * | GetStencilTextureNodeTarget () const =0 |
Get the constant Graph::ITextureNodeTarget stencil buffer container. More... | |
virtual Bool | SetDepthBufferFormat (IEnums::DepthBufferFormat format)=0 |
Explicitly set the format of the depth buffer. More... | |
virtual IEnums::DepthBufferFormat | GetDepthBufferFormat () const =0 |
Get the explicit depth buffer format. More... | |
virtual Bool | SetStencilBufferFormat (IEnums::StencilBufferFormat format)=0 |
Explicitly set the format of the stencil buffer. More... | |
virtual IEnums::StencilBufferFormat | GetStencilBufferFormat () const =0 |
Get the explicit stencil buffer format. More... | |
virtual Bool | SetRendererOrientation (IEnums::Orientation orientation)=0 |
Set the framebuffer's orientation. More... | |
virtual IEnums::Orientation | GetRendererOrientation () const =0 |
Get the framebuffer's orientation. More... | |
virtual Bool | SetDelinearizationEnabled (Bool enabled)=0 |
Enable/disable color de-linearization when writing to the color buffer, if available. More... | |
virtual Bool | IsDelinearizationEnabled () const =0 |
Check if color de-linearization during rendering 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 frame buffer width. More... | |
virtual UInt32 | GetSizeY () const =0 |
Get the frame buffer height. More... | |
virtual Bool | SetInCoordSize (Real sizeX, Real sizeY)=0 |
Set the input coordinate reference size. More... | |
virtual Bool | SetInCoordSizeX (Real sizeX)=0 |
Set the horizontal input coordinate reference size. More... | |
virtual Bool | SetInCoordSizeY (Real sizeY)=0 |
Set the vertical input coordinate reference size. More... | |
virtual Real | GetInCoordSizeX () const =0 |
Get the horizontal input coordinate reference size. More... | |
virtual Real | GetInCoordSizeY () const =0 |
Get the vertical input coordinate reference size. More... | |
virtual Bool | SetInCoord (Real x1, Real y1, Real x2, Real y2)=0 |
Set the frame buffer's input coordinate range. More... | |
virtual Bool | SetInCoord1 (Real x1, Real y1)=0 |
Set the frame buffer's input coordinate start. More... | |
virtual Bool | SetInCoord2 (Real x2, Real y2)=0 |
Set the frame buffer's input coordinate end. More... | |
virtual Bool | SetInCoordX1 (Real x1)=0 |
Set the frame buffer's horizontal start input coordinate. More... | |
virtual Bool | SetInCoordY1 (Real y1)=0 |
Set the frame buffer's vertical start input coordinates. More... | |
virtual Bool | SetInCoordX2 (Real x2)=0 |
Set the frame buffer's horizontal end input coordinate. More... | |
virtual Bool | SetInCoordY2 (Real y2)=0 |
Set the frame buffer's vertical end input coordinates. More... | |
virtual Real | GetInCoordX1 () const =0 |
Get the frame buffer's horizontal start input coordinate. More... | |
virtual Real | GetInCoordY1 () const =0 |
Get the frame buffer's vertical start input coordinate. More... | |
virtual Real | GetInCoordX2 () const =0 |
Get the frame buffer's horizontal end input coordinate. More... | |
virtual Real | GetInCoordY2 () const =0 |
Get the frame buffer's vertical end input coordinate. More... | |
virtual UInt32 | GetNumberOfStages () const =0 |
Get the frame buffer's number of stages. More... | |
virtual Video::IFrameBuffer * | GetVideoFrameBufferObject (UInt32 stage) const =0 |
Get the frame buffer's internal video renderer object. More... | |
virtual Input::IScreenArea * | GetInputScreenAreaObject (UInt32 stage) const =0 |
Get the frame buffer's internal input screen area object. More... | |
Detailed Description
The IFrameBuffer graph node interface.
Normally, all geometry contained in the scene graph gets rendered to the back buffer provided by the platform, which gets presented to the user once per frame. For certain purposes however, it can be necessary not to render directly to the back buffer but to an off-screen area:
- Post-processing effects on the rendered scene
- Dynamic reflections
- Statically generated 2D backgrounds etc.
A frame buffer represents a render target to such an off-screen area. To be able to access the generated contents, a frame buffer must refer to at least one Graph::ITexture, which holds the generated image after rendering to the frame buffer is complete, and serves as the pixel input for a later render stage.
Depending on which information is actually needed for such a later stage, one or more different texture attachment points can be used for a given frame buffer, e.g. the color target texture receives actual RGBA pixel color values, and a depth target texture receives pixel depth values.
Often, only color values are needed later but the rendering process requires an active depth buffer for correct display. In such a case, it is not necessary to create and attach a depth texture; instead, it is sufficient to explicitly set a depth buffer format to create a depth buffer that is only used internally.
To use a frame buffer for rendering, one or more Graph::IView nodes must refer to this frame buffer; after activating a Graph::ICamera referring to such a view, all subsequent geometry is then rendered to that frame buffer, with the given view and camera settings.
Note, that when multiple textures are attached, all of these textures must have the same dimensions, or initialization will fail.
Member Function Documentation
◆ GetNodeInterface() [1/2]
|
pure virtual |
Get the mutable Graph::INode interface.
This method returns a mutable pointer to the node's Graph::INode interface, to be able to query or modify common node properties such as active state, visibility or ID.
- Returns
- The mutable Graph::INode interface, or null if not available
◆ GetNodeInterface() [2/2]
|
pure virtual |
Get the constant Graph::INode interface.
This method returns a constant pointer to the node's Graph::INode interface, to be able to query common node properties such as active state, visibility or ID.
- Returns
- The constant Graph::INode interface, or null if not available
◆ GetColorTextureNodeTarget() [1/2]
|
pure virtual |
Get the mutable Graph::ITextureNodeTarget color buffer container.
This method returns a mutable pointer to the node's Graph::ITextureNodeTarget container to set or query the referenced texture node used for storing the frame buffer's output color values.
- Returns
- The mutable Graph::ITextureNodeTarget color buffer container, or null if not available.
◆ GetColorTextureNodeTarget() [2/2]
|
pure virtual |
Get the constant Graph::ITextureNodeTarget color buffer container.
This method returns a constant pointer to the node's Graph::ITextureNodeTarget container to query the referenced texture node used for storing the frame buffer's output color values.
- Returns
- The constant Graph::ITextureNodeTarget color buffer container, or null if not available.
◆ GetDepthTextureNodeTarget() [1/2]
|
pure virtual |
Get the mutable Graph::ITextureNodeTarget depth buffer container.
This method returns a mutable pointer to the node's Graph::ITextureNodeTarget container to set or query the referenced texture node used for storing the frame buffer's output depth values.
- Returns
- The mutable Graph::ITextureNodeTarget depth buffer container, or null if not available.
◆ GetDepthTextureNodeTarget() [2/2]
|
pure virtual |
Get the constant Graph::ITextureNodeTarget depth buffer container.
This method returns a constant pointer to the node's Graph::ITextureNodeTarget container to query the referenced texture node used for storing the frame buffer's output depth values.
- Returns
- The constant Graph::ITextureNodeTarget depth buffer container, or null if not available.
◆ GetStencilTextureNodeTarget() [1/2]
|
pure virtual |
Get the mutable Graph::ITextureNodeTarget stencil buffer container.
This method returns a mutable pointer to the node's Graph::ITextureNodeTarget container to set or query the referenced texture node used for storing the frame buffer's output stencil values.
- Returns
- The mutable Graph::ITextureNodeTarget stencil buffer container, or null if not available.
◆ GetStencilTextureNodeTarget() [2/2]
|
pure virtual |
Get the constant Graph::ITextureNodeTarget stencil buffer container.
This method returns a constant pointer to the node's Graph::ITextureNodeTarget container to query the referenced texture node used for storing the frame buffer's output stencil values.
- Returns
- The constant Graph::ITextureNodeTarget stencil buffer container, or null if not available.
◆ SetDepthBufferFormat()
|
pure virtual |
Explicitly set the format of the depth buffer.
If no texture is specified as a target for storing depth buffer values, the explicit depth buffer format is used to create an offscreen buffer. In that case, the depth buffer is only used for rendering internally and cannot be accessed from the outside.
- Parameters
-
format The explicit depth buffer format.
- Returns
- true if successful.
◆ GetDepthBufferFormat()
|
pure virtual |
Get the explicit depth buffer format.
- Returns
- The explicit depth buffer format.
◆ SetStencilBufferFormat()
|
pure virtual |
Explicitly set the format of the stencil buffer.
If no texture is specified as a target for storing stencil buffer values, the explicit stencil buffer format is used to create an offscreen buffer. In that case, the stencil buffer is only used for rendering internally and cannot be accessed from the outside.
- Parameters
-
format The explicit stencil buffer format.
- Returns
- true if successful.
◆ GetStencilBufferFormat()
|
pure virtual |
Get the explicit stencil buffer format.
- Returns
- The explicit stencil buffer format.
◆ SetRendererOrientation()
|
pure virtual |
Set the framebuffer's orientation.
By default, the framebuffer has this value set to IEnums::ORIENTATION_ROTATE_0, so all views referring to this framebuffer as a render target will render their contents 'upright'. For certain cases, like post-processing in image space, it may be necessary that the framebuffer receives its contents in the same orientation as the back buffer. This can be achieved by calling this method with IEnums::ORIENTATION_DEFAULT.
- Parameters
-
orientation One of the four values NORMAL, ROTATE_CW, FLIP or ROTATE_CCW to define a fixed framebuffer orientation, or DEFAULT to select the main back buffer's orientation.
- Returns
- true if successful.
◆ GetRendererOrientation()
|
pure virtual |
Get the framebuffer's orientation.
- Returns
- One of the four values NORMAL, ROTATE_CW, FLIP or ROTATE_CCW if the framebuffer has a fixed orientation, or DEFAULT if the main back buffer's orientation is used.
◆ SetDelinearizationEnabled()
Enable/disable color de-linearization when writing to the color buffer, if available.
By default, a fragment shader's color output RGB values are written to the output color buffer without any conversion. If the shader performs operations on linear color values and the target color buffer is a regular integer RGB(A) texture or render buffer, the output will be too dark, as the target color buffer expects gamma-corrected values. In this case, de-linearization should be enabled on the frame buffer, so that the usual gamma value of 2.2 is applied to the output pixels. Note, that floating point color buffers are always linear, so this has no effect.
- Parameters
-
enabled If true, color de-linearization is enabled.
- Returns
- true if successful.
◆ IsDelinearizationEnabled()
|
pure virtual |
Check if color de-linearization during rendering is enabled.
- Returns
- true if 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.
By default, the number of samples is set to 1, i.e. multisampling is disabled. A value of 0 indicates that the global number of samples is to be used, which can be configured via IEngineConfiguration::SetNumberOfAntiAliasSamples(). 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 frame buffer width.
- Returns
- The frame buffer width in pixels (texels).
◆ GetSizeY()
|
pure virtual |
Get the frame buffer height.
- Returns
- The frame buffer height in pixels (texels).
◆ SetInCoordSize()
Set the input coordinate reference size.
Generally, input coordinates are represented by values ranging from -1.0 to 1.0. As a convenience, this method can be used to set an arbitrary reference size for both dimensions of the frame buffer; this way it is possible to specify integer (pixel) values instead of (quite unreadable) floats. By default, both sizeX and sizeY are set to 1.0. See also Graph::IButton::SetOutCoordSize() as the counterpart providing the actual input coordinates.
- Parameters
-
sizeX The horizontal coordinate reference size. sizeY The vertical coordinate reference size.
- Returns
- true if successful.
◆ SetInCoordSizeX()
Set the horizontal input coordinate reference size.
See SetInCoordSize().
- Parameters
-
sizeX The horizontal coordinate reference size.
- Returns
- true if successful.
◆ SetInCoordSizeY()
Set the vertical input coordinate reference size.
See SetInCoordSize().
- Parameters
-
sizeY The vertical coordinate reference size.
- Returns
- true if successful.
◆ GetInCoordSizeX()
|
pure virtual |
Get the horizontal input coordinate reference size.
See SetInCoordSize().
- Returns
- The horizontal input coordinate reference size.
◆ GetInCoordSizeY()
|
pure virtual |
Get the vertical input coordinate reference size.
See SetInCoordSize().
- Returns
- The vertical output coordinate reference size.
◆ SetInCoord()
|
pure virtual |
Set the frame buffer's input coordinate range.
This method sets the frame buffer's start and end input coordinates.
- Parameters
-
x1 The start coordinate in X direction. y1 The start coordinate in Y direction. x2 The end coordinate in X direction. y2 The end coordinate in Y direction.
- Returns
- true if successful.
◆ SetInCoord1()
Set the frame buffer's input coordinate start.
See SetInCoord().
- Parameters
-
x1 The start coordinate in X direction. y1 The start coordinate in Y direction.
- Returns
- true if successful.
◆ SetInCoord2()
Set the frame buffer's input coordinate end.
See SetInCoord().
- Parameters
-
x2 The end coordinate in X direction. y2 The end coordinate in Y direction.
- Returns
- true if successful.
◆ SetInCoordX1()
Set the frame buffer's horizontal start input coordinate.
See SetInCoord().
- Parameters
-
x1 The start coordinate in X direction.
- Returns
- true if successful.
◆ SetInCoordY1()
Set the frame buffer's vertical start input coordinates.
See SetInCoord().
- Parameters
-
y1 The start coordinate in Y direction.
- Returns
- true if successful.
◆ SetInCoordX2()
Set the frame buffer's horizontal end input coordinate.
See SetInCoord().
- Parameters
-
x2 The end coordinate in X direction.
- Returns
- true if successful.
◆ SetInCoordY2()
Set the frame buffer's vertical end input coordinates.
See SetInCoord().
- Parameters
-
y2 The end coordinate in Y direction.
- Returns
- true if successful.
◆ GetInCoordX1()
|
pure virtual |
Get the frame buffer's horizontal start input coordinate.
See SetInCoord().
- Returns
- The start coordinate in X direction.
◆ GetInCoordY1()
|
pure virtual |
Get the frame buffer's vertical start input coordinate.
See SetInCoord().
- Returns
- The start coordinate in Y direction.
◆ GetInCoordX2()
|
pure virtual |
Get the frame buffer's horizontal end input coordinate.
See SetInCoord().
- Returns
- The end coordinate in X direction.
◆ GetInCoordY2()
|
pure virtual |
Get the frame buffer's vertical end input coordinate.
See SetInCoord().
- Returns
- The end coordinate in Y direction.
◆ GetNumberOfStages()
|
pure virtual |
Get the frame buffer's number of stages.
- Returns
- The number of stages.
◆ GetVideoFrameBufferObject()
|
pure virtual |
Get the frame buffer's internal video renderer object.
- Parameters
-
stage The stage to query.
- Returns
- The video renderer object.
◆ GetInputScreenAreaObject()
|
pure virtual |
Get the frame buffer's internal input screen area object.
- Parameters
-
stage The stage to query.
- Returns
- The input object.
The documentation for this interface was generated from the following file:
- murl_graph_i_frame_buffer.h