NAP
Public Types | Public Member Functions | Public Attributes | List of all members
DepthRenderTextureCube Class Reference

#include <rendertexturecube.h>

Public Types

enum  EDepthFormat { D16, D32 }
 
- Public Types inherited from Texture
enum  EUsage { Static, DynamicRead, DynamicWrite }
 

Public Member Functions

 DepthRenderTextureCube (Core &core)
 
virtual bool init (utility::ErrorState &errorState) override
 
- Public Member Functions inherited from TextureCube
 TextureCube (Core &core)
 
virtual ~TextureCube () override
 
bool init (const SurfaceDescriptor &descriptor, bool generateMipMaps, const glm::vec4 &clearColor, VkImageUsageFlags requiredFlags, utility::ErrorState &errorState)
 
const glm::vec2 getSize () const
 
int getWidth () const
 
int getHeight () const
 
VkImageUsageFlags getImageUsageFlags () const
 
virtual uint getLayerCount () const override
 
virtual uint getMipLevels () const override
 
virtual const ImageDatagetHandle () const override
 
virtual ImageDatagetHandle () override
 
- Public Member Functions inherited from Texture
 Texture (Core &core)
 
virtual ~Texture ()
 
virtual VkImageLayout getTargetLayout () const
 
VkFormat getFormat () const
 
const SurfaceDescriptorgetDescriptor () const
 
RenderServicegetRenderService ()
 
const RenderServicegetRenderService () const
 
virtual void onDestroy () override
 
- Public Member Functions inherited from Resource
 Resource ()
 
- Public Member Functions inherited from Object
 Object ()
 
virtual ~Object ()
 
 Object (Object &)=delete
 
Objectoperator= (const Object &)=delete
 
 Object (Object &&)=delete
 
Objectoperator= (Object &&)=delete
 

Public Attributes

int mWidth = 0
 Property: 'Width' width of a cube face texture in texels. More...
 
int mHeight = 0
 Property: 'Height' of a cube face texture in texels. More...
 
EColorSpace mColorSpace = EColorSpace::Linear
 Property: 'ColorSpace' texture color space. More...
 
EDepthFormat mDepthFormat = EDepthFormat::D16
 Property: 'DepthFormat' depth texture format. More...
 
float mClearValue = 1.0f
 Property: 'ClearValue' value selection used for clearing the texture. More...
 
bool mFill = false
 Property: 'Fill' if the texture is initialized to black when usage is static. More...
 
- Public Attributes inherited from TextureCube
const EUsage mUsage = EUsage::Static
 Texture usage (cube maps are currently always static) More...
 
- Public Attributes inherited from Texture
nap::Signal textureDestroyed
 Signal that is triggered before texture is destroyed. 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)
 
- Static Public Attributes inherited from TextureCube
static constexpr const uint layerCount = 6
 
- Protected Member Functions inherited from Texture
virtual void clear (VkCommandBuffer commandBuffer)
 
void requestClear ()
 
- Protected Attributes inherited from TextureCube
ImageData mImageData = { TextureCube::layerCount }
 Cube Texture vulkan image buffers. More...
 
uint32 mMipLevels = 1
 Total number of generated mip-maps. More...
 
- Protected Attributes inherited from Texture
RenderServicemRenderService
 Reference to the render service. More...
 
SurfaceDescriptor mDescriptor
 Texture description. More...
 
VkFormat mFormat = VK_FORMAT_UNDEFINED
 Vulkan texture format. More...
 
VkClearColorValue mClearColor = { 0.0f, 0.0f, 0.0f, 0.0f }
 Color used for clearing the texture. More...
 

Description

Empty cube GPU depth texture that can be declared as a resource in JSON or created at runtime. You can use this texture to store the result of a render pass by a nap::CubeDepthRenderTarget or any other type of render operation. The texture is cleared to 'ClearValue' before first use.

Internally, a cube texture creates a six-layer Vulkan image, each layer representing one side of a unit cube. Cube textures can be set to nap::SamplerCubeInstance for shader samplers of types samplerCube and samplerCubeShadow.

Cube image layers are addressed and oriented as follows:

Inheritance diagram for DepthRenderTextureCube:
[legend]
Collaboration diagram for DepthRenderTextureCube:
[legend]

Member Enumeration Documentation

◆ EDepthFormat

enum EDepthFormat
strong

All supported depth texture cube formats.

Enumerator
D16 

16 bit unsigned, 1 component

D32 

32 bit float, 1 component

Constructor & Destructor Documentation

◆ DepthRenderTextureCube()

Member Function Documentation

◆ init()

virtual bool init ( utility::ErrorState errorState)
overridevirtual

Creates the texture on the GPU.

Parameters
errorStateContains error state if the function fails.
Returns
if the texture was created successfully

Reimplemented from Object.

Member Data Documentation

◆ mClearValue

float mClearValue = 1.0f

Property: 'ClearValue' value selection used for clearing the texture.

◆ mColorSpace

Property: 'ColorSpace' texture color space.

◆ mDepthFormat

Property: 'DepthFormat' depth texture format.

◆ mFill

bool mFill = false

Property: 'Fill' if the texture is initialized to black when usage is static.

◆ mHeight

int mHeight = 0

Property: 'Height' of a cube face texture in texels.

◆ mWidth

int mWidth = 0

Property: 'Width' width of a cube face texture in texels.