Magnum::Trade::PbrSpecularGlossinessMaterialData class new in Git master

PBR specular/glossiness material data.

See Material types and convenience accessors for more information about how to use this class.

Base classes

class MaterialData new in Git master
Material data.

Public functions

auto hasSpecularTexture() const -> bool
Whether the material has a specular texture.
auto hasGlossinessTexture() const -> bool
Whether the material has a glossiness texture.
auto hasSpecularGlossinessTexture() const -> bool
Whether the material has a combined specular/glossiness texture.
auto hasTextureTransformation() const -> bool
Whether the material has texture transformation.
auto hasCommonTextureTransformation() const -> bool
Whether the material has a common transformation for all textures.
auto hasTextureCoordinates() const -> bool
Whether the material uses extra texture coordinate sets.
auto hasCommonTextureCoordinates() const -> bool
Whether the material has a common coordinate set for all textures.
auto hasTextureLayer() const -> bool
Whether the material uses array texture layers.
auto hasCommonTextureLayer() const -> bool
Whether the material has a common array texture layer for all textures.
auto diffuseColor() const -> Color4
Diffuse color.
auto diffuseTexture() const -> UnsignedInt
Diffuse texture ID.
auto diffuseTextureMatrix() const -> Matrix3
Diffuse texture coordinate transformation matrix.
auto diffuseTextureCoordinates() const -> UnsignedInt
Diffuse texture coordinate set.
auto diffuseTextureLayer() const -> UnsignedInt
Diffuse array texture layer.
auto specularColor() const -> Color4
Specular color.
auto specularTexture() const -> UnsignedInt
Specular texture ID.
auto specularTextureSwizzle() const -> MaterialTextureSwizzle
Specular texture swizzle.
auto specularTextureMatrix() const -> Matrix3
Specular texture coordinate transformation matrix.
auto specularTextureCoordinates() const -> UnsignedInt
Specular texture coordinate set.
auto specularTextureLayer() const -> UnsignedInt
Specular array texture layer.
auto glossiness() const -> Float
Glossiness factor.
auto glossinessTexture() const -> UnsignedInt
Glossiness texture ID.
auto glossinessTextureSwizzle() const -> MaterialTextureSwizzle
Glossiness texture swizzle.
auto glossinessTextureMatrix() const -> Matrix3
Glossiness texture coordinate transformation matrix.
auto glossinessTextureCoordinates() const -> UnsignedInt
Glossiness texture coordinate set.
auto glossinessTextureLayer() const -> UnsignedInt
Glossiness array texture layer.
auto normalTexture() const -> UnsignedInt
Normal texture ID.
auto normalTextureScale() const -> Float
Normal texture scale.
auto normalTextureSwizzle() const -> MaterialTextureSwizzle
Normal texture swizzle.
auto normalTextureMatrix() const -> Matrix3
Normal texture coordinate transformation matrix.
auto normalTextureCoordinates() const -> UnsignedInt
Normal texture coordinate set.
auto normalTextureLayer() const -> UnsignedInt
Normal array texture layer.
auto occlusionTexture() const -> UnsignedInt
Occlusion texture ID.
auto occlusionTextureStrength() const -> Float
Occlusion texture strength.
auto occlusionTextureSwizzle() const -> MaterialTextureSwizzle
Occlusion texture swizzle.
auto occlusionTextureMatrix() const -> Matrix3
Occlusion texture coordinate transformation matrix.
auto occlusionTextureCoordinates() const -> UnsignedInt
Occlusion texture coordinate set.
auto occlusionTextureLayer() const -> UnsignedInt
Occlusion array texture layer.
auto emissiveColor() const -> Color3
Emissive color.
auto emissiveTexture() const -> UnsignedInt
Emissive texture ID.
auto emissiveTextureMatrix() const -> Matrix3
Emissive texture coordinate transformation matrix.
auto emissiveTextureCoordinates() const -> UnsignedInt
Emissive texture coordinate set.
auto emissiveTextureLayer() const -> UnsignedInt
Emissive array texture layer.
auto commonTextureMatrix() const -> Matrix3
Common texture coordinate transformation matrix for all textures.
auto commonTextureCoordinates() const -> UnsignedInt
Common texture coordinate set for all textures.
auto commonTextureLayer() const -> UnsignedInt
Common array texture layer for all textures.

Function documentation

bool Magnum::Trade::PbrSpecularGlossinessMaterialData::hasSpecularTexture() const

Whether the material has a specular texture.

Returns true if any of the MaterialAttribute::SpecularTexture or MaterialAttribute::SpecularGlossinessTexture attributes is present, false otherwise.

bool Magnum::Trade::PbrSpecularGlossinessMaterialData::hasGlossinessTexture() const

Whether the material has a glossiness texture.

Returns true if any of the MaterialAttribute::GlossinessTexture or MaterialAttribute::SpecularGlossinessTexture attributes is present, false otherwise.

bool Magnum::Trade::PbrSpecularGlossinessMaterialData::hasSpecularGlossinessTexture() const

Whether the material has a combined specular/glossiness texture.

Returns true if either the MaterialAttribute::SpecularGlossinessTexture attribute is present or both MaterialAttribute::SpecularTexture and MaterialAttribute::GlossinessTexture are present, point to the same texture ID and MaterialAttribute::GlossinessTextureSwizzle is set to MaterialTextureSwizzle::A, and ddditionally MaterialAttribute::SpecularTextureMatrix and MaterialAttribute::GlossinessTextureMatrix are both either not present or have the same value, MaterialAttribute::SpecularTextureCoordinates and MaterialAttribute::GlossinessTextureCoordinates are both either not present or have the same value, and MaterialAttribute::SpecularTextureLayer and MaterialAttribute::GlossinessTextureLayer are both either not present or have the same value; false otherwise.

In other words, if this function returns true, specularTexture(), specularTextureMatrix(), specularTextureCoordinates() and specularTextureLayer() return values common for both specular and glossiness texture, and the two are packed together with specular occupying the RGB channels and glossiness the alpha.

bool Magnum::Trade::PbrSpecularGlossinessMaterialData::hasCommonTextureTransformation() const

Whether the material has a common transformation for all textures.

Returns true if, for each texture that is present, diffuseTextureMatrix(), specularTextureMatrix(), glossinessTextureMatrix(), normalTextureMatrix(), occlusionTextureMatrix() and emissiveTextureMatrix() have the same value, false otherwise. In particular, returns true also if there's no texture transformation at all. Use hasTextureTransformation() to distinguish that case.

bool Magnum::Trade::PbrSpecularGlossinessMaterialData::hasCommonTextureCoordinates() const

Whether the material has a common coordinate set for all textures.

Returns true if, for each texture that is present, diffuseTextureCoordinates(), specularTextureCoordinates(), glossinessTextureCoordinates(), normalTextureCoordinates(), occlusionTextureCoordinates() and emissiveTextureCoordinates() have the same value, false otherwise. In particular, returns true also if there's no extra texture coordinate set used at all. Use hasTextureCoordinates() to distinguish that case.

bool Magnum::Trade::PbrSpecularGlossinessMaterialData::hasTextureLayer() const

Whether the material uses array texture layers.

Returns true if any of the MaterialAttribute::DiffuseTextureLayer, MaterialAttribute::SpecularTextureLayer, MaterialAttribute::GlossinessTextureLayer, MaterialAttribute::NormalTextureLayer, MaterialAttribute::OcclusionTextureLayer, MaterialAttribute::EmissiveTextureLayer or MaterialAttribute::TextureLayer attributes is present and has a non-zero value, false otherwise.

bool Magnum::Trade::PbrSpecularGlossinessMaterialData::hasCommonTextureLayer() const

Whether the material has a common array texture layer for all textures.

Returns true if, for each texture that is present, diffuseTextureLayer(), specularTextureLayer(), glossinessTextureLayer(), normalTextureLayer(), occlusionTextureLayer() and emissiveTextureLayer() have the same value, false otherwise. In particular, returns true also if there's no array texture layer used at all. Use hasTextureLayer() to distinguish that case.

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

Diffuse color.

Convenience access to the MaterialAttribute::DiffuseColor attribute. If not present, the default is 0xffffffff_srgbaf.

If the material has MaterialAttribute::DiffuseTexture, the color and texture is meant to be multiplied together.

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

Diffuse texture ID.

Available only if MaterialAttribute::DiffuseTexture is present. Meant to be multiplied with diffuseColor().

Matrix3 Magnum::Trade::PbrSpecularGlossinessMaterialData::diffuseTextureMatrix() const

Diffuse texture coordinate transformation matrix.

Convenience access to the MaterialAttribute::DiffuseTextureMatrix / MaterialAttribute::TextureMatrix attributes. If neither is present, the default is an identity matrix. Available only if the material has MaterialAttribute::DiffuseTexture.

UnsignedInt Magnum::Trade::PbrSpecularGlossinessMaterialData::diffuseTextureCoordinates() const

Diffuse texture coordinate set.

Convenience access to the MaterialAttribute::DiffuseTextureCoordinates / MaterialAttribute::TextureCoordinates attributes. If neither is present, the default is 0. Available only if the material has MaterialAttribute::DiffuseTexture.

UnsignedInt Magnum::Trade::PbrSpecularGlossinessMaterialData::diffuseTextureLayer() const

Diffuse array texture layer.

Convenience access to the MaterialAttribute::DiffuseTextureLayer / MaterialAttribute::TextureLayer attributes. If neither is present, the default is 0. Available only if the material has MaterialAttribute::DiffuseTexture.

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

Specular color.

Convenience access to the MaterialAttribute::SpecularColor attribute. If not present, the default is 0xffffff00_srgbaf.

If the material has a specular texture, the color and texture is meant to be multiplied together.

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

Specular texture ID.

Available only if either MaterialAttribute::SpecularTexture or MaterialAttribute::SpecularGlossinessTexture is present. Meant to be multiplied with specularColor().

MaterialTextureSwizzle Magnum::Trade::PbrSpecularGlossinessMaterialData::specularTextureSwizzle() const

Specular texture swizzle.

If MaterialAttribute::SpecularGlossinessTexture is present, returns always MaterialTextureSwizzle::RGB. Otherwise returns the MaterialAttribute::SpecularTextureSwizzle attribute, or MaterialTextureSwizzle::RGB if it's not present. Available only if the material has a specular texture.

Matrix3 Magnum::Trade::PbrSpecularGlossinessMaterialData::specularTextureMatrix() const

Specular texture coordinate transformation matrix.

Convenience access to the MaterialAttribute::SpecularTextureMatrix / MaterialAttribute::TextureMatrix attributes. If neither is present, the default is an identity matrix. Available only if the material has a specular texture.

UnsignedInt Magnum::Trade::PbrSpecularGlossinessMaterialData::specularTextureCoordinates() const

Specular texture coordinate set.

Convenience access to the MaterialAttribute::SpecularTextureCoordinates / MaterialAttribute::TextureCoordinates attributes. If neither is present, the default is 0. Available only if the material has a specular texture.

UnsignedInt Magnum::Trade::PbrSpecularGlossinessMaterialData::specularTextureLayer() const

Specular array texture layer.

Convenience access to the MaterialAttribute::SpecularTextureLayer / MaterialAttribute::TextureLayer attributes. If neither is present, the default is 0. Available only if the material has a specular texture.

Float Magnum::Trade::PbrSpecularGlossinessMaterialData::glossiness() const

Glossiness factor.

Convenience access to the MaterialAttribute::Glossiness attribute. If not present, the default is 1.0f.

If the material has a glossiness texture, the factor and texture is meant to be multiplied together.

UnsignedInt Magnum::Trade::PbrSpecularGlossinessMaterialData::glossinessTexture() const

Glossiness texture ID.

Available only if either MaterialAttribute::GlossinessTexture or MaterialAttribute::SpecularGlossinessTexture is present. Meant to be multiplied with glossiness().

MaterialTextureSwizzle Magnum::Trade::PbrSpecularGlossinessMaterialData::glossinessTextureSwizzle() const

Glossiness texture swizzle.

If MaterialAttribute::SpecularGlossinessTexture is present, returns always MaterialTextureSwizzle::A. Otherwise returns the MaterialAttribute::GlossinessTextureSwizzle attribute, or MaterialTextureSwizzle::R if it's not present. Available only if the material has a glossiness texture.

Matrix3 Magnum::Trade::PbrSpecularGlossinessMaterialData::glossinessTextureMatrix() const

Glossiness texture coordinate transformation matrix.

Convenience access to the MaterialAttribute::GlossinessTextureMatrix / MaterialAttribute::TextureMatrix attributes. If neither is present, the default is an identity matrix. Available only if the material has a glossiness texture.

UnsignedInt Magnum::Trade::PbrSpecularGlossinessMaterialData::glossinessTextureCoordinates() const

Glossiness texture coordinate set.

Convenience access to the MaterialAttribute::GlossinessTextureCoordinates / MaterialAttribute::TextureCoordinates attributes. If neither is present, the default is 0. Available only if the material has a glossiness texture.

UnsignedInt Magnum::Trade::PbrSpecularGlossinessMaterialData::glossinessTextureLayer() const

Glossiness array texture layer.

Convenience access to the MaterialAttribute::GlossinessTextureLayer / MaterialAttribute::TextureLayer attributes. If neither is present, the default is 0. Available only if the material has a glossiness texture.

UnsignedInt Magnum::Trade::PbrSpecularGlossinessMaterialData::normalTexture() const

Normal texture ID.

Available only if MaterialAttribute::NormalTexture is present.

Float Magnum::Trade::PbrSpecularGlossinessMaterialData::normalTextureScale() const

Normal texture scale.

Convenience access to the MaterialAttribute::NormalTextureScale attribute. If not present, the default is 1.0f. Available only if MaterialAttribute::NormalTexture is present.

MaterialTextureSwizzle Magnum::Trade::PbrSpecularGlossinessMaterialData::normalTextureSwizzle() const

Normal texture swizzle.

Convenience access to the MaterialAttribute::NormalTextureSwizzle attribute. If not present, the default is MaterialTextureSwizzle::RGB. Available only if MaterialAttribute::NormalTexture is present.

Matrix3 Magnum::Trade::PbrSpecularGlossinessMaterialData::normalTextureMatrix() const

Normal texture coordinate transformation matrix.

Convenience access to the MaterialAttribute::NormalTextureMatrix / MaterialAttribute::TextureMatrix attributes. If neither is present, the default is an identity matrix. Available only if the material has MaterialAttribute::NormalTexture.

UnsignedInt Magnum::Trade::PbrSpecularGlossinessMaterialData::normalTextureCoordinates() const

Normal texture coordinate set.

Convenience access to the MaterialAttribute::NormalTextureCoordinates / MaterialAttribute::TextureCoordinates attributes. If neither is present, the default is 0. Available only if the material has MaterialAttribute::NormalTexture.

UnsignedInt Magnum::Trade::PbrSpecularGlossinessMaterialData::normalTextureLayer() const

Normal array texture layer.

Convenience access to the MaterialAttribute::NormalTextureLayer / MaterialAttribute::TextureLayer attributes. If neither is present, the default is 0. Available only if the material has MaterialAttribute::NormalTexture.

UnsignedInt Magnum::Trade::PbrSpecularGlossinessMaterialData::occlusionTexture() const

Occlusion texture ID.

Available only if MaterialAttribute::OcclusionTexture is present.

Float Magnum::Trade::PbrSpecularGlossinessMaterialData::occlusionTextureStrength() const

Occlusion texture strength.

Convenience access to the MaterialAttribute::OcclusionTextureStrength attribute. If not present, the default is 1.0f. Available only if MaterialAttribute::OcclusionTexture is present.

MaterialTextureSwizzle Magnum::Trade::PbrSpecularGlossinessMaterialData::occlusionTextureSwizzle() const

Occlusion texture swizzle.

Convenience access to the MaterialAttribute::OcclusionTextureSwizzle attribute. If not present, the default is MaterialTextureSwizzle::R. Available only if MaterialAttribute::OcclusionTexture is present.

Matrix3 Magnum::Trade::PbrSpecularGlossinessMaterialData::occlusionTextureMatrix() const

Occlusion texture coordinate transformation matrix.

Convenience access to the MaterialAttribute::OcclusionTextureMatrix / MaterialAttribute::TextureMatrix attributes. If neither is present, the default is an identity matrix. Available only if the material has MaterialAttribute::OcclusionTexture.

UnsignedInt Magnum::Trade::PbrSpecularGlossinessMaterialData::occlusionTextureCoordinates() const

Occlusion texture coordinate set.

Convenience access to the MaterialAttribute::OcclusionTextureCoordinates / MaterialAttribute::TextureCoordinates attributes. If neither is present, the default is 0. Available only if the material has MaterialAttribute::OcclusionTexture.

UnsignedInt Magnum::Trade::PbrSpecularGlossinessMaterialData::occlusionTextureLayer() const

Occlusion array texture layer.

Convenience access to the MaterialAttribute::OcclusionTextureLayer / MaterialAttribute::TextureLayer attributes. If neither is present, the default is 0. Available only if the material has MaterialAttribute::OcclusionTexture.

Color3 Magnum::Trade::PbrSpecularGlossinessMaterialData::emissiveColor() const

Emissive color.

Convenience access to the MaterialAttribute::EmissiveColor attribute. If not present, the default is 0x000000_srgbf (i.e, no emission).

If the material has MaterialAttribute::EmissiveTexture, the color and texture is meant to be multiplied together.

UnsignedInt Magnum::Trade::PbrSpecularGlossinessMaterialData::emissiveTexture() const

Emissive texture ID.

Available only if MaterialAttribute::EmissiveTexture is present. Meant to be multiplied with emissiveColor().

Matrix3 Magnum::Trade::PbrSpecularGlossinessMaterialData::emissiveTextureMatrix() const

Emissive texture coordinate transformation matrix.

Convenience access to the MaterialAttribute::EmissiveTextureMatrix / MaterialAttribute::TextureMatrix attributes. If neither is present, the default is an identity matrix. Available only if the material has MaterialAttribute::EmissiveTexture.

UnsignedInt Magnum::Trade::PbrSpecularGlossinessMaterialData::emissiveTextureCoordinates() const

Emissive texture coordinate set.

Convenience access to the MaterialAttribute::EmissiveTextureCoordinates / MaterialAttribute::TextureCoordinates attributes. If neither is present, the default is 0. Available only if the material has MaterialAttribute::EmissiveTexture.

UnsignedInt Magnum::Trade::PbrSpecularGlossinessMaterialData::emissiveTextureLayer() const

Emissive array texture layer.

Convenience access to the MaterialAttribute::EmissiveTextureLayer / MaterialAttribute::TextureLayer attributes. If neither is present, the default is 0. Available only if the material has MaterialAttribute::EmissiveTexture.

Matrix3 Magnum::Trade::PbrSpecularGlossinessMaterialData::commonTextureMatrix() const

Common texture coordinate transformation matrix for all textures.

Expects that hasCommonTextureTransformation() is true; returns a matrix that's the same for all of diffuseTextureMatrix(), specularTextureMatrix(), glossinessTextureMatrix(), normalTextureMatrix(), occlusionTextureMatrix() and emissiveTextureMatrix() where a texture is present. If no texture is present, returns an identity matrix.

UnsignedInt Magnum::Trade::PbrSpecularGlossinessMaterialData::commonTextureCoordinates() const

Common texture coordinate set for all textures.

Expects that hasCommonTextureCoordinates() is true; returns a coordinate set that's the same for all of diffuseTextureCoordinates(), specularTextureCoordinates(), glossinessTextureCoordinates(), normalTextureCoordinates(), occlusionTextureCoordinates() and emissiveTextureCoordinates() where a texture is present. If no texture is present, returns 0.

UnsignedInt Magnum::Trade::PbrSpecularGlossinessMaterialData::commonTextureLayer() const

Common array texture layer for all textures.

Expects that hasCommonTextureLayer() is true; returns a layer that's the same for all of diffuseTextureLayer(), specularTextureLayer(), glossinessTextureLayer(), normalTextureLayer(), occlusionTextureLayer() and emissiveTextureLayer() where a texture is present. If no texture is present, returns 0.