GREM 3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
grem::graphics::TextureSamplerOptions Struct Reference

Configuration options for the sampler of a Texture. More...

#include <GREM/graphics/Texture.hpp>

Public Member Functions

constexpr bool operator== (const TextureSamplerOptions &other) const =default
 Compare this configuration to another for equality.

Public Attributes

TextureFilter minificationFilter = TextureFilter::LINEAR
 Filtering mode to use when the texture is rendered smaller than its original size.
TextureFilter magnificationFilter = TextureFilter::LINEAR
 Filtering mode to use when the texture is rendered larger than its original size.
TextureMipmapMode mipmapMode = TextureMipmapMode::LINEAR
 Mipmap mode to use when determining which mip detail level to sample depending on the texture's size on screen.
TextureWrappingMode horizontalWrappingMode = TextureWrappingMode::REPEAT
 How to address the texture when the horizontal component of the texture coordinates is outside the 0-1 range.
TextureWrappingMode verticalWrappingMode = TextureWrappingMode::REPEAT
 How to address the texture when the vertical component of the texture coordinates is outside the 0-1 range.
float maxAnisotropy = 16.0f
 Maximum level of anisotropic filtering to use.
Optional< TextureDepthComparisonMode > depthComparisonMode {}
 Depth comparison mode to use when sampling the texture.

Static Public Attributes

static const TextureSamplerOptions UNFILTERED
 A texture sampler configuration that ensures that the texture is sampled as directly as possible, without filtering.

Detailed Description

Configuration options for the sampler of a Texture.

Member Function Documentation

◆ operator==()

bool grem::graphics::TextureSamplerOptions::operator== ( const TextureSamplerOptions & other) const
nodiscardconstexprdefault

Compare this configuration to another for equality.

Parameters
otherthe configuration to compare this one to.
Returns
true if the configurations are equal, false otherwise.

Member Data Documentation

◆ UNFILTERED

TextureSamplerOptions grem::graphics::TextureSamplerOptions::UNFILTERED
inlinestaticconstexpr
Initial value:
{
.minificationFilter = TextureFilter::NEAREST,
.magnificationFilter = TextureFilter::NEAREST,
.mipmapMode = TextureMipmapMode::NONE,
.horizontalWrappingMode = TextureWrappingMode::REPEAT,
.verticalWrappingMode = TextureWrappingMode::REPEAT,
.maxAnisotropy = 1.0f,
}
@ REPEAT
Wrap the texture coordinates around the 0-1 range.
Definition Texture.hpp:491
@ NONE
Always use the most detailed mip level (level 0).
Definition Texture.hpp:482
@ NEAREST
Use the nearest neighbor to the sampled texel, which results in a blocky appearance.
Definition Texture.hpp:474

A texture sampler configuration that ensures that the texture is sampled as directly as possible, without filtering.

◆ minificationFilter

TextureFilter grem::graphics::TextureSamplerOptions::minificationFilter = TextureFilter::LINEAR

Filtering mode to use when the texture is rendered smaller than its original size.

◆ magnificationFilter

TextureFilter grem::graphics::TextureSamplerOptions::magnificationFilter = TextureFilter::LINEAR

Filtering mode to use when the texture is rendered larger than its original size.

◆ mipmapMode

TextureMipmapMode grem::graphics::TextureSamplerOptions::mipmapMode = TextureMipmapMode::LINEAR

Mipmap mode to use when determining which mip detail level to sample depending on the texture's size on screen.

Mipmapping results in fewer aliasing artifacts when rendering downscaled textures, such as those on distant 3D objects. It can also improve rendering performance slightly in those cases, at the cost of some extra texture memory.

Note that the texture must have mipmaps generated or uploaded to it in order for this option to have an effect.

◆ horizontalWrappingMode

TextureWrappingMode grem::graphics::TextureSamplerOptions::horizontalWrappingMode = TextureWrappingMode::REPEAT

How to address the texture when the horizontal component of the texture coordinates is outside the 0-1 range.

◆ verticalWrappingMode

TextureWrappingMode grem::graphics::TextureSamplerOptions::verticalWrappingMode = TextureWrappingMode::REPEAT

How to address the texture when the vertical component of the texture coordinates is outside the 0-1 range.

◆ maxAnisotropy

float grem::graphics::TextureSamplerOptions::maxAnisotropy = 16.0f

Maximum level of anisotropic filtering to use.

Set to 1 or lower to disable anisotropic filtering.

◆ depthComparisonMode

Optional<TextureDepthComparisonMode> grem::graphics::TextureSamplerOptions::depthComparisonMode {}

Depth comparison mode to use when sampling the texture.

If set, the texture must have a depth component.


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