QSGOpaqueTextureMaterial Class

The QSGOpaqueTextureMaterial class provides a convenient way of rendering textured geometry in the scene graph. More...

Header: #include <QSGOpaqueTextureMaterial>
qmake: QT += quick
Inherits: QSGMaterial
Inherited By:

QSGTextureMaterial

Public Functions

QSGOpaqueTextureMaterial()
QSGTexture::AnisotropyLevel anisotropyLevel() const
QSGTexture::Filtering filtering() const
QSGTexture::WrapMode horizontalWrapMode() const
QSGTexture::Filtering mipmapFiltering() const
void setAnisotropyLevel(QSGTexture::AnisotropyLevel level)
void setFiltering(QSGTexture::Filtering filteringType)
void setHorizontalWrapMode(QSGTexture::WrapMode mode)
void setMipmapFiltering(QSGTexture::Filtering filteringType)
void setTexture(QSGTexture *texture)
void setVerticalWrapMode(QSGTexture::WrapMode mode)
QSGTexture *texture() const
QSGTexture::WrapMode verticalWrapMode() const

Detailed Description

The QSGOpaqueTextureMaterial class provides a convenient way of rendering textured geometry in the scene graph.

Warning: This utility class is only functional when running with the OpenGL backend of the Qt Quick scenegraph.

The opaque textured material will fill every pixel in a geometry with the supplied texture. The material does not respect the opacity of the QSGMaterialShader::RenderState, so opacity nodes in the parent chain of nodes using this material, have no effect.

The geometry to be rendered with an opaque texture material requires vertices in attribute location 0 and texture coordinates in attribute location 1. The texture coordinate is a 2-dimensional floating-point tuple. The QSGGeometry::defaultAttributes_TexturedPoint2D returns an attribute set compatible with this material.

The texture to be rendered can be set using setTexture(). How the texture should be rendered can be specified using setMipmapFiltering(), setFiltering(), setHorizontalWrapMode() and setVerticalWrapMode(). The rendering state is set on the texture instance just before it is bound.

The opaque textured material respects the current matrix and the alpha channel of the texture. It will disregard the accumulated opacity in the scenegraph.

A texture material must have a texture set before it is used as a material in the scene graph.

Member Function Documentation

QSGOpaqueTextureMaterial::QSGOpaqueTextureMaterial()

Creates a new QSGOpaqueTextureMaterial.

The default mipmap filtering and filtering mode is set to QSGTexture::Nearest. The default wrap modes is set to QSGTexture::ClampToEdge.

QSGTexture::AnisotropyLevel QSGOpaqueTextureMaterial::anisotropyLevel() const

See also setAnisotropyLevel().

QSGTexture::Filtering QSGOpaqueTextureMaterial::filtering() const

See also setFiltering().

QSGTexture::WrapMode QSGOpaqueTextureMaterial::horizontalWrapMode() const

See also setHorizontalWrapMode().

QSGTexture::Filtering QSGOpaqueTextureMaterial::mipmapFiltering() const

See also setMipmapFiltering().

void QSGOpaqueTextureMaterial::setAnisotropyLevel(QSGTexture::AnisotropyLevel level)

See also anisotropyLevel().

void QSGOpaqueTextureMaterial::setFiltering(QSGTexture::Filtering filteringType)

See also filtering().

void QSGOpaqueTextureMaterial::setHorizontalWrapMode(QSGTexture::WrapMode mode)

See also horizontalWrapMode().

void QSGOpaqueTextureMaterial::setMipmapFiltering(QSGTexture::Filtering filteringType)

See also mipmapFiltering().

void QSGOpaqueTextureMaterial::setTexture(QSGTexture *texture)

Sets the texture of this material to texture.

The material does not take ownership of the texture.

See also texture().

void QSGOpaqueTextureMaterial::setVerticalWrapMode(QSGTexture::WrapMode mode)

See also verticalWrapMode().

QSGTexture *QSGOpaqueTextureMaterial::texture() const

See also setTexture().

QSGTexture::WrapMode QSGOpaqueTextureMaterial::verticalWrapMode() const

See also setVerticalWrapMode().