En esta página

TextureData QML Type (Uncreatable)

Tipo base para datos de texturas personalizadas. Más...

Import Statement: import QtQuick3D
In C++: QQuick3DTextureData
Inherits:

Object3D

Inherited By:

ProceduralSkyTextureData and ProceduralTextureData

Nota: Se trata de un tipo no creable. No se puede instanciar en QML.

Descripción detallada

Los datos de textura personalizados permiten utilizar datos de textura generados por la aplicación, que también pueden cambiar dinámicamente. Para utilizar datos de textura personalizados, configura la propiedad « textureData » de « Texture » para que haga referencia a un objeto «TextureData».

Los datos de textura personalizados se implementan en C++ creando una instancia de ` QQuick3DTextureData `, a menudo subclasificándola. El tipo ` QQuick3DTextureData ` se registra en QML con el nombre de `TextureData`. Una vez que la subclase se ha registrado en QML, los objetos `Texture` pueden empezar a hacer referencia a ella.

Un ejemplo de cuándo utilizar esta API es cuando es necesario generar una textura de forma procedural en tiempo de ejecución, en lugar de cargar una imagen estática desde un archivo.

import MyCustomTexture 1.0

Model {
    source: "#Cube"
    materials: [
        DefaultMaterial {
            diffuseMap: diffuseMapCustomTexture
        }
    ]
}

Texture {
    id: diffuseMapCustomTexture
    textureData: MyCustomTextureData {

    }
}

Véase también Texture.

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.