TextureData QML Type
Tipo base para datos de textura personalizados. Más...
| Import Statement: | import QtQuick3D |
| In C++: | QQuick3DTextureData |
| Inherits: | |
| Inherited By: |
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, establezca la propiedad textureData de Texture para hacer 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 TextureData. Una vez registrada la subclase en QML, los objetos Texture pueden empezar a hacer referencia a ella.
Un ejemplo de cuándo utilizar esta API es cuando se necesita generar procedimentalmente una textura 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.