![]() |
VPP
0.7
A high-level modern C++ API for Vulkan
|
Structure describing normalized sampler parameters. More...
#include <vppSampler.hpp>
Public Member Functions | |
SNormalizedSampler (float maxLod=1.0f) | |
Constructor setting default parameters. More... | |
bool | operator< (const SNormalizedSampler &rhs) const |
Ordering operator. Useful for storing sampler descriptions in sets or maps. | |
Public Attributes | |
unsigned int | addressModeU |
Texel addressing mode for the U coordinate. More... | |
unsigned int | addressModeV |
Texel addressing mode for the V coordinate. More... | |
unsigned int | addressModeW |
Texel addressing mode for the W coordinate. More... | |
unsigned int | borderColor |
Defines the color for border texels. More... | |
unsigned int | compareOp |
Specifies the comparison function to apply to fetched data before the depth compare operation. More... | |
unsigned int | compare |
Enables depth comparison operation for this sampler. More... | |
unsigned int | magFilterMode |
Specifies the method of interpolation when upscaling the texture. More... | |
unsigned int | minFilterMode |
Specifies the method of interpolation when downscaling the texture. More... | |
unsigned int | mipMapMode |
Specifies the method of interpolation between mip levels. More... | |
unsigned int | anisotropy |
Enables anisotropic filtering. More... | |
float | mipLodBias |
The bias to be added to mipmap LOD (level-of-detail) calculation. More... | |
float | maxAnisotropy |
The anisotropy value clamp. Ignored when anisotropy is disabled. More... | |
float | minLod |
The minimum value used to clamp the computed LOD value. More... | |
float | maxLod |
The maximum value used to clamp the computed LOD value. More... | |
Structure describing normalized sampler parameters.
Normalized sampler is a sampler using the coordinates in range [ 0, 1 ].
Use SNormalizedSampler structure to define parameters of the sampler and NormalizedSampler class to create the sampler object.
vpp::SNormalizedSampler::SNormalizedSampler | ( | float | maxLod = 1.0f | ) |
Constructor setting default parameters.
The default values are given in individual parameter descriptions.
unsigned int vpp::SNormalizedSampler::addressModeU |
Texel addressing mode for the U coordinate.
Controls the wraparound of computed integer coordinate of the texel.
Let SIZE
be the image size in corresponding direction and i
the integer coordinate value (computed from floating-point value). Then the meaning of values is as follows:
VK_SAMPLER_ADDRESS_MODE_REPEAT:
i mod SIZE
VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT:
(SIZE-1) - mirror ( ( i mod ( 2*SIZE ) ) - SIZE )
VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE:
clamp ( i, 0, SIZE-1 )
VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER:
clamp ( i, -1, SIZE )
VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE:
clamp ( mirror(i), 0, SIZE-1 )
The functions are defined as:
mirror ( n ) = ( n >= 0 ? n : -(1+n) )
clamp ( n, a, b ) = ( n < a ? a : ( n > b ? b : n ) )
See section 15.9.1 of the Vulkan specs for more detail.
Default value: VK_SAMPLER_ADDRESS_MODE_REPEAT
.
unsigned int vpp::SNormalizedSampler::addressModeV |
Texel addressing mode for the V coordinate.
The meaning is the same as for addressModeU
. See section 15.9.1 of the Vulkan specs for more detail.
Default value: VK_SAMPLER_ADDRESS_MODE_REPEAT
.
unsigned int vpp::SNormalizedSampler::addressModeW |
Texel addressing mode for the W coordinate.
The meaning is the same as for addressModeU
. See section 15.9.1 of the Vulkan specs for more detail.
Default value: VK_SAMPLER_ADDRESS_MODE_REPEAT
.
unsigned int vpp::SNormalizedSampler::anisotropy |
Enables anisotropic filtering.
See section 15.9.4 of the Vulkan specification for more details.
Default value: false.
unsigned int vpp::SNormalizedSampler::borderColor |
Defines the color for border texels.
A border texel is a texel outside valid range of coordinates. This can happen e.g. if VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER
mdoe is set. The substitute color is chosen according to the following:
See section 15.3.1 of Vulkan docs for more details.
Default value: VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK.
unsigned int vpp::SNormalizedSampler::compare |
Enables depth comparison operation for this sampler.
This field must be set to true
if this sampler will be used to sample a depth image with TextureDref, TextureLodDref, TextureProjDref, TextureLodProjDref, TextureGatherDref functions. In such case, also comparison operator must be selected.
Otherwise it must be set to false
.
Default value: false.
unsigned int vpp::SNormalizedSampler::compareOp |
Specifies the comparison function to apply to fetched data before the depth compare operation.
One of the following values:
Depth comparisons are performed when reading the image with depth comparing functions, namely: TextureDref, TextureLodDref, TextureProjDref, TextureLodProjDref, TextureGatherDref. These functions operate on images containing single floating point values, determining some kind of distance (e.g. from the light source). Depth comparison functions do not return this distance, but rather compares it with specified value and yield either 0.0
or 1.0
value depending on the selected comparison operator. These values are then subject to filtering (interpolation).
This is typically used in shadow map algorithms to create smooth shadows.
See section 15.3.4 of Vulkan docs for more details.
Default value: VK_COMPARE_OP_NEVER.
unsigned int vpp::SNormalizedSampler::magFilterMode |
Specifies the method of interpolation when upscaling the texture.
It has to be one of the values:
See section 15.9.3 of the Vulkan specification for more details.
Default value: VK_FILTER_LINEAR.
float vpp::SNormalizedSampler::maxAnisotropy |
The anisotropy value clamp. Ignored when anisotropy is disabled.
Default value: 0.
float vpp::SNormalizedSampler::maxLod |
The maximum value used to clamp the computed LOD value.
See section 15.6.7 of the Vulkan specification for more details.
Default value: 1 or specified in the constructor.
unsigned int vpp::SNormalizedSampler::minFilterMode |
Specifies the method of interpolation when downscaling the texture.
It has to be one of the values:
See section 15.9.3 of the Vulkan specification for more details.
Default value: VK_FILTER_LINEAR.
float vpp::SNormalizedSampler::minLod |
The minimum value used to clamp the computed LOD value.
See section 15.6.7 of the Vulkan specification for more details.
Default value: 0.
float vpp::SNormalizedSampler::mipLodBias |
The bias to be added to mipmap LOD (level-of-detail) calculation.
See section 15.6.7 of the Vulkan specification for more details.
Default value: 0.
unsigned int vpp::SNormalizedSampler::mipMapMode |
Specifies the method of interpolation between mip levels.
See section 15.9.3 of the Vulkan specification for more detail.
Default value: VK_SAMPLER_MIPMAP_MODE_LINEAR.