Kanzi  3.9.6
Kanzi Engine API
kanzi::Texture::CreateInfoRenderpassRenderTarget Struct Reference

Texture creation parameters for texture that can be used as render target for renderpasses. More...

#include <kanzi/core.ui/graphics2d/texture_create_info.hpp>

Inheritance diagram for kanzi::Texture::CreateInfoRenderpassRenderTarget:
[legend]

Public Member Functions

 CreateInfoRenderpassRenderTarget (unsigned int width, unsigned int height, GraphicsFormat format)
 Constructor for CreateInfoRenderpassRenderTarget - non-multisample version. More...
 
 CreateInfoRenderpassRenderTarget (Renderer *renderer, unsigned int sampleCount, unsigned int width, unsigned int height, GraphicsFormat format)
 Constructor for CreateInfoRenderpassRenderTarget - multisample version. More...
 
- Public Member Functions inherited from kanzi::Texture::CreateInfo2D
 CreateInfo2D (BitmapImageUniquePtr image)
 CreateInfo2D constructor for texture creation parameters, for creating a two dimensional texture that is initialized from an image. More...
 
 CreateInfo2D (Sampler::MipmapMode mipmaps, BitmapImageUniquePtr image)
 CreateInfo2D constructor that also takes in mipmap mode. More...
 
 CreateInfo2D (unsigned int width, unsigned int height, GraphicsFormat format)
 CreateInfo2D constructor for texture creation parameters, for creating a two dimensional texture with specified format and size. More...
 
- Public Member Functions inherited from kanzi::Texture::CreateInfo
Status adjust (const Renderer &renderer, string_view name)
 Validates and applies adjustments to some texture creation parameters in case of avoidable error conditions. More...
 
 CreateInfo ()
 Default constructor for texture create info. More...
 
void updateShapeAndFormatFromImages ()
 Use updateShapeAndFormatFromImages() to fill in format, width, height from images. More...
 
Status validate (const Renderer &renderer, string_view name) const
 Perform validation of texture creation parameters. More...
 
Status validate (const Renderer &renderer) const
 Perform validation of texture creation parameters. More...
 

Additional Inherited Members

- Public Types inherited from kanzi::Texture::CreateInfo
enum  Status {
  StatusInvalidType, StatusTypeNotSupported, StatusInvalidRenderTargetMode, StatusInvalidImageCount,
  StatusMissingImages, StatusImageMissingMipmaps, StatusInvalidImageSize, StatusInvalidMinimumSize,
  StatusInvalidMaximumSize, StatusInvalidMipmapSize, StatusUnsupportedGraphicsFormat, StatusUnsupportedTextureFilter,
  StatusInvalidFeatures, StatusUnsupportedMultisampleFilter, StatusUnsupportedMultisampleMipmaps, StatusUnsupportedMultisampleSamples,
  StatusUnsupportedInternalRenderTargetSampleCount, StatusUnsupportedSampleCount, StatusImageFormatMismatch, StatusImageIncompatibleWithDevice,
  StatusUnsupportedDepthComparisonMode, StatusValid
}
 Status tells if texture creation parameters can be used to create a texture. More...
 
- Static Public Member Functions inherited from kanzi::Texture::CreateInfo
static CreateInfo createSubstitutePattern (const Renderer &renderer, TextureType type)
 Create a texture create info structure for a black 1x1 texture. More...
 
- Public Attributes inherited from kanzi::Texture::CreateInfo
Sampler::AddressingMode addressingMode
 Texture addressing mode. More...
 
float anisotropy
 Texture anisotropy. More...
 
unsigned int depth
 Reserved for future use. More...
 
GraphicsCompareFunction depthCompareFunction
 Depth comparison function. More...
 
GraphicsFormat depthStencilFormat
 DepthStencil format. More...
 
unsigned int features
 Required format features. More...
 
GraphicsFormat format
 Format for texture. More...
 
unsigned int height
 Height for the base level of texture. More...
 
unsigned int heightDivisor
 Automatic size determination divisor for height, 0 when not automatic. More...
 
vector< BitmapImageSharedPtrimages
 Images that are used to create the texture. More...
 
Sampler::Filter magnificationFilter
 Texture minification filter. More...
 
float maxLod
 Reserved for future use. More...
 
MemoryType memoryType
 Memory type for the texture. More...
 
Sampler::Filter minificationFilter
 Texture magnification filter. More...
 
float minLod
 Reserved for future use. More...
 
float mipLodBias
 Reserved for future use. More...
 
unsigned int mipmapLevelCount
 Number of mipmap levels for the texture. More...
 
Sampler::MipmapMode mipmapMode
 Mipmap mode for the texture. More...
 
NativeDeploymentTarget nativeDeploymentTarget
 Native deployment target to use for memory storage if supported by the backend. More...
 
RenderTargetMode renderTargetMode
 RenderTarget mode for the texture. More...
 
unsigned int renderTargetSampleCount
 Specifies number of samples for the draw renderbuffer when RenderTargetMode is RenderTargetModeExternal. More...
 
TextureType type
 Texture type. More...
 
unsigned int width
 Width for the base level of texture. More...
 
unsigned int widthDivisor
 Automatic size determination divisor for width, 0 when not automatic. More...
 
- Protected Member Functions inherited from kanzi::Texture::CreateInfo
Status validateFormat (const Renderer &renderer) const
 Validates texture format and features. More...
 
Status validateImages (const Renderer &renderer) const
 Test if given set of images can be used to create Texture. More...
 
Status validateSize (const Renderer &renderer) const
 Validates texture size against minimum valid texture size (1x1) and maximum supported by graphics adapter. More...
 
Status validateTargetCompatibility (const Renderer &renderer) const
 Checks for known device incompatibilities, for example with texture formats and size. More...
 

Detailed Description

Texture creation parameters for texture that can be used as render target for renderpasses.

You can use the resulting texture as content in Image2D nodes or texture brushes. You can also use the resulting texture in materials for 3D rendering or material brushes.

Constructor & Destructor Documentation

◆ CreateInfoRenderpassRenderTarget() [1/2]

kanzi::Texture::CreateInfoRenderpassRenderTarget::CreateInfoRenderpassRenderTarget ( unsigned int  width,
unsigned int  height,
GraphicsFormat  format 
)
explicit

Constructor for CreateInfoRenderpassRenderTarget - non-multisample version.

After the CreateInfoRenderpassRenderTarget constructor:

  • Texture features is set to GraphicsFormatFeatureSampledImage | GraphicsFormatFeatureColorAttachment.
  • Texture rendertarget mode is set to RenderTargetModeExternal, so renderpasses can use the resulting texture.

The following (from CreateInfo2D constructor) also applies:

  • Texture type is set to TypeTwoDimensional.
  • Texture size and format is set according to constructor parameters.

The following (from CreateInfo constructor) also applies:

  • Texture minification and magnification filter settings are set to FilterNearest.
  • Texture wrap mode is set to AddressingModeClamp, so texture will not repeat.
  • Texture mipmap mode is set to MipmapModeBase, and mipmapLevelCount is set to 1, so texture will have only base image, no mipmaps.
Note
After constructor, due to filter settings and lack of mipmaps, the resulting texture should only be used when texture content is shown without scaling. If resulting texture is shown with scaling, the result has noticeable aliasing. You can adjust settings in the create info structure after constructor before passing it to Texture::create() if default settings are not ideal for you.
Not all texture formats support rendering to (GraphicsFormatFeatureColorAttachment). Make sure you use texture format that your device supports rendering to.

When you create texture from CreateInfoRenderpassRenderTarget, texture contents are initially undefined. Set texture as rendertarget for a renderpass, and arrange viewport node to be rendered with the renderpass before using the texture as content.

See also
Scene::RenderPassProperty
Parameters
widthWidth for the texture.
heightHeight for the texture.
formatFormat for the texture.

◆ CreateInfoRenderpassRenderTarget() [2/2]

kanzi::Texture::CreateInfoRenderpassRenderTarget::CreateInfoRenderpassRenderTarget ( Renderer renderer,
unsigned int  sampleCount,
unsigned int  width,
unsigned int  height,
GraphicsFormat  format 
)
explicit

Constructor for CreateInfoRenderpassRenderTarget - multisample version.

Use this CreateInfoRenderpassRenderTarget to create a texture which can be used in renderpasses with multisample anti aliasing.

Note
CreateInfoRenderpassRenderTarget constructor will throw an exception, which may stop program execution, if graphics device does not support multisample renderbuffers.

After the CreateInfoRenderpassRenderTarget constructor:

  • Texture features will have GraphicsFormatFeatureSampledImage and GraphicsFormatFeatureColorAttachment bits set. If graphics device supports multisampled render to texture extension, GraphicsFormatFeatureColorAttachment bit will be set in features. Else, if any other multisample technique is supported by graphics device, GraphicsFormatFeatureBlitDestination bit will be set in features.
  • Texture rendertarget mode is set to RenderTargetModeExternal, so renderpasses can use the resulting texture.
  • Texture renderTargetSampleCount is set to requested number of samples

The following (from CreateInfo2D constructor) also applies:

  • Texture type is set to TypeTwoDimensional.
  • Texture size and format is set according to constructor parameters.

The following (from CreateInfo constructor) also applies:

  • Texture minification and magnification filter settings are set to FilterNearest.
  • Texture wrap mode is set to AddressingModeClamp, so texture will not repeat.
  • Texture mipmap mode is set to MipmapModeBase, and mipmapLevelCount is set to 1, so texture will have only base image, no mipmaps.
Note
After constructor, due to filter settings and lack of mipmaps, the resulting texture should only be used when texture content is shown without scaling. If resulting texture is shown with scaling, the result has noticeable aliasing. You can adjust settings in the create info structure after constructor before passing it to Texture::create() if default settings are not ideal for you.
Not all texture formats support rendering to (GraphicsFormatFeatureColorAttachment). Make sure you use texture format that your device supports rendering to.

When you create texture from CreateInfoRenderpassRenderTarget, texture contents are initially undefined. Set texture as rendertarget for a renderpass, and arrange a viewport node to be rendered with the renderpass before using the texture as content.

Note
The resulting texture is not a multisample texture. For all sampling purposes, the resulting texture does not have multiple samples. Rendering to the texture happens through either a multisample renderbuffer or implicit resolve (multisampled render to texture extension)
See also
Scene::RenderPassProperty
Parameters
rendererRenderer, to provide multisample path.
sampleCountNumber of samples.
widthWidth for the texture.
heightHeight for the texture.
formatFormat for the texture.

The documentation for this struct was generated from the following file: