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

Configuration options for a SpriteAtlas. More...

#include <GREM/graphics/SpriteAtlas.hpp>

Public Attributes

TextureFormat internalFormat = TextureFormat::R8G8B8A8_SRGB
 Internal texture format to use for the internal texture atlas.
uint32_t initialResolution = 128
 Initial width of the internal texture atlas, in pixels.
uint32_t padding = 0
 Empty space to reserve between sprite images, in pixels.
uint32_t alignment = 16
 Align padded sprites to a multiple of this number of pixels and limit the number of mip levels in the internal texture atlas such that a mipped texel never covers more than this width of pixels in the sprite atlas.
TextureSamplerOptions samplerOptions
 Sampler options to use for the atlas texture.

Detailed Description

Configuration options for a SpriteAtlas.

Member Data Documentation

◆ internalFormat

TextureFormat grem::graphics::SpriteAtlasOptions::internalFormat = TextureFormat::R8G8B8A8_SRGB

Internal texture format to use for the internal texture atlas.

◆ initialResolution

uint32_t grem::graphics::SpriteAtlasOptions::initialResolution = 128

Initial width of the internal texture atlas, in pixels.

Warning
Must be positive.

◆ padding

uint32_t grem::graphics::SpriteAtlasOptions::padding = 0

Empty space to reserve between sprite images, in pixels.

◆ alignment

uint32_t grem::graphics::SpriteAtlasOptions::alignment = 16

Align padded sprites to a multiple of this number of pixels and limit the number of mip levels in the internal texture atlas such that a mipped texel never covers more than this width of pixels in the sprite atlas.

Warning
Must be a power of 2.
Note
If this is set to 1, the number of mip levels will always be limited to 1 (highest detail level only), which means that the TextureSamplerOptions::mipmapMode of samplerOptions should ideally be set to TextureMipmapMode::NONE to match. Likewise, whenever mipmapMode is set to TextureMipmapMode::NONE, this option should probably be 1 to allow for tighter packing.

◆ samplerOptions

TextureSamplerOptions grem::graphics::SpriteAtlasOptions::samplerOptions
Initial value:
{
.minificationFilter = TextureFilter::NEAREST,
.magnificationFilter = TextureFilter::NEAREST,
.horizontalWrappingMode = TextureWrappingMode::CLAMP_TO_EDGE,
.verticalWrappingMode = TextureWrappingMode::CLAMP_TO_EDGE,
.maxAnisotropy = 1.0f,
}
@ CLAMP_TO_EDGE
Clamp to the edge of the texture when sampling outside the 0-1 range.
Definition Texture.hpp:492
@ NEAREST
Use the mip level nearest to the displayed size.
Definition Texture.hpp:483
@ NEAREST
Use the nearest neighbor to the sampled texel, which results in a blocky appearance.
Definition Texture.hpp:474

Sampler options to use for the atlas texture.


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