本页内容

SortPolicy QML Type

用于存储待使用的排序类型。更多...

Import Statement: import Qt3D.Render 2.12
In C++: QSortPolicy
Inherits:

FrameGraphNode

Status: Deprecated

此类型已弃用。我们强烈建议不要在新代码中使用它。

属性

详细说明

SortPolicy 类用于存储 FrameGraph 所使用的排序类型。排序类型决定了可绘制实体在绘制前如何进行排序,从而确定绘制顺序。当 FrameGraph 中存在 SortPolicy 时,排序机制由sortTypes 列表决定。 可以同时使用多种排序类型。如果 FrameGraph 中不存在 SortPolicy,则实体将按照其在实体层次结构中出现的顺序进行绘制。

属性文档

sortTypes : list<int>

指定要使用的排序类型。

此列表可包含以下值:

  • StateChangeCost - 按能将当前渲染状态切换至新状态的成本最小化的方式对对象进行排序
  • BackToFront - 根据反转的 z 顺序将对象从后到前排序。更准确地说,排序键是相机到对象中心向量在相机视向量上的投影的 z 分量。
  • Material - 根据对象的材质(着色器)值进行排序。
  • FrontToBack - 将对象从前到后排序。与 BackToFront 相反。
  • [自 5.14 起] 纹理 - 对对象进行排序,以尽量减少纹理变化。
  • [自 5.15 起] 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.