#include <cubedepthrendertarget.h>
Public Member Functions | |
| CubeDepthRenderTarget (Core &core) | |
| ~CubeDepthRenderTarget () | |
| 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 |
| 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 |
| glm::ivec2 | getSize () const |
| void | render (CubeDepthRenderTargetCallback renderCallback) |
| void | render (PerspCameraComponentInstance &camera, CubeDepthRenderTargetCallback renderCallback) |
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... | |
| float | mClearValue = 1.0f |
| Property: 'ClearValue' value 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... | |
| DepthRenderTextureCube::EDepthFormat | mDepthFormat = DepthRenderTextureCube::EDepthFormat::D32 |
| Property: 'DepthFormat' the cube texture depth format. More... | |
| ResourcePtr< DepthRenderTextureCube > | mCubeDepthTexture |
| Property: 'CubeDepthTexture' Cube depth texture to render to. 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 specialized version of nap::RenderTarget that renders a cube depth texture. As a cube texture comprises six views of the scene, the render function carries out six render passes, each from a different point of view by means of particular view and projection transformations. The result of these render passes is stored in a multi-layer Vulkan image, each layer representing one view through the side of a unit cube.
| CubeDepthRenderTarget | ( | Core & | core | ) |
Every cube depth render target requires a reference to core.
| core | link to a nap core instance |
Destroys allocated render resources
|
overridevirtual |
Starts a render pass for the current layer index. Called by CubeDepthRenderTarget::renderInternal.
Implements IRenderTarget.
|
overridevirtual |
Ends a render pass for the current layer index. Called by CubeDepthRenderTarget::renderInternal.
Implements IRenderTarget.
|
overridevirtual |
Implements IRenderTarget.
|
overridevirtual |
Implements IRenderTarget.
|
overridevirtual |
Implements IRenderTarget.
|
overridevirtual |
Implements IRenderTarget.
|
overridevirtual |
Implements IRenderTarget.
|
overridevirtual |
Implements IRenderTarget.
|
overridevirtual |
Cube textures currently only support single sample render pass. Therefore, this function always returns VK_SAMPLE_COUNT_1_BIT.
Implements IRenderTarget.
|
overridevirtual |
Implements IRenderTarget.
| glm::ivec2 getSize | ( | ) | const |
|
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.
| void render | ( | CubeDepthRenderTargetCallback | renderCallback | ) |
Renders objects to nap::DepthRenderTextureCube using the specified nap::CubeRenderTarget. Use 'renderCallback' to group the rendering work of a single render pass. This pass is repeated six times to create the resulting cube texture. The view and projection transformations are computed by nap::CubeRenderTarget and passed as arguments to a callback function. The following example demonstrates this using a lambda function:
| void render | ( | PerspCameraComponentInstance & | camera, |
| CubeDepthRenderTargetCallback | renderCallback | ||
| ) |
Renders objects to nap::DepthRenderTextureCube using the specified nap::CubeRenderTarget. Use 'renderCallback' to group the rendering work of a single render pass. This pass is repeated six times to create the resulting cube texture. The view and projection transformations are computed by nap::CubeRenderTarget and passed as arguments to a callback function. The following example demonstrates this using a lambda function:
|
overridevirtual |
Updates the render target clear color.
| color | the new clear color to use. |
Implements IRenderTarget.
| float mClearValue = 1.0f |
Property: 'ClearValue' value selection used for clearing the render target.
| ResourcePtr<DepthRenderTextureCube> mCubeDepthTexture |
Property: 'CubeDepthTexture' Cube depth texture to render to.
Property: 'DepthFormat' the cube texture depth format.
| 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.