QMetalRoughMaterial Class | Qt 3D 5.12.5

Qt 5.12 | Qt 3D | C++ Classes | QMetalRoughMaterial

Qt 5.12.5 Reference Documentation

# QMetalRoughMaterial Class

(Qt3DExtras::QMetalRoughMaterial)

The QMetalRoughMaterial provides a default implementation of PBR lighting. More...

Header: | #include <QMetalRoughMaterial>
qmake: | QT += 3dextras
Since: | Qt 5.9
Instantiated By: | MetalRoughMaterial
Inherits: | Qt3DRender::QMaterial
Inherited By: | Qt3DExtras::QTexturedMetalRoughMaterial

- List of all members, including inherited members
- Obsolete members

## Properties

- ambientOcclusion : QVariant
- baseColor : QVariant
- metalness : QVariant

- normal : QVariant
- roughness : QVariant
- textureScale : float

- 1 property inherited from Qt3DRender::QMaterial
- 1 property inherited from Qt3DCore::QComponent
- 3 properties inherited from Qt3DCore::QNode
- 1 property inherited from QObject

## Public Functions

| QMetalRoughMaterial(Qt3DCore::QNode *parent = nullptr)
virtual | ~QMetalRoughMaterial()
QVariant | ambientOcclusion() const
QVariant | baseColor() const
QVariant | metalness() const
QVariant | normal() const
QVariant | roughness() const
float | textureScale() const

- 4 public functions inherited from Qt3DRender::QMaterial
- 2 public functions inherited from Qt3DCore::QComponent
- 13 public functions inherited from Qt3DCore::QNode
- 31 public functions inherited from QObject

## Public Slots

void | setAmbientOcclusion(const QVariant &ambientOcclusion)
void | setBaseColor(const QVariant &baseColor)
void | setMetalness(const QVariant &metalness)
void | setNormal(const QVariant &normal)
void | setRoughness(const QVariant &roughness)
void | setTextureScale(float textureScale)

- 1 public slot inherited from Qt3DRender::QMaterial
- 1 public slot inherited from Qt3DCore::QComponent
- 3 public slots inherited from Qt3DCore::QNode
- 1 public slot inherited from QObject

## Signals

void | ambientOcclusionChanged(const QVariant &ambientOcclusion)
void | baseColorChanged(const QVariant &baseColor)
void | metalnessChanged(const QVariant &metalness)
void | normalChanged(const QVariant &normal)
void | roughnessChanged(const QVariant &roughness)
void | textureScaleChanged(float textureScale)

- 1 signal inherited from Qt3DRender::QMaterial
- 3 signals inherited from Qt3DCore::QComponent
- 4 signals inherited from Qt3DCore::QNode
- 2 signals inherited from QObject

## Static Public Members

const QMetaObject | staticMetaObject

- 9 static public members inherited from QObject

### Additional Inherited Members

- 2 protected functions inherited from Qt3DCore::QNode
- 9 protected functions inherited from QObject

## Detailed Description

The QMetalRoughMaterial provides a default implementation of PBR lighting.

This material uses an effect with a single render pass approach and performs per fragment lighting. Techniques are provided for OpenGL 3 and OpenGL ES 3.

## Property Documentation

### ambientOcclusion : QVariant

Holds the current ambient occlusion map texture of the material. This can only be a texture, otherwise it is ignored. By default this map is not set.

Access functions:

QVariant | ambientOcclusion() const
void | setAmbientOcclusion(const QVariant &ambientOcclusion)

Notifier signal:

void | ambientOcclusionChanged(const QVariant &ambientOcclusion)

### baseColor : QVariant

Holds the current base color of the material. This can be either a plain color value or a texture. By default the value of this property is "grey".

Access functions:

QVariant | baseColor() const
void | setBaseColor(const QVariant &baseColor)

Notifier signal:

void | baseColorChanged(const QVariant &baseColor)

### metalness : QVariant

Holds the current metalness level of the material, as a value between 0 (purely dielectric, the default) and 1 (purely metallic). This can be either a plain uniform value or a texture. By default the value of this property is 0.

Access functions:

QVariant | metalness() const
void | setMetalness(const QVariant &metalness)

Notifier signal:

void | metalnessChanged(const QVariant &metalness)

### normal : QVariant

Holds the current normal map texture of the material. This can only be a texture, otherwise it is ignored. By default this map is not set.

Access functions:

QVariant | normal() const
void | setNormal(const QVariant &normal)

Notifier signal:

void | normalChanged(const QVariant &normal)

### roughness : QVariant

Holds the current roughness level of the material. This can be either a plain uniform value or a texture. By default the value of this property is 0.

Access functions:

QVariant | roughness() const
void | setRoughness(const QVariant &roughness)

Notifier signal:

void | roughnessChanged(const QVariant &roughness)

### textureScale : float

Holds the current texture scale. It is applied as a multiplier to texture coordinates at render time. Defaults to 1.0.

When used in conjunction with QTextureWrapMode::Repeat, textureScale provides a simple way to tile a texture across a surface. For example, a texture scale of `4.0` would result in 16 (4x4) tiles.

Access functions:

float | textureScale() const
void | setTextureScale(float textureScale)

Notifier signal:

void | textureScaleChanged(float textureScale)

## Member Function Documentation

### QMetalRoughMaterial::QMetalRoughMaterial(Qt3DCore::QNode *parent = nullptr)

Constructs a new QMetalRoughMaterial instance with parent object parent.

### `[virtual]` QMetalRoughMaterial::~QMetalRoughMaterial()

Destroys the QMetalRoughMaterial instance.