class new in Git master
PbrMetallicRoughnessMaterialDataPBR metallic/roughness 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 hasMetalnessTexture() const -> bool
- Whether the material has a metalness texture.
- auto hasRoughnessTexture() const -> bool
- Whether the material has a roughness texture.
- auto hasNoneRoughnessMetallicTexture() const -> bool
- Whether the material has a combined roughness/metallic texture.
- auto hasOcclusionRoughnessMetallicTexture() const -> bool
- Whether the material has a combined occlusion/roughness/metallic texture.
- auto hasRoughnessMetallicOcclusionTexture() const -> bool
- Whether the material has a combined roughness/metallic/occlusion texture.
- auto hasNormalRoughnessMetallicTexture() const -> bool
- Whether the material has a combined normal/roughness/metallic 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 baseColor() const -> Color4
- Base color.
- auto baseColorTexture() const -> UnsignedInt
- Base color texture ID.
- auto baseColorTextureMatrix() const -> Matrix3
- Base color texture coordinate transformation matrix.
- auto baseColorTextureCoordinates() const -> UnsignedInt
- Base color texture coordinate set.
- auto baseColorTextureLayer() const -> UnsignedInt
- Base color array texture layer.
- auto metalness() const -> Float
- Metalness factor.
- auto metalnessTexture() const -> UnsignedInt
- Metalness texture ID.
- auto metalnessTextureSwizzle() const -> MaterialTextureSwizzle
- Metalness texture swizzle.
- auto metalnessTextureMatrix() const -> Matrix3
- Metalness texture coordinate transformation matrix.
- auto metalnessTextureCoordinates() const -> UnsignedInt
- Metalness texture coordinate set.
- auto metalnessTextureLayer() const -> UnsignedInt
- Metalness array texture layer.
- auto roughness() const -> Float
- Roughness factor.
- auto roughnessTexture() const -> UnsignedInt
- Roughness texture ID.
- auto roughnessTextureSwizzle() const -> MaterialTextureSwizzle
- Roughness texture swizzle.
- auto roughnessTextureMatrix() const -> Matrix3
- Roughness texture coordinate transformation matrix.
- auto roughnessTextureCoordinates() const -> UnsignedInt
- Roughness texture coordinate set.
- auto roughnessTextureLayer() const -> UnsignedInt
- Roughness array texture layer.
- auto normalTexture() const -> UnsignedInt
- Normal texture ID.
- auto normalTextureScale() const -> Float
- Normal texture scale.
- auto normalTextureMatrix() const -> Matrix3
- Normal texture coordinate transformation matrix.
- auto normalTextureSwizzle() const -> MaterialTextureSwizzle new in Git master
- Normal texture swizzle.
- 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:: PbrMetallicRoughnessMaterialData:: hasMetalnessTexture() const
Whether the material has a metalness texture.
Returns true
if any of the MaterialAttribute::false
otherwise.
bool Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: hasRoughnessTexture() const
Whether the material has a roughness texture.
Returns true
if any of the MaterialAttribute::false
otherwise.
bool Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: hasNoneRoughnessMetallicTexture() const
Whether the material has a combined roughness/metallic texture.
Returns true
if either the MaterialAttribute::false
otherwise.
In other words, if this function returns true
, roughnessTexture(), roughnessTextureMatrix(), roughnessTextureCoordinates() and roughnessTextureLayer() return values common for both metalness and roughness texture, and the two are packed together with roughness occupying the G channel and metalness the B channel. This packing is common in glTF metallic/roughness materials, which in turn is compatible with how UE4 assets are usually packed. Original rationale for this can be seen here.
The red and alpha channels are ignored and can be repurposed for other maps such as occlusion or transmission. This check is a subset of hasOcclusionRoughnessMetallicTexture() — if that function returns true
, this will return true
as well.
bool Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: hasOcclusionRoughnessMetallicTexture() const
Whether the material has a combined occlusion/roughness/metallic texture.
Returns true
if MaterialAttribute::false
otherwise.
In other words, if this function returns true
, occlusionTexture(), occlusionTextureMatrix(), occlusionTextureCoordinates() and occlusionTextureLayer() return values common for occlusion, roughness and metalness textures, and the three are packed together with occlusion occupying the R channel, roughness the G channel and metalness the B channel. This packing is common in glTF metallic/roughness materials, which in turn is compatible with how UE4 assets are usually packed. Original rationale for this can be seen here, there's also a MSFT_
The alpha channel is ignored and can be repurposed for other maps such as transmission. This check is a superset of hasNoneRoughnessMetallicTexture() — if this function returns true
, that one will return true
as well.
bool Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: hasRoughnessMetallicOcclusionTexture() const
Whether the material has a combined roughness/metallic/occlusion texture.
Returns true
if MaterialAttribute::false
otherwise.
In other words, if this function returns true
, roughnessTexture(), roughnessTextureMatrix(), roughnessTextureCoordinates() and roughnessTextureLayer() return values common for roughness, metalness and occlusion textures, and the three are packed together with roughness occupying the R channel, metalness the G channel and occlusion the B channel. This check is present in order to provide support for the MSFT_
The alpha channel is ignored and can be repurposed for other maps such as transmission.
bool Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: hasNormalRoughnessMetallicTexture() const
Whether the material has a combined normal/roughness/metallic texture.
Returns true
if MaterialAttribute::false
otherwise.
In other words, if this function returns true
, normalTexture(), normalTextureMatrix(), normalTextureCoordinates() and normalTextureLayer() return values common for normal, roughness and metalness textures, and the three are packed together with normals occupying the RG channel, roughness the B channel and metalness the A channel. This check is present in order to provide support for the MSFT_
bool Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: hasTextureTransformation() const
Whether the material has texture transformation.
Returns true
if any of the MaterialAttribute::false
otherwise.
bool Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: hasCommonTextureTransformation() const
Whether the material has a common transformation for all textures.
Returns true
if, for each texture that is present, baseColorTextureMatrix(), metalnessTextureMatrix(), roughnessTextureMatrix(), 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:: PbrMetallicRoughnessMaterialData:: hasTextureCoordinates() const
Whether the material uses extra texture coordinate sets.
Returns true
if any of the MaterialAttribute::false
otherwise.
bool Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: hasCommonTextureCoordinates() const
Whether the material has a common coordinate set for all textures.
Returns true
if, for each texture that is present, baseColorTextureCoordinates(), metalnessTextureCoordinates(), roughnessTextureCoordinates(), 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:: PbrMetallicRoughnessMaterialData:: hasTextureLayer() const
Whether the material uses array texture layers.
Returns true
if any of the MaterialAttribute::false
otherwise.
bool Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: hasCommonTextureLayer() const
Whether the material has a common array texture layer for all textures.
Returns true
if, for each texture that is present, baseColorTextureLayer(), metalnessTextureLayer(), roughnessTextureLayer(), 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:: PbrMetallicRoughnessMaterialData:: baseColor() const
Base color.
Convenience access to the MaterialAttribute::0xffffffff_srgbaf
.
If the material has MaterialAttribute::
UnsignedInt Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: baseColorTexture() const
Base color texture ID.
Available only if MaterialAttribute::
Matrix3 Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: baseColorTextureMatrix() const
Base color texture coordinate transformation matrix.
Convenience access to the MaterialAttribute::
UnsignedInt Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: baseColorTextureCoordinates() const
Base color texture coordinate set.
Convenience access to the MaterialAttribute::0
. Available only if the material has MaterialAttribute::
UnsignedInt Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: baseColorTextureLayer() const
Base color array texture layer.
Convenience access to the MaterialAttribute::0
. Available only if the material has MaterialAttribute::
Float Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: metalness() const
Metalness factor.
Convenience access to the MaterialAttribute::1.0f
.
If the material has a metalness texture, the factor and texture is meant to be multiplied together.
UnsignedInt Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: metalnessTexture() const
Metalness texture ID.
Available only if either MaterialAttribute::
MaterialTextureSwizzle Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: metalnessTextureSwizzle() const
Metalness texture swizzle.
If MaterialAttribute::
Matrix3 Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: metalnessTextureMatrix() const
Metalness texture coordinate transformation matrix.
Convenience access to the MaterialAttribute::
UnsignedInt Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: metalnessTextureCoordinates() const
Metalness texture coordinate set.
Convenience access to the MaterialAttribute::0
. Available only if the material has a metalness texture.
UnsignedInt Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: metalnessTextureLayer() const
Metalness array texture layer.
Convenience access to the MaterialAttribute::0
. Available only if the material has a metalness texture.
Float Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: roughness() const
Roughness factor.
Convenience access to the MaterialAttribute::1.0f
.
If the material has a roughness texture, the factor and texture is meant to be multiplied together.
UnsignedInt Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: roughnessTexture() const
Roughness texture ID.
Available only if either MaterialAttribute::
MaterialTextureSwizzle Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: roughnessTextureSwizzle() const
Roughness texture swizzle.
If MaterialAttribute::
Matrix3 Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: roughnessTextureMatrix() const
Roughness texture coordinate transformation matrix.
Convenience access to the MaterialAttribute::
UnsignedInt Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: roughnessTextureCoordinates() const
Roughness texture coordinate set.
Convenience access to the MaterialAttribute::0
. Available only if the material has a roughness texture.
UnsignedInt Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: roughnessTextureLayer() const
Roughness array texture layer.
Convenience access to the MaterialAttribute::0
. Available only if the material has a roughness texture.
UnsignedInt Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: normalTexture() const
Normal texture ID.
Available only if MaterialAttribute::
Float Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: normalTextureScale() const
Normal texture scale.
Convenience access to the MaterialAttribute::1.0f
. Available only if MaterialAttribute::
Matrix3 Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: normalTextureMatrix() const
Normal texture coordinate transformation matrix.
Convenience access to the MaterialAttribute::
MaterialTextureSwizzle Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: normalTextureSwizzle() const new in Git master
Normal texture swizzle.
Convenience access to the MaterialAttribute::
UnsignedInt Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: normalTextureCoordinates() const
Normal texture coordinate set.
Convenience access to the MaterialAttribute::0
. Available only if the material has MaterialAttribute::
UnsignedInt Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: normalTextureLayer() const
Normal array texture layer.
Convenience access to the MaterialAttribute::0
. Available only if the material has MaterialAttribute::
UnsignedInt Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: occlusionTexture() const
Occlusion texture ID.
Available only if MaterialAttribute::
Float Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: occlusionTextureStrength() const
Occlusion texture strength.
Convenience access to the MaterialAttribute::1.0f
. Available only if MaterialAttribute::
MaterialTextureSwizzle Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: occlusionTextureSwizzle() const
Occlusion texture swizzle.
Convenience access to the MaterialAttribute::
Matrix3 Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: occlusionTextureMatrix() const
Occlusion texture coordinate transformation matrix.
Convenience access to the MaterialAttribute::
UnsignedInt Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: occlusionTextureCoordinates() const
Occlusion texture coordinate set.
Convenience access to the MaterialAttribute::0
. Available only if the material has MaterialAttribute::
UnsignedInt Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: occlusionTextureLayer() const
Occlusion array texture layer.
Convenience access to the MaterialAttribute::0
. Available only if the material has MaterialAttribute::
Color3 Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: emissiveColor() const
Emissive color.
Convenience access to the MaterialAttribute::0x000000_srgbf
(i.e, no emission).
If the material has MaterialAttribute::
UnsignedInt Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: emissiveTexture() const
Emissive texture ID.
Available only if MaterialAttribute::
Matrix3 Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: emissiveTextureMatrix() const
Emissive texture coordinate transformation matrix.
Convenience access to the MaterialAttribute::
UnsignedInt Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: emissiveTextureCoordinates() const
Emissive texture coordinate set.
Convenience access to the MaterialAttribute::0
. Available only if the material has MaterialAttribute::
UnsignedInt Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: emissiveTextureLayer() const
Emissive array texture layer.
Convenience access to the MaterialAttribute::0
. Available only if the material has MaterialAttribute::
Matrix3 Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: 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 baseColorTextureMatrix(), metalnessTextureMatrix(), roughnessTextureMatrix(), normalTextureMatrix(), occlusionTextureMatrix() and emissiveTextureMatrix() where a texture is present. If no texture is present, returns an identity matrix.
UnsignedInt Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: commonTextureCoordinates() const
Common texture coordinate set for all textures.
Expects that hasCommonTextureCoordinates() is true
; returns a coordinate set index that's the same for all of baseColorTextureCoordinates(), metalnessTextureCoordinates(), roughnessTextureCoordinates(), normalTextureCoordinates(), occlusionTextureCoordinates() and emissiveTextureCoordinates() where a texture is present. If no texture is present, returns 0
.
UnsignedInt Magnum:: Trade:: PbrMetallicRoughnessMaterialData:: commonTextureLayer() const
Common array texture layer for all textures.
Expects that hasCommonTextureLayer() is true
; returns a layer that's the same for all of baseColorTextureLayer(), metalnessTextureLayer(), roughnessTextureLayer(), normalTextureLayer(), occlusionTextureLayer() and emissiveTextureLayer() where a texture is present. If no texture is present, returns 0
.