OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Ogre::CompositorPassQuad 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 <OgreCompositorPassQuad.h>

+ Inheritance diagram for Ogre::CompositorPassQuad:
+ Collaboration diagram for Ogre::CompositorPassQuad:

Public Member Functions

 CompositorPassQuad (const CompositorPassQuadDef *definition, Camera *defaultCamera, CompositorNode *parentNode, const CompositorChannel &target, Real horizonalTexelOffset, Real verticalTexelOffset)
 
virtual void execute (const Camera *lodCamera)
 
const CompositorPassDefgetDefinition (void) const
 
PassgetPass (void)
 Don't make this const (useful for compile-time multithreading errors) More...
 
CompositorPassType getType () const
 
ViewportgetViewport () const
 
virtual void notifyCleared (void)
 CompositorNode::_notifyCleared More...
 
virtual void notifyDestroyed (const CompositorChannel &channel)
 CompositorNode::notifyDestroyed More...
 
virtual void notifyRecreated (const CompositorChannel &oldChannel, const CompositorChannel &newChannel)
 CompositorNode::notifyRecreated More...
 
void operator delete (void *ptr)
 
void operator delete (void *ptr, void *)
 
void operator delete (void *ptr, const char *, int, const char *)
 
void operator delete[] (void *ptr)
 
void operator delete[] (void *ptr, const char *, int, const char *)
 
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 * operator new (size_t sz, void *ptr)
 placement operator new More...
 
void * operator new[] (size_t sz, const char *file, int line, const char *func)
 array operator new, with debug line info More...
 
void * operator new[] (size_t sz)
 

Protected Member Functions

RenderTargetcalculateRenderTarget (size_t rtIndex, const CompositorChannel &source)
 

Protected Attributes

CameramCamera
 
Rectangle2DmFsRect
 
Real mHorizonalTexelOffset
 
uint32 mNumPassesLeft
 
CompositorNodemParentNode
 
PassmPass
 
RenderTargetmTarget
 
Real mVerticalTexelOffset
 
ViewportmViewport
 

Private Attributes

CompositorPassQuadDef const * mDefinition
 

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 CompositorPassQuad 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

Definition at line 82 of file OgreCompositorPassQuad.h.

Constructor & Destructor Documentation

Ogre::CompositorPassQuad::CompositorPassQuad ( const CompositorPassQuadDef definition,
Camera defaultCamera,
CompositorNode parentNode,
const CompositorChannel target,
Real  horizonalTexelOffset,
Real  verticalTexelOffset 
)

Member Function Documentation

RenderTarget* Ogre::CompositorPass::calculateRenderTarget ( size_t  rtIndex,
const CompositorChannel source 
)
protectedinherited
virtual void Ogre::CompositorPassQuad::execute ( const Camera lodCamera)
virtual

Implements Ogre::CompositorPass.

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

Definition at line 93 of file OgreCompositorPass.h.

Pass* Ogre::CompositorPassQuad::getPass ( void  )
inline

Don't make this const (useful for compile-time multithreading errors)

Definition at line 101 of file OgreCompositorPassQuad.h.

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

Definition at line 89 of file OgreCompositorPass.h.

Viewport* Ogre::CompositorPass::getViewport ( ) const
inlineinherited

Definition at line 91 of file OgreCompositorPass.h.

virtual void Ogre::CompositorPass::notifyCleared ( void  )
virtualinherited
virtual void Ogre::CompositorPass::notifyDestroyed ( const CompositorChannel channel)
virtualinherited
virtual void Ogre::CompositorPass::notifyRecreated ( const CompositorChannel oldChannel,
const CompositorChannel newChannel 
)
virtualinherited
template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr)
inlineinherited

Definition at line 96 of file OgreMemoryAllocatedObject.h.

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

Definition at line 102 of file OgreMemoryAllocatedObject.h.

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

Definition at line 108 of file OgreMemoryAllocatedObject.h.

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

Definition at line 113 of file OgreMemoryAllocatedObject.h.

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

Definition at line 119 of file OgreMemoryAllocatedObject.h.

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

Definition at line 68 of file OgreMemoryAllocatedObject.h.

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

Definition at line 73 of file OgreMemoryAllocatedObject.h.

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

placement operator new

Definition at line 79 of file OgreMemoryAllocatedObject.h.

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

Definition at line 86 of file OgreMemoryAllocatedObject.h.

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

Definition at line 91 of file OgreMemoryAllocatedObject.h.

Member Data Documentation

Camera* Ogre::CompositorPassQuad::mCamera
protected

Definition at line 88 of file OgreCompositorPassQuad.h.

CompositorPassQuadDef const* Ogre::CompositorPassQuad::mDefinition
private

Definition at line 84 of file OgreCompositorPassQuad.h.

Rectangle2D* Ogre::CompositorPassQuad::mFsRect
protected

Definition at line 86 of file OgreCompositorPassQuad.h.

Real Ogre::CompositorPassQuad::mHorizonalTexelOffset
protected

Definition at line 90 of file OgreCompositorPassQuad.h.

uint32 Ogre::CompositorPass::mNumPassesLeft
protectedinherited

Definition at line 66 of file OgreCompositorPass.h.

CompositorNode* Ogre::CompositorPass::mParentNode
protectedinherited

Definition at line 68 of file OgreCompositorPass.h.

Pass* Ogre::CompositorPassQuad::mPass
protected

Definition at line 87 of file OgreCompositorPassQuad.h.

RenderTarget* Ogre::CompositorPass::mTarget
protectedinherited

Definition at line 63 of file OgreCompositorPass.h.

Real Ogre::CompositorPassQuad::mVerticalTexelOffset
protected

Definition at line 91 of file OgreCompositorPassQuad.h.

Viewport* Ogre::CompositorPass::mViewport
protectedinherited

Definition at line 64 of file OgreCompositorPass.h.


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