Qt3DRender::QRenderTarget Class

class Qt3DRender::QRenderTarget

QRenderTarget 类封装了一个目标(通常是一个帧缓冲区对象),渲染器可将其渲染到该目标中。更多

头文件: #include <QRenderTarget>
CMake.QRenderTarget find_package(Qt6 REQUIRED COMPONENTS 3drender)
target_link_libraries(mytarget PRIVATE Qt6::3drender)
qmake: QT += 3drender
在 QML 中: RenderTarget
继承: Qt3DCore::QComponent
状态:已废弃

公共函数

QRenderTarget(Qt3DCore::QNode *parent = nullptr)
void addOutput(Qt3DRender::QRenderTargetOutput *output)
QList<Qt3DRender::QRenderTargetOutput *> outputs() const
void removeOutput(Qt3DRender::QRenderTargetOutput *output)

详细说明

Qt3DRender::QRenderTargetQt3DRender::QRenderTargetOutput 对象组成,这些对象指定了渲染目标渲染到的缓冲区。用户可以通过将多个纹理附加到不同的附加点来指定 MRT(多个渲染目标)。如果用户尝试将多个纹理附着到同一个附着点上,结果将是不确定的。在渲染时,只会使用Qt3DRender::QRenderTargetSelector 中指定的绘制缓冲区。

成员函数文档

[explicit] QRenderTarget::QRenderTarget(Qt3DCore::QNode *parent = nullptr)

构造函数使用指定的parent 创建一个新的QRenderTarget::QRenderTarget 实例。

void QRenderTarget::addOutput(Qt3DRender::QRenderTargetOutput *output)

通过output 添加所选输出。

QList<Qt3DRender::QRenderTargetOutput *> QRenderTarget::outputs() const

返回选择的输出。

void QRenderTarget::removeOutput(Qt3DRender::QRenderTargetOutput *output)

通过output 删除所选输出。

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