FrameBuffer

Provides a built-in mechanism to render to Texture or Cubemap. FrameBuffer creates an offscreen back buffer and allows you to draw directly to one or multiple render target. These targets (or attachments) can either be used to store colors, depth or stencil data and can be used for multiple different purposes such as reflection, deferred rendering and other post-processing effects.

It is a very powerful tool that allows you to store and process the result multi-pass rendering to different storage and process them in Shader.

See Also

Static Variables


Name Description
camera Parent Camera where the FrameBuffer is attached.
size The size of the FrameBuffer either in pixels or specified as viewport ratio.
absolute Specify if the FrameBuffer size should be absolute or relative.
width The current FrameBuffer width in pixels.
height The current FrameBuffer height in pixels.
framebuffer_id Internal GPU FrameBuffer id.
colorbuffer_id Internal GPU id of the color buffer associated to the active FrameBuffer.
depthbuffer_id Internal GPU id of the depth buffer associated to the active FrameBuffer.
stencilbuffer_id Internal GPU id of the depth/stencil buffer associated to the active FrameBuffer.

Variables


Name Description
redraw Draw another FrameBuffer pass.
update Force the FrameBuffer to be updated next time it is required by the drawing sequence.
color_buffer Specify wether or not the FrameBuffer requires a color buffer to be created.
depth_buffer Specify wether or not the FrameBuffer requires a depth buffer to be created.
stencil_buffer Specify wether or not the FrameBuffer requires a stencil buffer to be created.

Functions


Name Description
Clear Reset the FrameBuffer and flag it for update.
SetSize Adjust the dimensions of the active FrameBuffer.
SetStorage Specify the type of storage the FrameBuffer should support; and trigger an internal update.
SetColorTexture Attach or detach an existing Texture as color buffer.
SetColorCubemap Attach or detach a Cubemap as color buffer.
SetColorDiscard Provides an opportunity for driver optimization by invalidating the content of the FrameBuffer.
IsColorDiscard Helper to verify if a specific color slot is marked to be discarded.
SetColorReadPixels Force the FrameBuffer content to be transferred to the Texmap of the Texture or Cubemap used.
IsColorReadPixels Helper to check if a specific slot is marked to transfer texel data.
SetDepthTexture Connect a depth attachment to the active FrameBuffer.
SetDepthCubemap Connect a depth Cubemap attachment to the active FrameBuffer.
SetDepthDiscard Provides an opportunity for driver optimization by invalidating the content of the FrameBuffer.
IsDepthDiscard Helper to verify if a specific depth slot is marked to be discarded.
BlitBegin Prepare the active FrameBuffer for a blit operation.
Blit Copy the content of a FrameBuffer to the active FrameBuffer.
BlitEnd Restore the previouse draw buffers associated the active FrameBuffer and terminate the blit operation.
GetColorTexture Retrieve a Texture color attachment connected to a specific slot index.
GetColorCubemap Retrieve a Cubemap color attachment connected to a specific slot index.
GetDepthTexture Retrieve a Texture depth attachment connected to a specific slot index.
GetDepthCubemap Retrieve a Cubemap depth attachment connected to a specific slot index.
GetColorTextureLayer Retrieve the current layer use by a specific color texture slot.
GetDepthTextureLayer Retrieve a Cubemap depth attachment connected to a specific slot index.
Rebuild Force the active FrameBuffer to be rebuilt.

UsageType


Constant values used by diverse classes to determine data usage.

  • kStatic: The data is stored locally and is read-only and cannot be changed.
  • kDynamic: Data are generated dynamically and can be changed either automatically by the system or manually by the user.
  • kExternal: Data is stored externally and can only be read.

FaceType


Static enumerators used to determine the face of a Cubemap

  • kPositiveX: Positive X axis.
  • kNegativeX: Negative X axis.
  • kPositiveY: Positive Y axis.
  • kNegativeY: Positive Y axis.
  • kPositiveZ: Positive Z axis.
  • kNegativeZ: Positive Z axis.




NRG - API 2022.3.383570 - Thu Jul 28 2022
Copyright © 2022 nrgcore.com. All Rights Reserved. Terms of Service - Privacy Policy - EULA