QQuick3DTextureProviderExtension Class | Qt Quick 3D | Qt 6.11.0
Description: Abstract class for implementing user side texture provider extensions.

- Qt 6.11
- Qt Quick 3D
- C++ Classes
- QQuick3DTextureProviderExtension
- Qt Quick 3D | Commercial or GPLv3

# QQuick3DTextureProviderExtension Class

Abstract class for implementing user side texture provider extensions. More...

Header: | `#include <QQuick3DTextureProviderExtension>`
Since: | Qt 6.11
In QML: | TextureProviderExtension
Inherits: | QQuick3DRenderExtension

- List of all members, including inherited members

## Properties

- `(since 6.11)` samplerHint : SamplerHint

## Public Functions

QQuick3DTextureProviderExtension::SamplerHint | samplerHint() const
void | setSamplerHint(QQuick3DTextureProviderExtension::SamplerHint newSamplerHint)

## Signals

void | samplerHintChanged()

## Reimplemented Protected Functions

virtual QSSGRenderGraphObject * | updateSpatialNode(QSSGRenderGraphObject *node) override

## Detailed Description

This is the front-end side of a texture provider extension. The back-end side is implemented in QSSGRenderExtension. The QQuick3DTextureProviderExtension is a specialization of the QQuick3DRenderExtension class that is used to create a custom texture provider extension that can both provide additional metadata about what type of texture will be provided and also automatically register the extension with the QtQuick3D scene graph. This means it is unecessary to manually add the extension to the list of extensions to be used with a View3D, and just using the textureProvider property of the Texture component is enough to trigger the extension code to be run when necessary.

The QQuick3DTextureProviderExtension class is an abstract class that should be subclassed and exposed to QML. The subclass should implement the QQuick3DRenderExtension::updateSpatialNode() function and return a QSSGRenderExtension instance that contains the code that should be run.

See also QSSGRenderExtension.

## Property Documentation

### `[since 6.11]` samplerHint : SamplerHint

This property contains a hint about the type of texture that will be provided by the extension. This is necessary because the texture data will not be provided until it is necessary, but materials that use the Texture component need to know what type of sampler to provide.

The default value is `QQuick3DTextureProviderExtension::Sampler2D`.

Note: This property is only used when using CustomMaterials.

This property was introduced in Qt 6.11.

Access functions:

QQuick3DTextureProviderExtension::SamplerHint | samplerHint() const
void | setSamplerHint(QQuick3DTextureProviderExtension::SamplerHint newSamplerHint)

Notifier signal:

void | samplerHintChanged()

See also SamplerHint.

## Member Function Documentation

### `[override virtual protected]` QSSGRenderGraphObject *QQuick3DTextureProviderExtension::updateSpatialNode(QSSGRenderGraphObject *node)

Reimplements: QQuick3DRenderExtension::updateSpatialNode(QSSGRenderGraphObject *node).

This function is called during the synchronization of the QtQuick3D scene graph when an item is created or when an update is requested, usually as a result of a change in the item's properties. The function should return a QSSGRenderTextureProviderExtension instance that contains the code that should be run during QtQuick3D's rendering pipeline execution.

The node parameter is the previous QSSGRenderTextureProviderExtension instance that was returned from this function, or null if this is the first time the function is called. The function can return the same instance, a different instance, or null. If the function returns null, the extension will be removed from the rendering pipeline.

Note: The QSSGRenderTextureProviderExtension instance is a resource object and will be owned by the QtQuick3D scene graph. If a different instance, or null, is returned, the previous instance will be queued for deletion by the renderer.

See also QSSGRenderTextureProviderExtension.