QQuick3DRenderExtension Class

用于实现用户端渲染扩展的抽象类。更多

Header: #include <QQuick3DRenderExtension>
Since: Qt 6.7
In QML: RenderExtension
Inherits: QQuick3DObject

重新实现的公共函数

virtual QSSGRenderGraphObject *updateSpatialNode(QSSGRenderGraphObject *node) override

详细说明

这是呈现扩展的前端。后端在QSSGRenderExtension 中实现。QQuick3DRenderExtension 类用于创建自定义渲染扩展,通过将其添加到可与View3D 一起使用的扩展列表中,可在QtQuick3D 场景图中使用。然后,扩展代码将作为QtQuick3D 渲染流水线执行的一部分运行。

QQuick3DRenderExtension 类是一个抽象类,应被子类化并暴露给 QML。子类应实现QQuick3DRenderExtension::updateSpatialNode() 函数,并返回一个包含应运行代码的QSSGRenderExtension 实例。

另请参阅 QSSGRenderExtension

成员函数文档

[override virtual] QSSGRenderGraphObject *QQuick3DRenderExtension::updateSpatialNode(QSSGRenderGraphObject *node)

QtQuick3D 场景图的同步过程中,当创建项目或请求更新(通常是由于项目属性发生变化)时,会调用该函数。该函数应返回一个QSSGRenderExtension 实例,其中包含在QtQuick3D 的渲染管道执行期间应运行的代码。

注: QSSGRenderExtension 实例是一个资源对象,由QtQuick3D 场景图拥有。如果返回的是另一个实例或空值,先前的实例将被渲染器排队删除。

另请参阅 QSSGRenderExtension

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