Magnum::Trade::PhongMaterialData class

Phong material data.

Base classes

class AbstractMaterialData
Base for material data.

Public types

enum class Flag: UnsignedShort { DoubleSided = 1 << 0, AmbientTexture = 1 << 1, DiffuseTexture = 1 << 2, SpecularTexture = 1 << 3, NormalTexture = 1 << 4 new in 2020.06, TextureTransformation = 1 << 5 new in 2020.06, TextureCoordinateSets = 1 << 6 new in 2020.06 }
Material flag.
using Flags = Containers::EnumSet<Flag>
Material flags.

Constructors, destructors, conversion operators

PhongMaterialData(Flags flags, const Color4& ambientColor, UnsignedInt ambientTexture, const Color4& diffuseColor, UnsignedInt diffuseTexture, const Color4& specularColor, UnsignedInt specularTexture, UnsignedInt normalTexture, const Matrix3& textureMatrix, MaterialAlphaMode alphaMode, Float alphaMask, Float shininess, const void* importerState = nullptr) explicit noexcept new in 2020.06
Constructor.
PhongMaterialData(Flags flags, const Color4& ambientColor, UnsignedInt ambientTexture, UnsignedInt ambientCoordinateSet, const Color4& diffuseColor, UnsignedInt diffuseTexture, UnsignedInt diffuseCoordinateSet, const Color4& specularColor, UnsignedInt specularTexture, UnsignedInt specularCoordinateSet, UnsignedInt normalTexture, UnsignedInt normalCoordinateSet, const Matrix3& textureMatrix, MaterialAlphaMode alphaMode, Float alphaMask, Float shininess, const void* importerState = nullptr) explicit noexcept new in 2020.06
Construct with non-zero texture coordinate sets.
PhongMaterialData(Flags flags, MaterialAlphaMode alphaMode, Float alphaMask, Float shininess, const void* importerState = nullptr) deprecated in 2020.06 explicit noexcept
Constructor.
PhongMaterialData(Flags flags, Float shininess, const void* importerState = nullptr) deprecated in 2018.10 explicit noexcept
Constructor.
PhongMaterialData(const PhongMaterialData&) deleted
Copying is not allowed.
PhongMaterialData(PhongMaterialData&& other) noexcept
Move constructor.

Public functions

auto operator=(const PhongMaterialData&) -> PhongMaterialData& deleted
Copying is not allowed.
auto operator=(PhongMaterialData&& other) -> PhongMaterialData& noexcept
Move assignment.
auto flags() const -> Flags
Material flags.
auto ambientColor() const -> Color4
Ambient color.
auto ambientColor() -> Color4& deprecated in 2020.06
auto ambientTexture() const -> UnsignedInt
Ambient texture ID.
auto ambientTexture() -> UnsignedInt& deprecated in 2020.06
auto ambientCoordinateSet() const -> UnsignedInt new in 2020.06
Ambient texture coordinate set.
auto diffuseColor() const -> Color4
Diffuse color.
auto diffuseColor() -> Color4& deprecated in 2020.06
auto diffuseTexture() const -> UnsignedInt
Diffuse texture ID.
auto diffuseTexture() -> UnsignedInt& deprecated in 2020.06
auto diffuseCoordinateSet() const -> UnsignedInt new in 2020.06
Diffuse texture coordinate set.
auto specularColor() const -> Color4
Specular color.
auto specularColor() -> Color4& deprecated in 2020.06
auto specularTexture() const -> UnsignedInt
Specular texture ID.
auto specularTexture() -> UnsignedInt& deprecated in 2020.06
auto specularCoordinateSet() const -> UnsignedInt new in 2020.06
Specular texture coordinate set.
auto normalTexture() const -> UnsignedInt new in 2020.06
Normal texture ID.
auto normalCoordinateSet() const -> UnsignedInt new in 2020.06
Normal texture coordinate set.
auto textureMatrix() const -> Matrix3 new in 2020.06
Texture coordinate transformation matrix.
auto shininess() const -> Float
Shininess.

Enum documentation

enum class Magnum::Trade::PhongMaterialData::Flag: UnsignedShort

Material flag.

A superset of AbstractMaterialData::Flag.

Enumerators
DoubleSided

The material is double-sided. Back faces should not be culled away but rendered as well, with normals flipped for correct lighting.

AmbientTexture

The material has an ambient texture

DiffuseTexture

The material has a diffuse texture

SpecularTexture

The material has a specular texture

NormalTexture new in 2020.06

The material has a normal texture

TextureTransformation new in 2020.06

The material has a texture coordinate transformation

TextureCoordinateSets new in 2020.06

The material uses non-default texture coordinate sets

Typedef documentation

typedef Containers::EnumSet<Flag> Magnum::Trade::PhongMaterialData::Flags

Material flags.

A superset of AbstractMaterialData::Flags.

Function documentation

Magnum::Trade::PhongMaterialData::PhongMaterialData(Flags flags, const Color4& ambientColor, UnsignedInt ambientTexture, const Color4& diffuseColor, UnsignedInt diffuseTexture, const Color4& specularColor, UnsignedInt specularTexture, UnsignedInt normalTexture, const Matrix3& textureMatrix, MaterialAlphaMode alphaMode, Float alphaMask, Float shininess, const void* importerState = nullptr) explicit noexcept new in 2020.06

Constructor.

Parameters
flags Material flags
ambientColor Ambient color. Use 0x000000ff_rgbaf for a default value for a non-textured material and 0xffffffff_rgbaf for a default value for a textured material.
ambientTexture Ambient texture ID. Ignored if flags doesn't have Flag::AmbientTexture
diffuseColor Diffuse color. Use 0xffffffff_rgbaf for a default value for both a non-textured and a textured material.
diffuseTexture Diffuse texture ID. Ignored if flags doesn't have Flag::DiffuseTexture
specularColor Specular color. Use 0xffffffff_rgbaf for a default value for both a non-textured and a textured material.
specularTexture Specular texture ID. Ignored if flags doesn't have Flag::SpecularTexture.
normalTexture Normal texture ID. Ignored if flags doesn't have Flag::NormalTexture.
textureMatrix Texture coordinate transformation
alphaMode Alpha mode. Use MaterialAlphaMode::Opaque for a default value.
alphaMask Alpha mask value. Use 0.5f for a default value.
shininess Shininess. Use 80.0f for a default value.
importerState Importer-specific state

All *CoordinateSet accessors are implicitly zero with this constructor. If textureMatrix is not default-constructed, expects Flag::TextureTransformation to be enabled as well.

Magnum::Trade::PhongMaterialData::PhongMaterialData(Flags flags, const Color4& ambientColor, UnsignedInt ambientTexture, UnsignedInt ambientCoordinateSet, const Color4& diffuseColor, UnsignedInt diffuseTexture, UnsignedInt diffuseCoordinateSet, const Color4& specularColor, UnsignedInt specularTexture, UnsignedInt specularCoordinateSet, UnsignedInt normalTexture, UnsignedInt normalCoordinateSet, const Matrix3& textureMatrix, MaterialAlphaMode alphaMode, Float alphaMask, Float shininess, const void* importerState = nullptr) explicit noexcept new in 2020.06

Construct with non-zero texture coordinate sets.

Parameters
flags Material flags
ambientColor Ambient color. Use 0x000000ff_rgbaf for a default value for a non-textured material and 0xffffffff_rgbaf for a default value for a textured material.
ambientTexture Ambient texture ID. Ignored if flags doesn't have Flag::AmbientTexture.
ambientCoordinateSet Ambient texture coordinate set. Ignored if flags doesn't have Flag::AmbientTexture
diffuseColor Diffuse color. Use 0xffffffff_rgbaf for a default value for both a non-textured and a textured material.
diffuseTexture Diffuse texture ID. Ignored if flags doesn't have Flag::DiffuseTexture.
diffuseCoordinateSet Diffuse texture coordinate set. Ignored if flags doesn't have Flag::DiffuseTexture
specularColor Specular color. Use 0xffffffff_rgbaf for a default value for both a non-textured and a textured material.
specularTexture Specular texture ID. Ignored if flags doesn't have Flag::SpecularTexture.
specularCoordinateSet Specular texture coordinate set. Ignored if flags doesn't have Flag::SpecularTexture.
normalTexture Normal texture ID. Ignored if flags doesn't have Flag::NormalTexture.
normalCoordinateSet Normal texture coordinate set. Ignored if flags doesn't have Flag::NormalTexture.
textureMatrix Texture coordinate transformation
alphaMode Alpha mode. Use MaterialAlphaMode::Opaque for a default value.
alphaMask Alpha mask value. Use 0.5f for a default value.
shininess Shininess. Use 80.0f for a default value.
importerState Importer-specific state

If textureMatrix is not default-constructed, expects Flag::TextureTransformation to be enabled as well. If any *CoordinateSet is non-zero, expects Flag::TextureCoordinateSets to be enabled as well.

Magnum::Trade::PhongMaterialData::PhongMaterialData(Flags flags, Float shininess, const void* importerState = nullptr) explicit noexcept

Constructor.

Flags Magnum::Trade::PhongMaterialData::flags() const

Material flags.

A superset of AbstractMaterialData::flags().

Color4 Magnum::Trade::PhongMaterialData::ambientColor() const

Ambient color.

If the material has Flag::AmbientTexture, the color and texture is multiplied together.

Color4& Magnum::Trade::PhongMaterialData::ambientColor()

UnsignedInt Magnum::Trade::PhongMaterialData::ambientTexture() const

Ambient texture ID.

Available only if the material has Flag::AmbientTexture. Multiplied with ambientColor().

UnsignedInt& Magnum::Trade::PhongMaterialData::ambientTexture()

UnsignedInt Magnum::Trade::PhongMaterialData::ambientCoordinateSet() const new in 2020.06

Ambient texture coordinate set.

Available only if the material has Flag::AmbientTexture.

Color4 Magnum::Trade::PhongMaterialData::diffuseColor() const

Diffuse color.

If the material has Flag::DiffuseTexture, the color and texture is multiplied together.

Color4& Magnum::Trade::PhongMaterialData::diffuseColor()

UnsignedInt Magnum::Trade::PhongMaterialData::diffuseTexture() const

Diffuse texture ID.

Available only if the material has Flag::DiffuseTexture. Multiplied with diffuseColor().

UnsignedInt& Magnum::Trade::PhongMaterialData::diffuseTexture()

UnsignedInt Magnum::Trade::PhongMaterialData::diffuseCoordinateSet() const new in 2020.06

Diffuse texture coordinate set.

Available only if the material has Flag::DiffuseTexture.

Color4 Magnum::Trade::PhongMaterialData::specularColor() const

Specular color.

If the material has Flag::SpecularTexture, the color and texture is multiplied together.

Color4& Magnum::Trade::PhongMaterialData::specularColor()

UnsignedInt Magnum::Trade::PhongMaterialData::specularTexture() const

Specular texture ID.

Available only if the material has Flag::SpecularTexture. Multiplied with specularColor().

UnsignedInt& Magnum::Trade::PhongMaterialData::specularTexture()

UnsignedInt Magnum::Trade::PhongMaterialData::specularCoordinateSet() const new in 2020.06

Specular texture coordinate set.

Available only if the material has Flag::SpecularTexture.

UnsignedInt Magnum::Trade::PhongMaterialData::normalTexture() const new in 2020.06

Normal texture ID.

Available only if the material has Flag::NormalTexture.

UnsignedInt Magnum::Trade::PhongMaterialData::normalCoordinateSet() const new in 2020.06

Normal texture coordinate set.

Available only if the material has Flag::NormalTexture.

Matrix3 Magnum::Trade::PhongMaterialData::textureMatrix() const new in 2020.06

Texture coordinate transformation matrix.

If the material doesn't have Flag::TextureTransformation, returns an identity matrix.

Debug& operator<<(Debug& debug, PhongMaterialData::Flag value)

Debug output operator.

Debug& operator<<(Debug& debug, PhongMaterialData::Flags value)

Debug output operator.