NoDraw QML Type
当 FrameGraph 分支中存在 NoDraw 节点时,这会阻止渲染器渲染任何基元。更多...
| Import Statement: | import Qt3D.Render 2.12 |
| In C++: | QNoDraw |
| Inherits: | |
| Status: | Deprecated |
此类型已弃用。我们强烈建议不要在新代码中使用它。
详细说明
当FrameGraph需要设置某些渲染状态或清除某些缓冲区,且无需渲染任何网格时,应使用NoDraw。其效果等同于使用一个与场景中所有可用Qt3DRender::QRenderPass 实例均不匹配的Qt3DRender::QRenderPassFilter ,同时避免了实际执行过滤操作带来的开销。
当禁用时,NoDraw节点不会阻止场景的渲染。因此,切换enabled属性是使NoDraw节点生效或失效的一种方式。
NoDraw通常作为ClearBuffers 节点的子节点使用,以在存在多个渲染通道时阻止场景的渲染。
Viewport {
CameraSelector {
ClearBuffers {
buffers: ClearBuffers.ColorDepthBuffer
NoDraw { } // Prevents from drawing anything
}
RenderPassFilter {
...
}
RenderPassFilter {
...
}
}
}© 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.