ImFusion C++ SDK 4.5.0
ImFusion::GL::OffscreenRenderHelper::RenderBuffer Struct Reference

#include <ImFusion/Core/GL/OffscreenRenderHelper.h>

Helper structure to encapsulate OpenGL objects representing the temporary rendering buffer. More...

Inheritance diagram for ImFusion::GL::OffscreenRenderHelper::RenderBuffer:

Detailed Description

Helper structure to encapsulate OpenGL objects representing the temporary rendering buffer.

You can only instantiate this type using OffscreenRenderHelper::create() which will take care of initializing state guard, FBO, and textures. With the exception of stateGuard you should consider all members read-only and not change them since doing so may have unwanted side-effects.

RenderBuffer is a move-only object. The destructor will return the underlying resources to OffscreenRenderHelper so that they can be reused in the future (caching mechanism).

Public Member Functions

 RenderBuffer (RenderBuffer &&other)
RenderBuffer & operator= (RenderBuffer &&other)
void blendToParent (ColorPostProcessing colorProcessing, const OrderIndependentTransparency *oit=nullptr)
 Restores the original framebuffer and viewport state and executes a shader copying the contents of the temporary color and depth texture.

Public Attributes

std::unique_ptr< GL::StateGuardstateGuard
 Used to restore original Viewport and FBO state.
std::unique_ptr< const GL::Framebufferfbo
 FBO used for off-screen rendering.
std::unique_ptr< const GL::TexturecolorTexture
 Offscreen color texture.
std::unique_ptr< const GL::TexturedepthTexture
 Offscreen depth texture.

Additional Inherited Members

Protected Member Functions inherited from ImFusion::Utils::NotCopyable
 NotCopyable (NotCopyable &&) noexcept=default
NotCopyable & operator= (NotCopyable &&) noexcept=default
 NotCopyable (const NotCopyable &)=delete
NotCopyable & operator= (const NotCopyable &)=delete

Member Function Documentation

◆ blendToParent()

void ImFusion::GL::OffscreenRenderHelper::RenderBuffer::blendToParent ( ColorPostProcessing colorProcessing,
const OrderIndependentTransparency * oit = nullptr )

Restores the original framebuffer and viewport state and executes a shader copying the contents of the temporary color and depth texture.

Make sure to setup the global OpenGL depth test and blending state in the correct way you need.

Parameters
colorProcessingSelection how the copy shader should process the color fragments before writing them to the parent framebuffer.
oitYou can provide an optional OrderIndependentTransparency manager instance to be bound to the copy shader. If oit is not null semi-transparent pixels will be added to the OIT buffer instead of being written to the framebuffer.

The documentation for this struct was generated from the following file:
  • ImFusion/Core/GL/OffscreenRenderHelper.h
Search Tab / S to search, Esc to close