API Documentation
Public Member Functions | List of all members
nkGraphics::Compositor Class Referenceabstract

A compositor, describing how to compose the rendering pipeline. More...

Inheritance diagram for nkGraphics::Compositor:
nkExport::Exportable

Public Member Functions

virtual ~Compositor ()
 
virtual CompositorNodeaddNode ()=0
 
virtual void deleteNode (unsigned int index)
 
virtual void changeNodeOrder (unsigned int fromIndex, unsigned int toIndex)
 
virtual void clearNodes ()
 
unsigned int getNodeCount () const
 
CompositorNodegetNode (unsigned int index) const
 
virtual void renderChain ()
 
virtual void exportClassToTree (nkExport::Node *rootNode) override
 
virtual void importClassFromTree (nkExport::Node *rootNode) override
 
Compositoroperator= (const Compositor &)=delete
 
- Public Member Functions inherited from nkExport::Exportable
 Exportable () noexcept
 
virtual ~Exportable ()
 

Detailed Description

A compositor, describing how to compose the rendering pipeline.

This class is the basic system that allows the whole rendering to occur.

The purpose is to populate it with CompositorNode. The nodes can be activated and deactivated on the fly.
Those nodes are populated with TargetOperation, which describes the outputs for a rendering operation.
The operations are populated with any kind of Pass. The pass are executed sequentially to reach the rendering result wished.

This descriptive kind of API allows the engine to organize and schedule work to help maintaining an efficient rendering logic. There is currently no other way in nkGraphics to render.

See CompositorManager::createOrRetrieve() or Compositor::create() for instantiation.

Constructor & Destructor Documentation

◆ ~Compositor()

virtual nkGraphics::Compositor::~Compositor ( )
virtual

Destructor.

Member Function Documentation

◆ addNode()

virtual CompositorNode* nkGraphics::Compositor::addNode ( )
pure virtual

Adds a node to the compositor.

Returns
The newly created node. The compositor owns the memory returned, external code should never delete it. See deleteNode().

◆ deleteNode()

virtual void nkGraphics::Compositor::deleteNode ( unsigned int  index)
virtual

Erases and frees a node memory.

Parameters
indexThe index of the node to free.

◆ changeNodeOrder()

virtual void nkGraphics::Compositor::changeNodeOrder ( unsigned int  fromIndex,
unsigned int  toIndex 
)
virtual

Changes the order of the nodes. Currently, this can be used to reorder the rendering steps (nodes are executed sequentially).

Parameters
fromIndexThe index of the node to move.
toIndexThe index to which the node should be moved.

◆ clearNodes()

virtual void nkGraphics::Compositor::clearNodes ( )
virtual

Clears and frees all the nodes.

◆ getNodeCount()

unsigned int nkGraphics::Compositor::getNodeCount ( ) const
Returns
The number of nodes available.

◆ getNode()

CompositorNode* nkGraphics::Compositor::getNode ( unsigned int  index) const
Parameters
indexThe index of the node to retrieve.
Returns
The node requested if available, nullptr else.

◆ renderChain()

virtual void nkGraphics::Compositor::renderChain ( )
virtual

Renders the compositor. This triggers the rendering process for the whole compositor. This method is a good candidate to do off-screen rendering.

However, be sure to prepare the component for the context you will want to render for using MainSystem::tickForNewFrame() and specify the right context for your needs. This will setup the cameras, viewports, and other context dependent variables used to feed the rendering pipeline.

◆ exportClassToTree()

virtual void nkGraphics::Compositor::exportClassToTree ( nkExport::Node rootNode)
overridevirtual

Basic exporting capability.

Parameters
rootNodeThe tree to export to.

Implements nkExport::Exportable.

◆ importClassFromTree()

virtual void nkGraphics::Compositor::importClassFromTree ( nkExport::Node rootNode)
overridevirtual

Basic importing capability.

Parameters
rootNodeThe tree to import from.

Implements nkExport::Exportable.

◆ operator=()

Compositor& nkGraphics::Compositor::operator= ( const Compositor )
delete

Copy operator.


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