QTextureMaterial Class | Qt 3D 5.12.12

- Qt 5.12
- Qt 3D
- C++ Classes
- QTextureMaterial
- Qt 5.12.12 Reference Documentation

# QTextureMaterial Class

(Qt3DExtras::QTextureMaterial)

The QTextureMaterial provides a default implementation of a simple unlit texture material. More...

Header: | #include <QTextureMaterial>
qmake: | QT += 3dextras
Since: | Qt 5.9
Inherits: | Qt3DRender::QMaterial

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

## Properties

- alphaBlending : bool
- texture : Qt3DRender::QAbstractTexture*
- textureOffset : QVector2D
- textureTransform : QMatrix3x3

- 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

| QTextureMaterial(Qt3DCore::QNode *parent = nullptr)
virtual | ~QTextureMaterial()
bool | isAlphaBlendingEnabled() const
Qt3DRender::QAbstractTexture * | texture() const
QVector2D | textureOffset() const
QMatrix3x3 | textureTransform() 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 | setAlphaBlendingEnabled(bool enabled)
void | setTexture(Qt3DRender::QAbstractTexture *texture)
void | setTextureOffset(QVector2D textureOffset)
void | setTextureTransform(const QMatrix3x3 &matrix)

- 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 | alphaBlendingEnabledChanged(bool enabled)
void | textureChanged(Qt3DRender::QAbstractTexture *texture)
void | textureOffsetChanged(QVector2D textureOffset)
void | textureTransformChanged(const QMatrix3x3 &textureTransform)

- 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 QTextureMaterial provides a default implementation of a simple unlit texture material.

This material uses an effect with a single render pass approach. Techniques are provided for OpenGL 2, OpenGL 3 or above as well as OpenGL ES 2.

## Property Documentation

### alphaBlending : bool

Indicates if the alpha information coming from the diffuse property will be taken into account during rendering. Defaults to false.

Access functions:

bool | isAlphaBlendingEnabled() const
void | setAlphaBlendingEnabled(bool enabled)

Notifier signal:

void | alphaBlendingEnabledChanged(bool enabled)

### texture : Qt3DRender::QAbstractTexture*

Holds the current texture used by the material.

Access functions:

Qt3DRender::QAbstractTexture * | texture() const
void | setTexture(Qt3DRender::QAbstractTexture *texture)

Notifier signal:

void | textureChanged(Qt3DRender::QAbstractTexture *texture)

### textureOffset : QVector2D

This is a utility property. It sets the translation component of the general texture transform matrix

Access functions:

QVector2D | textureOffset() const
void | setTextureOffset(QVector2D textureOffset)

Notifier signal:

void | textureOffsetChanged(QVector2D textureOffset)

### textureTransform : QMatrix3x3

Holds the current texture transform. It is applied to texture coordinates at render time. Defaults to identity matrix.

Access functions:

QMatrix3x3 | textureTransform() const
void | setTextureTransform(const QMatrix3x3 &matrix)

Notifier signal:

void | textureTransformChanged(const QMatrix3x3 &textureTransform)

## Member Function Documentation

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

Constructs a new QTextureMaterial instance with parent object parent.

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

Destroys the QTextureMaterial instance.