Texture

Types

uint32_t

Tiling

uint32_t

Interpolation

uint32_t

MipMapping

uint32_t

Parameterization

uint32_t

Modifiers

Fields

Repeat

Clamp

Trim

InterpolationOn

InterpolationOff

MipMappingOn

MipMappingOff

UV

None

Decal

ImageKey

image_key

MatrixKey

matrix

uint32_t

flags

Functions

uint32_t

PackFlags

Texture

Texture

bool

operator==

bool

operator!=

Detailed Description

class Texture

The Texture class is used to define a Material.

Public Types

enum Tiling

Values:

enumerator Repeat

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

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

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

enum Interpolation

Values:

enumerator InterpolationOn

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

enumerator InterpolationOff

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

enum MipMapping

Values:

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.

enumerator MipMappingOff

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

enum Parameterization

Values:

enumerator UV

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

enum Modifiers

Values:

enumerator None
enumerator Decal

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

Public Functions

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

Public Members

ImageKey image_key

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

MatrixKey matrix

The matrix to use for transforming the texture coordinates.

uint32_t flags

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

See also

PackFlags

Public Static Functions

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

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