Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QSGOpaqueTextureMaterial Class Reference

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

#include <qsgtexturematerial.h>

+ Inheritance diagram for QSGOpaqueTextureMaterial:
+ Collaboration diagram for QSGOpaqueTextureMaterial:

Public Member Functions

 QSGOpaqueTextureMaterial ()
 Creates a new QSGOpaqueTextureMaterial.
 
QSGMaterialTypetype () const override
 
QSGMaterialShadercreateShader (QSGRendererInterface::RenderMode renderMode) const override
 
int compare (const QSGMaterial *other) const override
 
void setTexture (QSGTexture *texture)
 Sets the texture of this material to texture.
 
QSGTexturetexture () const
 Returns this texture material's texture.
 
void setMipmapFiltering (QSGTexture::Filtering filteringType)
 Sets the mipmap mode to filtering.
 
QSGTexture::Filtering mipmapFiltering () const
 Returns this material's mipmap filtering mode.
 
void setFiltering (QSGTexture::Filtering filteringType)
 Sets the filtering to filtering.
 
QSGTexture::Filtering filtering () const
 Returns this material's filtering mode.
 
void setHorizontalWrapMode (QSGTexture::WrapMode mode)
 Sets the horizontal wrap mode to mode.
 
QSGTexture::WrapMode horizontalWrapMode () const
 Returns this material's horizontal wrap mode.
 
void setVerticalWrapMode (QSGTexture::WrapMode mode)
 Sets the vertical wrap mode to mode.
 
QSGTexture::WrapMode verticalWrapMode () const
 Returns this material's vertical wrap mode.
 
void setAnisotropyLevel (QSGTexture::AnisotropyLevel level)
 Sets this material's anistropy level to level.
 
QSGTexture::AnisotropyLevel anisotropyLevel () const
 Returns this material's anistropy level.
 
- Public Member Functions inherited from QSGMaterial
 QSGMaterial ()
 
virtual ~QSGMaterial ()
 
QSGMaterial::Flags flags () const
 Returns the material's flags.
 
void setFlag (Flags flags, bool on=true)
 Sets the flags flags on this material if on is true; otherwise clears the attribute.
 
int viewCount () const
 

Protected Attributes

QSGTexturem_texture
 
uint m_filtering: 2
 
uint m_mipmap_filtering: 2
 
uint m_horizontal_wrap: 1
 
uint m_vertical_wrap: 1
 
uint m_anisotropy_level: 3
 
uint m_reserved: 23
 

Additional Inherited Members

- Public Types inherited from QSGMaterial
enum  Flag {
  Blending = 0x0001 , RequiresDeterminant = 0x0002 , RequiresFullMatrixExceptTranslate = 0x0004 | RequiresDeterminant , RequiresFullMatrix = 0x0008 | RequiresFullMatrixExceptTranslate ,
  NoBatching = 0x0010 , MultiView2 = 0x10000 , MultiView3 = 0x20000 , MultiView4 = 0x40000
}
 \value Blending Set this flag to true if the material requires blending to be enabled during rendering. More...
 

Detailed Description

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

\inmodule QtQuick

Warning
This utility class is only functional when running with the default 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.

Definition at line 12 of file qsgtexturematerial.h.

Constructor & Destructor Documentation

◆ QSGOpaqueTextureMaterial()

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.

Definition at line 122 of file qsgtexturematerial.cpp.

Member Function Documentation

◆ anisotropyLevel()

QSGTexture::AnisotropyLevel QSGOpaqueTextureMaterial::anisotropyLevel ( ) const
inline

Returns this material's anistropy level.

Definition at line 37 of file qsgtexturematerial.h.

Referenced by QSGDefaultImageNode::anisotropyLevel(), QSGDefaultImageNode::setAnisotropyLevel(), and QSGOpaqueTextureMaterialRhiShader::updateSampledImage().

+ Here is the caller graph for this function:

◆ compare()

int QSGOpaqueTextureMaterial::compare ( const QSGMaterial * o) const
overridevirtual

Reimplemented from QSGMaterial.

Definition at line 275 of file qsgtexturematerial.cpp.

References QSGTexture::comparisonKey(), m_filtering, m_texture, o, other(), Q_ASSERT, and type().

+ Here is the call graph for this function:

◆ createShader()

QSGMaterialShader * QSGOpaqueTextureMaterial::createShader ( QSGRendererInterface::RenderMode renderMode) const
overridevirtual

Implements QSGMaterial.

Reimplemented in QSGSmoothTextureMaterial, and QSGTextureMaterial.

Definition at line 145 of file qsgtexturematerial.cpp.

References Q_UNUSED, and QSGMaterial::viewCount().

+ Here is the call graph for this function:

◆ filtering()

QSGTexture::Filtering QSGOpaqueTextureMaterial::filtering ( ) const
inline

Returns this material's filtering mode.

The default filtering is QSGTexture::Nearest.

Definition at line 28 of file qsgtexturematerial.h.

Referenced by QSGSimpleTextureNode::filtering(), QSGDefaultImageNode::filtering(), QSGSimpleTextureNode::setFiltering(), QSGDefaultInternalImageNode::setFiltering(), QSGDefaultImageNode::setFiltering(), and QSGOpaqueTextureMaterialRhiShader::updateSampledImage().

+ Here is the caller graph for this function:

◆ horizontalWrapMode()

QSGTexture::WrapMode QSGOpaqueTextureMaterial::horizontalWrapMode ( ) const
inline

Returns this material's horizontal wrap mode.

The default horizontal wrap mode is QSGTexture::ClampToEdge.

Definition at line 31 of file qsgtexturematerial.h.

Referenced by QSGDefaultInternalImageNode::setHorizontalWrapMode(), and QSGOpaqueTextureMaterialRhiShader::updateSampledImage().

+ Here is the caller graph for this function:

◆ mipmapFiltering()

QSGTexture::Filtering QSGOpaqueTextureMaterial::mipmapFiltering ( ) const
inline

Returns this material's mipmap filtering mode.

The default mipmap mode is QSGTexture::Nearest.

Definition at line 25 of file qsgtexturematerial.h.

Referenced by QSGDefaultImageNode::mipmapFiltering(), QSGDefaultInternalImageNode::setMipmapFiltering(), QSGDefaultImageNode::setMipmapFiltering(), and QSGOpaqueTextureMaterialRhiShader::updateSampledImage().

+ Here is the caller graph for this function:

◆ setAnisotropyLevel()

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

Sets this material's anistropy level to level.

Definition at line 36 of file qsgtexturematerial.h.

Referenced by QSGDefaultImageNode::setAnisotropyLevel().

+ Here is the caller graph for this function:

◆ setFiltering()

void QSGOpaqueTextureMaterial::setFiltering ( QSGTexture::Filtering filtering)
inline

Sets the filtering to filtering.

The filtering mode is set on the texture instance just before the texture is bound for rendering.

Definition at line 27 of file qsgtexturematerial.h.

Referenced by QSGSimpleTextureNode::setFiltering(), QSGDefaultInternalImageNode::setFiltering(), QSGDefaultImageNode::setFiltering(), QSGDefaultPainterNode::setLinearFiltering(), and QQuickNinePatchImage::updatePaintNode().

+ Here is the caller graph for this function:

◆ setHorizontalWrapMode()

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

Sets the horizontal wrap mode to mode.

The horizontal wrap mode is set on the texture instance just before the texture is bound for rendering.

Definition at line 30 of file qsgtexturematerial.h.

Referenced by QSGDefaultInternalImageNode::setHorizontalWrapMode().

+ Here is the caller graph for this function:

◆ setMipmapFiltering()

void QSGOpaqueTextureMaterial::setMipmapFiltering ( QSGTexture::Filtering filtering)
inline

Sets the mipmap mode to filtering.

The mipmap filtering mode is set on the texture instance just before the texture is bound for rendering.

If the texture does not have mipmapping support, enabling mipmapping has no effect.

Definition at line 24 of file qsgtexturematerial.h.

Referenced by QSGDefaultImageNode::QSGDefaultImageNode(), QSGSimpleTextureNode::QSGSimpleTextureNode(), QSGDefaultInternalImageNode::setMipmapFiltering(), QSGDefaultImageNode::setMipmapFiltering(), and QSGDefaultPainterNode::setMipmapping().

+ Here is the caller graph for this function:

◆ setTexture()

void QSGOpaqueTextureMaterial::setTexture ( QSGTexture * texture)

Sets the texture of this material to texture.

The material does not take ownership of the texture.

Definition at line 166 of file qsgtexturematerial.cpp.

References QSGMaterial::Blending, QSGTexture::hasAlphaChannel(), m_texture, QSGMaterial::setFlag(), and texture().

Referenced by QQuickNinePatchNode::initialize(), QSGDefaultInternalImageNode::setMaterialTexture(), QSGSimpleTextureNode::setTexture(), QSGDefaultImageNode::setTexture(), and QSGDefaultNinePatchNode::setTexture().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setVerticalWrapMode()

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

Sets the vertical wrap mode to mode.

The vertical wrap mode is set on the texture instance just before the texture is bound for rendering.

Definition at line 33 of file qsgtexturematerial.h.

Referenced by QSGDefaultInternalImageNode::setVerticalWrapMode().

+ Here is the caller graph for this function:

◆ texture()

◆ type()

QSGMaterialType * QSGOpaqueTextureMaterial::type ( ) const
overridevirtual

Implements QSGMaterial.

Reimplemented in QSGSmoothTextureMaterial, and QSGTextureMaterial.

Definition at line 136 of file qsgtexturematerial.cpp.

References type().

Referenced by compare(), and type().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ verticalWrapMode()

QSGTexture::WrapMode QSGOpaqueTextureMaterial::verticalWrapMode ( ) const
inline

Returns this material's vertical wrap mode.

The default vertical wrap mode is QSGTexture::ClampToEdge.

Definition at line 34 of file qsgtexturematerial.h.

Referenced by QSGDefaultInternalImageNode::setVerticalWrapMode(), and QSGOpaqueTextureMaterialRhiShader::updateSampledImage().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_anisotropy_level

uint QSGOpaqueTextureMaterial::m_anisotropy_level
protected

Definition at line 46 of file qsgtexturematerial.h.

◆ m_filtering

uint QSGOpaqueTextureMaterial::m_filtering
protected

Definition at line 42 of file qsgtexturematerial.h.

Referenced by compare().

◆ m_horizontal_wrap

uint QSGOpaqueTextureMaterial::m_horizontal_wrap
protected

Definition at line 44 of file qsgtexturematerial.h.

◆ m_mipmap_filtering

uint QSGOpaqueTextureMaterial::m_mipmap_filtering
protected

Definition at line 43 of file qsgtexturematerial.h.

◆ m_reserved

uint QSGOpaqueTextureMaterial::m_reserved
protected

Definition at line 47 of file qsgtexturematerial.h.

◆ m_texture

QSGTexture* QSGOpaqueTextureMaterial::m_texture
protected

Definition at line 40 of file qsgtexturematerial.h.

Referenced by compare(), QSGSmoothTextureMaterial::setTexture(), and setTexture().

◆ m_vertical_wrap

uint QSGOpaqueTextureMaterial::m_vertical_wrap
protected

Definition at line 45 of file qsgtexturematerial.h.


The documentation for this class was generated from the following files: