libdonut  2.3.2
Application framework for cross-platform game development in C++20
Public Attributes | List of all members
donut::graphics::TextureOptions Struct Reference

Configuration options for a Texture and its assocated sampler. More...

#include <donut/graphics/Texture.hpp>

Public Attributes

bool repeat = true
 Treat the texture as repeating when sampling it outside of the 0-1 texture coordinate range. More...
 
bool useLinearFiltering = true
 Use bilinear filtering rather than nearest-neighbor interpolation when sampling the texture at coordinates that do not correspond exactly to one texel. More...
 
bool useMipmap = true
 Generate a mipmap of different levels of detail for the texture and use it when sampling the texture at a smaller-than-1:1 scale. More...
 

Detailed Description

Configuration options for a Texture and its assocated sampler.

Member Data Documentation

◆ repeat

bool donut::graphics::TextureOptions::repeat = true

Treat the texture as repeating when sampling it outside of the 0-1 texture coordinate range.

Disable to clamp to the edge of the texture instead.

◆ useLinearFiltering

bool donut::graphics::TextureOptions::useLinearFiltering = true

Use bilinear filtering rather than nearest-neighbor interpolation when sampling the texture at coordinates that do not correspond exactly to one texel.

This results in a smoother appearance compared to the regular blocky nearest-neighbor filtering.

◆ useMipmap

bool donut::graphics::TextureOptions::useMipmap = true

Generate a mipmap of different levels of detail for the texture and use it when sampling the texture at a smaller-than-1:1 scale.

This 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.


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