#include <cuberendertarget.h>
Public Member Functions | |
CubeRenderTarget (Core &core) | |
~CubeRenderTarget () | |
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 |
TextureCube & | getColorTexture () |
virtual VkFormat | getColorFormat () const override |
virtual VkFormat | getDepthFormat () const override |
virtual VkSampleCountFlagBits | getSampleCount () const override |
virtual bool | getSampleShadingEnabled () const override |
glm::ivec2 | getSize () const |
void | render (CubeRenderTargetCallback renderCallback) |
void | render (PerspCameraComponentInstance &camera, CubeRenderTargetCallback renderCallback) |
uint | getLayerIndex () const |
![]() | |
Resource () | |
![]() | |
Object () | |
virtual | ~Object () |
virtual void | onDestroy () |
Object (Object &)=delete | |
Object & | operator= (const Object &)=delete |
Object (Object &&)=delete | |
Object & | operator= (Object &&)=delete |
Static Public Member Functions | |
static const std::vector< glm::mat4 > & | getCubeMapViewMatrices () |
static const std::vector< glm::mat4 > & | getCubeMapInverseViewMatrices () |
![]() | |
static bool | isIDProperty (rtti::Instance &object, const rtti::Property &property) |
Public Attributes | |
bool | mSampleShading = true |
Property: 'SampleShading' Reduces texture aliasing when enabled, at higher computational cost. More... | |
bool | mUpdateLODs = false |
Property: 'UpdateLODs0' Updates mip-maps using blit operations after rendering when the texture has LODs enabled. More... | |
RGBAColorFloat | mClearColor = { 0.0f, 0.0f, 0.0f, 0.0f } |
Property: 'ClearColor' color selection used for clearing the render target. More... | |
RenderTextureCube::EFormat | mColorFormat = RenderTextureCube::EFormat::RGBA8 |
Property: 'ColorFormat' the cube texture color format. More... | |
DepthRenderTextureCube::EDepthFormat | mDepthFormat = DepthRenderTextureCube::EDepthFormat::D16 |
Property: 'DepthFormat' the cube texture depth format. More... | |
ResourcePtr< TextureCube > | mCubeTexture |
Property: 'CubeTexture' cube texture to render to. More... | |
![]() | |
std::string | mID |
Property: 'mID' unique name of the object. Used as an identifier by the system. More... | |
A specialized version of nap::RenderTarget that renders a cube 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.
Cube textures also support LODs. Enabling the UpdateLODs
will automatically perform a blit operation to all mip-map levels after the cube texture was updated in the render
function.
CubeRenderTarget | ( | Core & | core | ) |
Every cube render target requires a reference to core.
core | link to a nap core instance |
~CubeRenderTarget | ( | ) |
Destroys allocated render resources
|
overridevirtual |
Starts a render pass for the current layer index. Called by CubeRenderTarget::renderInternal.
Implements IRenderTarget.
|
overridevirtual |
Ends a render pass for the current layer index. Called by CubeRenderTarget::renderInternal.
Implements IRenderTarget.
|
overridevirtual |
Implements IRenderTarget.
|
overridevirtual |
Implements IRenderTarget.
|
overridevirtual |
Implements IRenderTarget.
TextureCube& getColorTexture | ( | ) |
|
static |
|
static |
|
overridevirtual |
Implements IRenderTarget.
uint getLayerIndex | ( | ) | const |
Returns the current texture layer index. This value only changes when the individual render layer commands are being recorded to the command buffer. Generally only useful when building highly custom rendering operations.
|
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 cube render target, including all the required resources.
errorState | contains the error if initialization failed. |
Reimplemented from Object.
void render | ( | CubeRenderTargetCallback | renderCallback | ) |
Renders objects to nap::RenderTextureCube 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, |
CubeRenderTargetCallback | renderCallback | ||
) |
Renders objects to nap::RenderTextureCube 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.
RGBAColorFloat mClearColor = { 0.0f, 0.0f, 0.0f, 0.0f } |
Property: 'ClearColor' color selection used for clearing the render target.
RenderTextureCube::EFormat mColorFormat = RenderTextureCube::EFormat::RGBA8 |
Property: 'ColorFormat' the cube texture color format.
ResourcePtr<TextureCube> mCubeTexture |
Property: 'CubeTexture' cube texture to render to.
Property: 'DepthFormat' the cube texture depth format.
bool mSampleShading = true |
Property: 'SampleShading' Reduces texture aliasing when enabled, at higher computational cost.
bool mUpdateLODs = false |
Property: 'UpdateLODs0' Updates mip-maps using blit operations after rendering when the texture has LODs enabled.