本页内容

SimpleQuadRenderer QML Type

将一个带纹理的全屏四边形渲染到主渲染目标上。更多...

Import Statement: import QtQuick3D.Helpers
Since: Qt 6.11
Inherits:

RenderExtension

属性

详细描述

SimpleQuadRenderer 是一个RenderExtension ,它会将一个Texture 复制到整个屏幕上。它在Main 渲染模式下的PostColor 阶段运行,这意味着它会在场景绘制完成后、任何后处理效果应用之前执行,并直接写入View3D 的主渲染目标,覆盖场景绘制的任何内容。

最常见的用法是构建一个完全自定义的渲染管线:将View3D.renderFormat 设置为禁用Qt Quick 3D 的内置渲染通道(使用View3D.DisableInternalPasses ),将场景内容渲染到一个或多个RenderPass 目标中,然后使用SimpleQuadRenderer将结果合成回屏幕上。

注意:SimpleQuadRenderer 会自动作为扩展注册到场景中——无需手动将其添加到View3D.extensions 中。

import QtQuick3D
import QtQuick3D.Helpers

View3D {
    // Disable the built-in render passes so we can provide our own output
    renderFormat: View3D.DisableInternalPasses

    // A custom offscreen pass that renders scene content
    RenderPass {
        id: mainColorPass
        commands: [
            RenderablesFilter { renderableTypes: RenderablesFilter.Opaque | RenderablesFilter.Transparent }
        ]
    }

    // Blit the result of the custom pass to the screen
    SimpleQuadRenderer {
        texture: Texture {
            textureProvider: RenderOutputProvider {
                renderPass: mainColorPass
            }
        }
    }
}

另请参阅 RenderOutputProvider 、RenderPass 和View3D 。

属性文档

texture : Texture

要在全屏四边形上渲染的纹理。它可以是任何Texture ,包括那些将textureProvider 设置为RenderOutputProvider 的纹理,以便显示来自RenderPass 或Qt Quick 3D 中某个内置通道(例如深度纹理或AO纹理)的输出。

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