#include <rendertarget.h>
Public Member Functions | |
| RenderTarget (Core &core) | |
| ~RenderTarget () | |
| virtual bool | init (utility::ErrorState &errorState) override |
| virtual void | beginRendering () override |
| virtual void | endRendering () override |
| virtual const glm::ivec2 | getBufferSize () const override |
| virtual void | setClearColor (const RGBAColorFloat &color) override |
| virtual const RGBAColorFloat & | getClearColor () const override |
| virtual ECullWindingOrder | getWindingOrder () const override |
| virtual VkRenderPass | getRenderPass () const override |
| RenderTexture2D & | getColorTexture () |
| virtual VkFormat | getColorFormat () const override |
| virtual VkFormat | getDepthFormat () const override |
| virtual VkSampleCountFlagBits | getSampleCount () const override |
| virtual bool | getSampleShadingEnabled () const override |
| virtual VkImageLayout | getFinalLayout () const override |
Public Member Functions inherited from Resource | |
| Resource () | |
Public Member Functions inherited from Object | |
| Object () | |
| virtual | ~Object () |
| virtual void | onDestroy () |
| Object (Object &)=delete | |
| Object & | operator= (const Object &)=delete |
| Object (Object &&)=delete | |
| Object & | operator= (Object &&)=delete |
Public Attributes | |
| bool | mSampleShading = true |
| Property: 'SampleShading' Reduces texture aliasing when enabled, at higher computational cost. More... | |
| RGBAColorFloat | mClearColor = { 0.0f, 0.0f, 0.0f, 0.0f } |
| Property: 'ClearColor' color selection used for clearing the render target. More... | |
| ERasterizationSamples | mRequestedSamples = ERasterizationSamples::One |
| Property: 'Samples' The number of samples used during Rasterization. For better results turn on 'SampleShading'. More... | |
| ResourcePtr< RenderTexture2D > | mColorTexture |
| Property: 'ColorTexture' texture to render to. More... | |
| bool | mClear = true |
| Property: 'Clear' whether to clear the render target at the start of each render pass. More... | |
Public Attributes inherited from Object | |
| std::string | mID |
| Property: 'mID' unique name of the object. Used as an identifier by the system. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from Object | |
| static bool | isIDProperty (rtti::Instance &object, const rtti::Property &property) |
A resource that is used to render one or multiple objects to a nap::RenderTexture2D instead of a nap::RenderWindow. This objects requires a link to a nap::RenderTexture2D to store the result of the render pass. Only render to a render target within a headless recording pass, failure to do so will result in undefined behavior. Make sure to call beginRendering() to start the render pass and endRendering() to end the render pass. Always call RenderService::endHeadlessRecording after having recorded all off-screen render operations.
| RenderTarget | ( | Core & | core | ) |
Every render target requires a reference to core.
| core | link to a nap core instance |
| ~RenderTarget | ( | ) |
Destroys allocated render resources
|
overridevirtual |
Starts the render pass. Only start the render pass after a successful call to RenderService::beginHeadlessRecording().
Implements IRenderTarget.
|
overridevirtual |
Ends the render pass. Always call this after beginRendering().
Implements IRenderTarget.
|
overridevirtual |
Implements IRenderTarget.
|
overridevirtual |
Implements IRenderTarget.
|
overridevirtual |
Implements IRenderTarget.
| RenderTexture2D& getColorTexture | ( | ) |
|
overridevirtual |
Implements IRenderTarget.
|
overridevirtual |
Implements IRenderTarget.
|
overridevirtual |
Implements IRenderTarget.
|
overridevirtual |
Implements IRenderTarget.
|
overridevirtual |
Implements IRenderTarget.
|
overridevirtual |
Geometry winding order, defaults to clockwise.
Implements IRenderTarget.
|
overridevirtual |
Initializes the render target, including all the required resources.
| errorState | contains the error if initialization failed. |
Reimplemented from Object.
|
overridevirtual |
Updates the render target clear color.
| color | the new clear color to use. |
Implements IRenderTarget.
| bool mClear = true |
Property: 'Clear' whether to clear the render target at the start of each render pass.
| RGBAColorFloat mClearColor = { 0.0f, 0.0f, 0.0f, 0.0f } |
Property: 'ClearColor' color selection used for clearing the render target.
| ResourcePtr<RenderTexture2D> mColorTexture |
Property: 'ColorTexture' texture to render to.
| ERasterizationSamples mRequestedSamples = ERasterizationSamples::One |
Property: 'Samples' The number of samples used during Rasterization. For better results turn on 'SampleShading'.
| bool mSampleShading = true |
Property: 'SampleShading' Reduces texture aliasing when enabled, at higher computational cost.