AbstractTexture QML Type
用于提供纹理的基类。更多内容...
| Import Statement: | import Qt3D.Render 2.12 |
| In C++: | QAbstractTexture |
| Status: | Deprecated |
此类型已弃用。我们强烈建议不要在新代码中使用它。
属性
- ComparisonFunction : ComparisonFunction
- ComparisonMode : ComparisonMode
- depth : int
- format : TextureFormat
- generateMipMaps : bool
- handle : var
- handleType : enumeration
- height : int
- layers : int
- magnificationFilter : Filter
- maximumAnisotropy : bool
- minificationFilter : Filter
- samples : int
- status readonly : Status
- target readonly : Target
- width : int
- wrapMode : QTextureWrapMode
详细说明
不应直接使用 AbstractTexture 类,而应通过其子类之一进行使用。每个子类都实现了特定的纹理目标(2D、2DArray、3D、CubeMap 等)。每个子类为每一层、立方体贴图的每个面以及每个 Mipmap 级别提供了一组函子。 随后,后端会利用这些 functor 将数据正确填充到相应的 OpenGL 纹理中。期望 functor 尽可能减少处理操作,以免降低纹理生成和上传的速度。如果纹理内容是由耗时的程序化生成过程生成的,则建议不要直接在 functor 中实现该过程。
所有纹理都是唯一的。若对同一纹理进行两次实例化,将在 GPU 上生成 2 个完全相同的纹理,且不会发生资源共享。
属性文档
ComparisonFunction : ComparisonFunction
保存纹理提供者的比较函数。
ComparisonMode : ComparisonMode
保存纹理提供程序的比较模式。
depth : int
存储纹理提供程序的深度。
format : TextureFormat
保存纹理提供程序的格式。
generateMipMaps : bool
指定纹理提供程序是否应自动生成MIP贴图。
handle : var [read-only]
保存当前的纹理句柄;如果 `Qt 3D ` 使用 OpenGL 渲染器,则 `handle` 是一个表示纹理 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]
保存纹理提供器的包裹模式。
© 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.