Module: Kuesa Qt 3D API
Kuesa::Qt3D::MetallicRoughnessProperties hold the properties of a physically based rendering (PBR) material based on the glTF 2.0 material description. More...
#include <Kuesa/Qt3D/api/materials/metallicroughnessproperties.h>
Inherits from Kuesa::Qt3D::GLTF2MaterialProperties, Qt3DCore::QNode
Public Slots
Public Signals
Public Functions
Public Properties
Friends
Additional inherited members
Public Types inherited from Kuesa::Qt3D::GLTF2MaterialProperties
Public Slots inherited from Kuesa::Qt3D::GLTF2MaterialProperties
Public Signals inherited from Kuesa::Qt3D::GLTF2MaterialProperties
Public Functions inherited from Kuesa::Qt3D::GLTF2MaterialProperties
Public Properties inherited from Kuesa::Qt3D::GLTF2MaterialProperties
Detailed Description
| class Kuesa::Qt3D::MetallicRoughnessProperties;
|
Kuesa::Qt3D::MetallicRoughnessProperties hold the properties of a physically based rendering (PBR) material based on the glTF 2.0 material description.
Since: Kuesa 2.0
The material properties are defined using a common set of parameter that define how light interacts with it. This allows to use a common description of the material so they are rendered consistently across platforms and 3D software and can be described by an intuitive set of parameters.
The MetallicRoughnessProperties consists of the following properties:
- baseColorFactor: Base color of the material
- baseColorMap: A texture specifying the base color of the material
- baseColorMapTextureTransform: Texture transform for the base color map
- metallicFactor: The metalness of the material
- roughnessFactor: The roughness of the material
- metalRoughMap: A texture specifying both metalness and roughness of the material
- metalRoughMapTextureTransform: Texture transform for the metalRough map
- normalMap: Normal texture for normal mapping. This allows to simulate very detailed surfaces without too many triangle
- normalMapTextureTransform: Texture transform for the normal map
- normalScale: A scale factor for the normal map
- ambientOcclusionMap: An ambient occlusion map. This allows to simulate ambient occlusion and shadow zones that otherwise will be too bright
- ambientOcclusionMapTextureTransform: Texture transform for the ambient occlusion map
- emissiveFactor: The emissive strength of the material
- emissiveMap: A texture specifying the emissive property of the material
- emissiveMapTextureTransform: Texture transform for the emissive map
For a particular point of an object, the base color is computed as baseColorFactorbaseColorMapvertexColor. The vertexColor is the interpolated value of the vertex color property of the mesh to which the material is applied.
Kuesa::Qt3D::MetallicRoughnessProperties also supports alpha blending and alpha cutoff. Alpha blending is used to simulate transparent materials, like a glass, while alpha cutoff is used to discard fragment that have an alpha value below a threshold. This is useful to render grass or trees for example.
Kuesa::Qt3D::MetallicRoughnessProperties supports two texture coordinate sets for each map. To specify the texture coordinate set a map must use, you can set the
A more complete description of the material can be found in https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#materials
Public Slots Documentation
| void setMetallicRoughnessUsesTexCoord1(
bool metallicRoughnessUsesTexCoord1
)
|
slot setNormalUsesTexCoord1
| void setNormalUsesTexCoord1(
bool normalUsesTexCoord1
)
|
slot setAOUsesTexCoord1
| void setAOUsesTexCoord1(
bool aoUsesTexCoord1
)
|
slot setEmissiveUsesTexCoord1
| void setEmissiveUsesTexCoord1(
bool emissiveUsesTexCoord1
)
|
| void setMetallicFactor(
float metallicFactor
)
|
slot setRoughnessFactor
| void setRoughnessFactor(
float roughnessFactor
)
|
| void setMetalRoughMap(
Qt3DRender::QAbstractTexture * metalRoughMap
)
|
slot setNormalScale
| void setNormalScale(
float normalScale
)
|
slot setNormalMap
| void setNormalMap(
Qt3DRender::QAbstractTexture * normalMap
)
|
slot setAmbientOcclusionMap
| void setAmbientOcclusionMap(
Qt3DRender::QAbstractTexture * ambientOcclusionMap
)
|
slot setEmissiveFactor
| void setEmissiveFactor(
const QColor & emissiveFactor
)
|
slot setEmissiveMap
| void setEmissiveMap(
Qt3DRender::QAbstractTexture * emissiveMap
)
|
slot setClearCoatProperties
| void setClearCoatProperties(
Kuesa::Qt3D::ClearCoatProperties * clearCoatProperties
)
|
Public Signals Documentation
| void metallicRoughnessUsesTexCoord1Changed(
bool
)
|
signal normalUsesTexCoord1Changed
| void normalUsesTexCoord1Changed(
bool
)
|
signal aoUsesTexCoord1Changed
| void aoUsesTexCoord1Changed(
bool
)
|
signal emissiveUsesTexCoord1Changed
| void emissiveUsesTexCoord1Changed(
bool
)
|
| void metallicFactorChanged(
float metallicFactor
)
|
signal roughnessFactorChanged
| void roughnessFactorChanged(
float roughnessFactor
)
|
| void metalRoughMapChanged(
Qt3DRender::QAbstractTexture * metalRoughMap
)
|
signal normalScaleChanged
| void normalScaleChanged(
float normalScale
)
|
signal normalMapChanged
| void normalMapChanged(
Qt3DRender::QAbstractTexture * normalMapChanged
)
|
signal ambientOcclusionMapChanged
| void ambientOcclusionMapChanged(
Qt3DRender::QAbstractTexture * ambientOcclusionMap
)
|
signal emissiveFactorChanged
| void emissiveFactorChanged(
const QColor & emissiveFactor
)
|
signal emissiveMapChanged
| void emissiveMapChanged(
Qt3DRender::QAbstractTexture * emissiveMap
)
|
signal clearCoatPropertiesChanged
| void clearCoatPropertiesChanged(
Kuesa::Qt3D::ClearCoatProperties * clearCoatProperties
)
|
Public Functions Documentation
| explicit MetallicRoughnessProperties(
Qt3DCore::QNode * parent =nullptr
)
|
| ~MetallicRoughnessProperties()
|
function shaderData
| virtual Qt3DRender::QShaderData * shaderData() const override
|
Reimplements: Kuesa::Qt3D::GLTF2MaterialProperties::shaderData
| bool isMetallicRoughnessUsingTexCoord1() const
|
function isNormalUsingTexCoord1
| bool isNormalUsingTexCoord1() const
|
function isAOUsingTexCoord1
| bool isAOUsingTexCoord1() const
|
function isEmissiveUsingTexCoord1
| bool isEmissiveUsingTexCoord1() const
|
function baseColorMapTextureTransform
| Kuesa::Qt3D::TextureTransform * baseColorMapTextureTransform() const
|
| float metallicFactor() const
|
function roughnessFactor
| float roughnessFactor() const
|
| Qt3DRender::QAbstractTexture * metalRoughMap() const
|
function metalRoughMapTextureTransform
| Kuesa::Qt3D::TextureTransform * metalRoughMapTextureTransform() const
|
function normalScale
| float normalScale() const
|
function normalMap
| Qt3DRender::QAbstractTexture * normalMap() const
|
function normalMapTextureTransform
| Kuesa::Qt3D::TextureTransform * normalMapTextureTransform() const
|
function ambientOcclusionMap
| Qt3DRender::QAbstractTexture * ambientOcclusionMap() const
|
function ambientOcclusionMapTextureTransform
| Kuesa::Qt3D::TextureTransform * ambientOcclusionMapTextureTransform() const
|
function emissiveFactor
| QColor emissiveFactor() const
|
function emissiveMap
| Qt3DRender::QAbstractTexture * emissiveMap() const
|
function emissiveMapTextureTransform
| Kuesa::Qt3D::TextureTransform * emissiveMapTextureTransform() const
|
function clearCoatProperties
| Kuesa::Qt3D::ClearCoatProperties * clearCoatProperties() const
|
Public Property Documentation
| bool metallicRoughnessUsesTexCoord1;
|
False if the map must use the 0th texture coordinate set, binded to 'defaultTextureCoordinateName' attribute. True if the map must use the 1st texture coordinate set, binded to 'defaultTextureCoordinate1Name' attribute.
property normalUsesTexCoord1
| bool normalUsesTexCoord1;
|
False if the map must use the 0th texture coordinate set, binded to 'defaultTextureCoordinateName' attribute. True if the map must use the 1st texture coordinate set, binded to 'defaultTextureCoordinate1Name' attribute.
property aoUsesTexCoord1
False if the map must use the 0th texture coordinate set, binded to 'defaultTextureCoordinateName' attribute. True if the map must use the 1st texture coordinate set, binded to 'defaultTextureCoordinate1Name' attribute.
property emissiveUsesTexCoord1
| bool emissiveUsesTexCoord1;
|
False if the map must use the 0th texture coordinate set, binded to 'defaultTextureCoordinateName' attribute. True if the map must use the 1st texture coordinate set, binded to 'defaultTextureCoordinate1Name' attribute.
property baseColorMapTextureTransform
| Kuesa::Qt3D::TextureTransform * baseColorMapTextureTransform;
|
Specifies the metallic factor of the material. Set this value between 0.0 and 1.0 to module how metallic the material is.
property roughnessFactor
Specifies the roughness factor of the material. Set the value between 0.0 and 1.0 to modulate how rough the material is.
| Qt3DRender::QAbstractTexture * metalRoughMap;
|
Note: If this property is nullptr and is set to a non nullptr value or viceverse, it will trigger a recompilation of the shader.
Specifies a texture to be used as metallic and roughness factor. The metallic factor is sampled for the B channel of the texture, while the roughness factor is sampled from the G channel. R and A channel are unused. This offers a way of combining the ambientOcclusionMap's R channel in the same texture as the metalRoughMap. The content of the texture is expected to be in linear RGB color space.
property metalRoughMapTextureTransform
| Kuesa::Qt3D::TextureTransform * metalRoughMapTextureTransform;
|
property normalScale
Specifies a scale for the normal map calculations. A bigger number is used to simulated bigger bumps in the surface
property normalMap
| Qt3DRender::QAbstractTexture * normalMap;
|
Note: If this property is nullptr and is set to a non nullptr value or viceverse, it will trigger a recompilation of the shader.
Specifies a normal map for the material. This allows to simulate very detailed surfaces without a huge number of triangles. The content of the texture is expected to be in linear RGB color space.
property normalMapTextureTransform
| Kuesa::Qt3D::TextureTransform * normalMapTextureTransform;
|
property ambientOcclusionMap
| Qt3DRender::QAbstractTexture * ambientOcclusionMap;
|
Note: If this property is nullptr and is set to a non nullptr value or viceverse, it will trigger a recompilation of the shader.
Specifies a texture to be used for ambient occlusion. The content of the texture is expected to be a single R channel in linear space. This offers a way of combining the metalRoughMap's G and B channels in the same texture as the ambientOcclusionMap.
property ambientOcclusionMapTextureTransform
| Kuesa::Qt3D::TextureTransform * ambientOcclusionMapTextureTransform;
|
property emissiveFactor
Specifies an emissive factor to be used for emissive surfaces.
property emissiveMap
| Qt3DRender::QAbstractTexture * emissiveMap;
|
Note: If this property is nullptr and is set to a non nullptr value or viceverse, it will trigger a recompilation of the shader.
Specifies a texture to be used for emissive surfaces. The content of the texture is expected to be in sRGB color space.
property emissiveMapTextureTransform
| Kuesa::Qt3D::TextureTransform * emissiveMapTextureTransform;
|
property clearCoatProperties
| Kuesa::Qt3D::ClearCoatProperties * clearCoatProperties;
|
Since: Kuesa 2.1
If the material makes use of the KHR_materials_clearcoat extension, additional clear coat properties can be set.
Friends
| friend class MetallicRoughnessMaterial(
MetallicRoughnessMaterial
);
|
Updated on 2023-07-03 at 11:02:09 +0000