OGRE-Next  2.3
Object-Oriented Graphics Rendering Engine
Ogre::CompositorPassCompute Class Reference

Implementation of CompositorPass This implementation will render a fullscreen triangle/quad to the RenderTarget using the parameters from definition (rectangle area, whether triangle or quad pass, whether to include frustum corners, etc) More...

#include <OgreCompositorPassCompute.h>

+ Inheritance diagram for Ogre::CompositorPassCompute:

Public Member Functions

 CompositorPassCompute (const CompositorPassComputeDef *definition, Camera *defaultCamera, CompositorNode *parentNode, const RenderTargetViewDef *rtv)
 
 ~CompositorPassCompute () override
 
ResourceTransitionArray_getResourceTransitionsNonConst ()
 
virtual void analyzeBarriers (const bool bClearBarriers=true)
 Bakes all of the memory barriers / resource transition that will be needed before executing a GPU command like rendering, copying/blit or compute. More...
 
void execute (const Camera *lodCamera) override
 
Vector2 getActualDimensions () const
 
const CompositorPassDefgetDefinition () const
 
const CompositorNodegetParentNode () const
 
RenderPassDescriptorgetRenderPassDesc () const
 
const ResourceTransitionArraygetResourceTransitions () const
 
const CompositorTextureVecgetTextureDependencies () const
 
CompositorPassType getType () const
 
virtual void notifyCleared ()
 @See CompositorNode::_notifyCleared More...
 
virtual void notifyDestroyed (const UavBufferPacked *buffer)
 
virtual void notifyDestroyed (TextureGpu *channel)
 @See CompositorNode::notifyDestroyed More...
 
virtual bool notifyRecreated (const TextureGpu *channel)
 @See CompositorNode::notifyRecreated More...
 
virtual void notifyRecreated (const UavBufferPacked *oldBuffer, UavBufferPacked *newBuffer)
 
void operator delete (void *ptr)
 
void operator delete (void *ptr, const char *, int, const char *)
 
void operator delete (void *ptr, void *)
 
void operator delete[] (void *ptr)
 
void operator delete[] (void *ptr, const char *, int, const char *)
 
void * operator new (size_t sz)
 
void * operator new (size_t sz, const char *file, int line, const char *func)
 operator new, with debug line info More...
 
void * operator new (size_t sz, void *ptr)
 placement operator new More...
 
void * operator new[] (size_t sz)
 
void * operator new[] (size_t sz, const char *file, int line, const char *func)
 array operator new, with debug line info More...
 
void profilingBegin ()
 
void profilingEnd ()
 
virtual void resetNumPassesLeft ()
 

Detailed Description

Implementation of CompositorPass This implementation will render a fullscreen triangle/quad to the RenderTarget using the parameters from definition (rectangle area, whether triangle or quad pass, whether to include frustum corners, etc)

A fullscreen quad are two triangles that form a rectangle, which cover the entire screen. This is however an inefficient way of harnessing the GPU's power. Modern GPUs iterate a whole bounding rect that encloses each triangle (it's highly more parallelizable & scalable than the scanline algorithm used by older Voodoo cards in the 90's). That means we're wasting 50% of GPU reasources in pixels that aren't drawn.
A much faster approach made famous by Emil Persson (see max area triangulation http://www.humus.name/index.php?page=News&ID=228) is to render a single oversized triangle that covers the entire screen, which has it's UV scaled up; so that when interpolated at screen position, it appears it goes from the range [0; 1) like a regular quad pass. The difference is that pixels that go past the viewport are much better clipped/earlied-out by the GPU than those that fall inside the viewport but outside the triangle (like the rectangle approach)
This faster technique only works for passes that cover the entire screen. When the viewport is not 0 0 1 1; the CompositorPassCompute automatically switches to a fullscreen quad.
IMPORTANT: The texel-to-pixel adjustment offset is included in the world matrix passed to the vertex shader. This differs from Ogre 1.x which tried to embed the offset into the vertices.
IMPORTANT: When the viewport is not 0 0 1 1; the scale & position factors are passed through the world matrix. This behavior differs from Ogre 1.x
Author
Matias N. Goldberg
Version
1.0

Constructor & Destructor Documentation

◆ CompositorPassCompute()

Ogre::CompositorPassCompute::CompositorPassCompute ( const CompositorPassComputeDef definition,
Camera defaultCamera,
CompositorNode parentNode,
const RenderTargetViewDef rtv 
)

◆ ~CompositorPassCompute()

Ogre::CompositorPassCompute::~CompositorPassCompute ( )
override

Member Function Documentation

◆ _getResourceTransitionsNonConst()

ResourceTransitionArray& Ogre::CompositorPass::_getResourceTransitionsNonConst ( )
inlineinherited

◆ analyzeBarriers()

virtual void Ogre::CompositorPass::analyzeBarriers ( const bool  bClearBarriers = true)
virtualinherited

Bakes all of the memory barriers / resource transition that will be needed before executing a GPU command like rendering, copying/blit or compute.

Parameters
bClearBarriersTrue to do mResourceTransitions.clear();

◆ execute()

void Ogre::CompositorPassCompute::execute ( const Camera lodCamera)
overridevirtual

Implements Ogre::CompositorPass.

◆ getActualDimensions()

Vector2 Ogre::CompositorPass::getActualDimensions ( ) const
inherited

◆ getDefinition()

const CompositorPassDef* Ogre::CompositorPass::getDefinition ( ) const
inlineinherited

◆ getParentNode()

const CompositorNode* Ogre::CompositorPass::getParentNode ( ) const
inlineinherited

◆ getRenderPassDesc()

RenderPassDescriptor* Ogre::CompositorPass::getRenderPassDesc ( ) const
inlineinherited

◆ getResourceTransitions()

const ResourceTransitionArray& Ogre::CompositorPass::getResourceTransitions ( ) const
inlineinherited

◆ getTextureDependencies()

const CompositorTextureVec& Ogre::CompositorPass::getTextureDependencies ( ) const
inlineinherited

◆ getType()

CompositorPassType Ogre::CompositorPass::getType ( ) const
inlineinherited

◆ notifyCleared()

virtual void Ogre::CompositorPass::notifyCleared ( )
virtualinherited

◆ notifyDestroyed() [1/2]

virtual void Ogre::CompositorPass::notifyDestroyed ( const UavBufferPacked buffer)
virtualinherited

◆ notifyDestroyed() [2/2]

virtual void Ogre::CompositorPass::notifyDestroyed ( TextureGpu channel)
virtualinherited

◆ notifyRecreated() [1/2]

virtual bool Ogre::CompositorPass::notifyRecreated ( const TextureGpu channel)
virtualinherited

◆ notifyRecreated() [2/2]

virtual void Ogre::CompositorPass::notifyRecreated ( const UavBufferPacked oldBuffer,
UavBufferPacked newBuffer 
)
virtualinherited

Reimplemented in Ogre::CompositorPassUav.

◆ operator delete() [1/3]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr)
inlineinherited

◆ operator delete() [2/3]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
const char *  ,
int  ,
const char *   
)
inlineinherited

◆ operator delete() [3/3]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
void *   
)
inlineinherited

◆ operator delete[]() [1/2]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr)
inlineinherited

◆ operator delete[]() [2/2]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr,
const char *  ,
int  ,
const char *   
)
inlineinherited

◆ operator new() [1/3]

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz)
inlineinherited

◆ operator new() [2/3]

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
const char *  file,
int  line,
const char *  func 
)
inlineinherited

operator new, with debug line info

◆ operator new() [3/3]

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
void *  ptr 
)
inlineinherited

placement operator new

◆ operator new[]() [1/2]

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz)
inlineinherited

◆ operator new[]() [2/2]

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz,
const char *  file,
int  line,
const char *  func 
)
inlineinherited

array operator new, with debug line info

◆ profilingBegin()

void Ogre::CompositorPass::profilingBegin ( )
inherited

◆ profilingEnd()

void Ogre::CompositorPass::profilingEnd ( )
inherited

◆ resetNumPassesLeft()

virtual void Ogre::CompositorPass::resetNumPassesLeft ( )
virtualinherited

The documentation for this class was generated from the following file: