The Vish Visualization Shell 0.3
Vish
Wizt::MSDeferredRenderObject::MultiSampleDeferredRenderer Struct Reference

A deferred render object which allocates a multisampling depth and color texture which can be used in an implementation of renderFramebuffer() as textures: More...

#include <ocean/GLvish/MSDeferredRenderObject.hpp>

Inheritance diagram for Wizt::MSDeferredRenderObject::MultiSampleDeferredRenderer:
Wizt::DeferredRenderObject::DeferredRenderer MemCore::ReferenceBase< DeferredRenderer >

Public Member Functions

void renderFramebufferDefault (const DeferredRenderObject *, VGLRenderContext &Context)
 An example implementation on how to render a framebuffer.
Public Member Functions inherited from Wizt::DeferredRenderObject::DeferredRenderer
virtual void renderFramebuffer (const DeferredRenderObject *, VGLRenderContext &Context)=0
 Implementation of rendering the framebuffer, actual code would make use of a texture and some shader program which is implemented in a child class.
Public Member Functions inherited from MemCore::ReferenceBase< DeferredRenderer >
auto getObjectCountID () const noexcept
 Get a unique ID for this object in the given domain.
bool isIdentical (const WeakPtr< DeferredRenderer, DeferredRenderer > &PossibleSelf) const noexcept
 Check if this object is identical to the one used by the given pointer.
void mkAutoDestructive ()
 Marks this object as being automatically destructed, e.g.
refcount_t refcount () const noexcept
 The strong reference count.
 ReferenceBase (DeferredRenderer *that) noexcept
 Constructor, initializes reference counter to zero.
const auto & self () const
 Return weak pointer to the object self.
refcount_t wrefcount () const noexcept
 The weak reference count.

Additional Inherited Members

Public Types inherited from MemCore::ReferenceBase< DeferredRenderer >
using reference_domain_t
 The type of the base class.
using SelfPtr_t
 Type for a pointer to this object itself.
Static Public Member Functions inherited from Wizt::DeferredRenderObject::DeferredRenderer
static void glRenderFullScreen (double Zvalue=1.0)
 Convenience function to render a texture to the screen.
Protected Member Functions inherited from MemCore::ReferenceBase< DeferredRenderer >
virtual void extremeUnction ()
 A virtual function that will be called just before the object is destroyed.
ReferenceBaseoperator= (const ReferenceBase &R)
 Protected assignment operator (should not be called).
void suicide ()
 Delete this.
virtual ~ReferenceBase ()
 Virtual destructor.

Detailed Description

A deferred render object which allocates a multisampling depth and color texture which can be used in an implementation of renderFramebuffer() as textures:

myProgram->setUniformTexture("SceneColor", *myColorTexture);
myProgram->setUniformTexture("SceneDepth", *myDepthTexture);
StrongPtr< Object, ObjectBase > RefPtr
Convenience template typedef to use RefPtr instead of StrongPtr.
Definition RefPtr.hpp:776

Doing such requires samplers defined in the GLSL shader code in the following form:

uniform sampler2DMS SceneColor;
uniform sampler2DMS SceneDepth;

The data in these textures is then accessible in fragment shader code via

ivec2 P = ivec2( gl_FragCoord.xy);
vec4 Color = texelFetch(SceneColor, P, 0 );
float Depth = texelFetch(SceneDepth, P, 0 ).r;

It is recommended to be used as base class for multisampling deferred render objects derived from class MSDeferredRenderObject.