The Texture class is used to define a Material. More...

#include <sc_store.h>

Public Types

enum  Interpolation : uint32_t { InterpolationOn, InterpolationOff }
 
enum  MipMapping : uint32_t { MipMappingOn = 0, MipMappingOff }
 
enum  Modifiers : uint32_t { None = 0, Decal }
 
enum  Parameterization : uint32_t { UV = 0 }
 
enum  Tiling : uint32_t { Repeat, Clamp, Trim }
 

Public Member Functions

bool operator!= (Texture const &that) const
 
bool operator== (Texture const &that) const
 
 Texture ()
 
 Texture (ImageKey image_key, MatrixKey matrix=MatrixKey(), uint32_t flags=0)
 

Static Public Member Functions

static uint32_t PackFlags (Tiling tiling, Interpolation interpolation, MipMapping mipmapping, Parameterization parameterization, Modifiers modifiers)
 

Public Attributes

uint32_t flags
 
ImageKey image_key
 A key used to uniquely identify an image in this model for this texture. More...
 
MatrixKey matrix
 The matrix to use for transforming the texture coordinates. More...
 

Detailed Description

The Texture class is used to define a Material.

Member Enumeration Documentation

◆ Interpolation

Enumerator
InterpolationOn 

Enable interpolation of texel colors (also known as linear filtering).

InterpolationOff 

Disable interpolation. The texture image will appear pixelated when enlarged.

◆ MipMapping

Enumerator
MipMappingOn 

Turn on mipmapping to improve image quality at the expense of slightly more memory usage. Depending on the platform, mipmapping may take effect only for textures with dimensions that are powers of two.

MipMappingOff 

Disable mipmapping. Textures may appear noisy when reduced in size.

◆ Modifiers

Enumerator
None 
Decal 

When set, any transparent areas of the texture will be the same color as the underlying diffuse color of the object.

◆ Parameterization

Enumerator
UV 

The texture will be mapped according to UV coordinates specified in the mesh data.

◆ Tiling

enum SC::Store::Texture::Tiling : uint32_t
Enumerator
Repeat 

Repeat the texture image when UV coordinates go outside the [0.0, 1.0] range.

Clamp 

Textures don't repeat. Any UV coordinates outside the [0.0, 1.0] range are clamped to 0.0 or 1.0, whichever is closer.

Trim 

The texture will get mapped normally for parameters in the range [0,1], but parameters outside that range will act as if the texture at that location is transparent.

Constructor & Destructor Documentation

◆ Texture() [1/2]

SC::Store::Texture::Texture ( )

◆ Texture() [2/2]

SC::Store::Texture::Texture ( ImageKey  image_key,
MatrixKey  matrix = MatrixKey(),
uint32_t  flags = 0 
)

Member Function Documentation

◆ operator!=()

bool SC::Store::Texture::operator!= ( Texture const &  that) const

◆ operator==()

bool SC::Store::Texture::operator== ( Texture const &  that) const

◆ PackFlags()

static uint32_t SC::Store::Texture::PackFlags ( Tiling  tiling,
Interpolation  interpolation,
MipMapping  mipmapping,
Parameterization  parameterization,
Modifiers  modifiers 
)
static

This method generates an integer value representing the desired settings for tiling, interpolation, mipmapping, parameterization, and modifiers.

Member Data Documentation

◆ flags

uint32_t SC::Store::Texture::flags

A value representing the settings for tiling, interpolation, mipmapping, parameterization, and modifiers.

See also
PackFlags

◆ image_key

ImageKey SC::Store::Texture::image_key

A key used to uniquely identify an image in this model for this texture.

◆ matrix

MatrixKey SC::Store::Texture::matrix

The matrix to use for transforming the texture coordinates.