Describes a target operation set. More...
Public Member Functions | |
TargetOperations () | |
virtual | ~TargetOperations () |
void | setName (const nkMemory::StringView &name) |
const nkMemory::StringView | getName () const |
ClearTargetsPass * | addClearTargetsPass (unsigned int index=-1) |
ComputePass * | addComputePass (unsigned int index=-1) |
InstancingPass * | addInstancingPass (unsigned int index=-1) |
MonoMaterialPass * | addMonoMaterialPass (unsigned int index=-1) |
PostProcessPass * | addPostProcessPass (unsigned int index=-1) |
RaytracingPass * | addRaytracingPass (unsigned int index=-1) |
RenderScenePass * | addRenderScenePass (unsigned int index=-1) |
unsigned int | getPassCount () const |
Pass * | getPass (unsigned int index) const |
virtual void | deletePass (unsigned int index) |
virtual void | changePassOrder (unsigned int fromIndex, unsigned int toIndex) |
virtual void | setColorTarget (const TargetDescriptor &targetDesc, unsigned int outputIndex=0) |
virtual void | addColorTarget (const TargetDescriptor &targetDesc) |
virtual void | changeColorTargetOrder (unsigned int fromIndex, unsigned int toIndex) |
virtual void | removeColorTarget (unsigned int index) |
virtual void | setDepthTarget (Texture *target) |
unsigned int | getColorTargetCount () const |
Texture * | getColorTarget (unsigned int index) const |
int | getColorTargetRenderIndex (unsigned int index) const |
Texture * | getDepthTarget () const |
virtual void | setToBackBuffer (bool val, unsigned int indexInArray=0) |
bool | isToBackBuffer () const |
unsigned int | getBackBufferViewIndex () const |
virtual void | setToChainDepthBuffer (bool val) |
bool | isToChainDepthBuffer () const |
virtual void | setOverloadedViewport (Viewport *value) |
Viewport * | getOverloadedViewport () const |
virtual void | execute ()=0 |
virtual void | exportClassToTree (nkExport::Node *rootNode) override |
virtual void | importClassFromTree (nkExport::Node *rootNode) override |
void | processColorTargetObjectNode (nkExport::Node *targetNode) |
void | processPassObjectNode (nkExport::Node *passNode) |
Public Member Functions inherited from nkExport::Exportable | |
Exportable () noexcept | |
virtual | ~Exportable () |
Describes a target operation set.
Its role is to specify where a rendering should happen. This implies setting any number of render target and the depth target. The passes are then executed sequentially to paint and use given targets.
nkGraphics::TargetOperations::TargetOperations | ( | ) |
Constructor. In theory, should not be called by external code. See CompositorNode::addOperations().
|
virtual |
Destructor.
void nkGraphics::TargetOperations::setName | ( | const nkMemory::StringView & | name | ) |
Sets the name of the operations.
name | The name to use for the operations. |
const nkMemory::StringView nkGraphics::TargetOperations::getName | ( | ) | const |
ClearTargetsPass* nkGraphics::TargetOperations::addClearTargetsPass | ( | unsigned int | index = -1 | ) |
Adds a clear targets pass to the operations.
index | If specified within [0, nbPass], will replace the pass specified by the index. Else, creates a new pass. |
ComputePass* nkGraphics::TargetOperations::addComputePass | ( | unsigned int | index = -1 | ) |
Adds a compute pass to the operations.
index | If specified within [0, nbPass], will replace the pass specified by the index. Else, creates a new pass. |
InstancingPass* nkGraphics::TargetOperations::addInstancingPass | ( | unsigned int | index = -1 | ) |
Adds an instancing pass to the operations.
index | If specified within [0, nbPass], will replace the pass specified by the index. Else, creates a new pass. |
MonoMaterialPass* nkGraphics::TargetOperations::addMonoMaterialPass | ( | unsigned int | index = -1 | ) |
Adds a mono-material pass to the operations.
index | If specified within [0, nbPass], will replace the pass specified by the index. Else, creates a new pass. |
PostProcessPass* nkGraphics::TargetOperations::addPostProcessPass | ( | unsigned int | index = -1 | ) |
Adds a post processing pass to the operations.
index | If specified within [0, nbPass], will replace the pass specified by the index. Else, creates a new pass. |
RaytracingPass* nkGraphics::TargetOperations::addRaytracingPass | ( | unsigned int | index = -1 | ) |
Adds a raytracing pass to the operations.
index | If specified within [0, nbPass], will replace the pass specified by the index. Else, creates a new pass. |
RenderScenePass* nkGraphics::TargetOperations::addRenderScenePass | ( | unsigned int | index = -1 | ) |
Adds a render scene pass to the operations.
index | If specified within [0, nbPass], will replace the pass specified by the index. Else, creates a new pass. |
unsigned int nkGraphics::TargetOperations::getPassCount | ( | ) | const |
Pass* nkGraphics::TargetOperations::getPass | ( | unsigned int | index | ) | const |
index | The index of the pass to retrieve. |
|
virtual |
Erases and frees the memory of a pass.
index | The index of the pass to erase. |
|
virtual |
Changes the ordering in the pass execution.
fromIndex | The index of the pass to move. |
toIndex | The index of the pass to swap with. |
|
virtual |
Sets a color target to a particular slot in the rendering array. It overrides any target previously set at given index. If the index is bigger than the target count, target just gets added as the last target.
targetDesc | The description of the target to render to. |
outputIndex | The index at which the target should be set. |
|
virtual |
Adds a color target to the operations. Multi target is possible by adding multiple targets. The index associated in the output mergers will be given by the order in which targets are added, starting at 0.
targetDesc | The description of the target to render to. |
|
virtual |
Allows to change a target to make it attach to another slot.
fromIndex | The current index ot the target to move. |
toIndex | To which index it should be moved. |
|
virtual |
index | The index of the target to remove in the operations tracking memory. |
|
virtual |
target | The depth target to use. |
unsigned int nkGraphics::TargetOperations::getColorTargetCount | ( | ) | const |
Texture* nkGraphics::TargetOperations::getColorTarget | ( | unsigned int | index | ) | const |
index | The index of the target to retrieve in the operations tracking memory. |
int nkGraphics::TargetOperations::getColorTargetRenderIndex | ( | unsigned int | index | ) | const |
Allows to retrieve the index of the render target view used for a render target at given index in tracking memory.
index | The index of the render target, in the operations memory. |
Texture* nkGraphics::TargetOperations::getDepthTarget | ( | ) | const |
|
virtual |
Enables the operations to render to the target provided by the context.
val | If the rendering should happen (true) or not (false). |
indexInArray | The index in which the back buffer should be written, if multi-target rendering is needed. |
bool nkGraphics::TargetOperations::isToBackBuffer | ( | ) | const |
unsigned int nkGraphics::TargetOperations::getBackBufferViewIndex | ( | ) | const |
|
virtual |
Sets if the operations should use the depth buffer provided by the context.
val | If the compositor's depth buffer should be used (true) or not (false). |
bool nkGraphics::TargetOperations::isToChainDepthBuffer | ( | ) | const |
|
virtual |
Sets the viewport to use during the operations. By default, the viewport corresponds with the render targets dimensions. This function can be used to override this behaviour.
value | The viewport to use when executing. |
Viewport* nkGraphics::TargetOperations::getOverloadedViewport | ( | ) | const |
|
pure virtual |
Executes the operations and run all the passes. In theory, this function should not be called by external code, it is part of the rendering routine. See Compositor::renderChain().
|
overridevirtual |
Basic exporting capabilities.
rootNode | The tree to export to. |
Implements nkExport::Exportable.
|
overridevirtual |
Basic importing capabilities.
rootNode | The tree to import from. |
Implements nkExport::Exportable.
void nkGraphics::TargetOperations::processColorTargetObjectNode | ( | nkExport::Node * | targetNode | ) |
Utility function to process a target from its declaration. In theory, should not be called by external code. Used during import.
targetNode | The tree describing the render target. |
void nkGraphics::TargetOperations::processPassObjectNode | ( | nkExport::Node * | passNode | ) |
Utility function to process a pass from its declaration. In theory, should not be called by external code. Used during import.
passNode | The tree describing the pass. |