AbstractTexture QML Type

用于提供纹理的基类。更多

Import Statement: import Qt3D.Render 2.9
In C++: QAbstractTexture
Status: Deprecated

属性

详细说明

AbstractTexture 类不应直接使用,而应通过其子类来使用。每个子类实现一个给定的纹理目标(2D、2DArray、3D、CubeMap......)。每个子类为每个层、立方体贴图面和 mipmap 层提供一组函数。反过来,后端使用这些函数将数据正确填充到相应的 OpenGL 纹理中。为了不减慢纹理生成和上传的速度,我们希望函数能尽可能少地进行处理。如果纹理的内容是缓慢的程序生成过程的结果,建议不要直接在函数中实现。

所有纹理都是唯一的。如果两次实例化相同的纹理,将在 GPU 上创建两个完全相同的纹理,不会发生共享。

属性文档

ComparisonFunction : ComparisonFunction

纹理提供者的比较函数。


ComparisonMode : ComparisonMode

纹理提供程序的比较模式。


depth : int

纹理提供程序的深度。


format : TextureFormat

纹理提供程序的格式。


generateMipMaps : bool

显示纹理提供程序是否应自动生成 mipmaps。


handle : var [read-only]

保存当前纹理句柄,如果Qt 3D 使用的是 OpenGL 渲染器,句柄就是纹理 ID 整数。


handleType : enumeration [read-only]

当前纹理句柄类型。

常量
AbstractTexture.NoHandle
AbstractTexture.OpenGLTextureId

height : int

纹理提供者的高度。


layers : int

保持纹理提供程序的最大层数。默认情况下,最大层数为 1。

注意: 这只对具有 3D 或数组目标格式的纹理提供程序有意义。


magnificationFilter : Filter

纹理提供程序的放大过滤器。


maximumAnisotropy : bool

保持纹理提供程序的最大各向异性。


minificationFilter : Filter

纹理提供程序的最小化过滤器。


samples : int

纹理提供程序每个像素的样本数。默认情况下,样本数为 1。

注意: 这只对具有多采样格式的纹理提供程序有意义。


status readonly : Status

纹理提供程序的当前状态。


target readonly : Target

纹理提供程序的目标格式。

注意: 目标格式只能设置一次。


width : int

纹理提供程序的宽度。


wrapMode : QTextureWrapMode [read-only]

纹理提供程序的换行模式。


© 2025 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.