![]() |
ImFusion C++ SDK 4.5.0
|
#include <ImFusion/Core/GL/OffscreenRenderHelper.h>
Helper structure to encapsulate OpenGL objects representing the temporary rendering buffer. More...
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::StateGuard > | stateGuard |
| Used to restore original Viewport and FBO state. | |
| std::unique_ptr< const GL::Framebuffer > | fbo |
| FBO used for off-screen rendering. | |
| std::unique_ptr< const GL::Texture > | colorTexture |
| Offscreen color texture. | |
| std::unique_ptr< const GL::Texture > | depthTexture |
| 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 |
| 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.
| colorProcessing | Selection how the copy shader should process the color fragments before writing them to the parent framebuffer. |
| oit | You 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. |