SubRenderPass QML Type
Renderizza una sottosezione del lavoro all'interno dello stesso target di rendering del RenderPass genitore. Altro...
| Import Statement: | import QtQuick3D |
| Since: | Qt 6.11 |
| Inherits: |
Proprietà
- renderPass : RenderPass
Descrizione dettagliata
SubRenderPass è un " Command " che suddivide un " RenderPass " in parti più piccole, configurate in modo indipendente, pur condividendo lo stesso "render target". Solo il " RenderPass " padre controlla in quali texture viene eseguito il rendering (tramite " ColorAttachment " e " DepthTextureAttachment") e quando inizia il passaggio (e quindi quando viene azzerato il "render target"). Un SubRenderPass non può impostare il proprio render target né le impostazioni di cancellazione: queste vengono sempre ereditate dal pass padre.
Ciò che un SubRenderPass può controllare è cosa viene renderizzato e in che modo: dispone di una propria " commands", quindi può utilizzare un " RenderablesFilter " per selezionare un sottoinsieme di oggetti, un " PipelineStateOverride " per modificare lo stato di profondità/fusione, un " materialMode" diverso e così via.
Un utilizzo tipico è una pipeline di rendering in avanti in cui un singolo passaggio di colore utilizza SubRenderPass separati per lo sfondo, gli oggetti opachi e gli oggetti trasparenti. Tutti e tre i sottopassaggi scrivono nelle stesse texture di colore e profondità, ma ciascuno ha uno stato della pipeline diverso:
RenderPass {
id: mainColorPass
commands: [
// Render targets are set at the parent RenderPass level only
ColorAttachment { name: "color0"; target: colorTexture },
DepthTextureAttachment { target: depthTexture },
// Sub-pass 1: render the skybox background
SubRenderPass { renderPass: skyboxSubPass },
// Sub-pass 2: opaque objects with depth testing and writing
SubRenderPass { renderPass: opaqueSubPass },
// Sub-pass 3: transparent objects with blending, no depth write
SubRenderPass { renderPass: transparentSubPass }
]
}
// Sub-passes share mainColorPass's render target
RenderPass {
id: skyboxSubPass
passMode: RenderPass.SkyboxPass
}
RenderPass {
id: opaqueSubPass
commands: [
RenderablesFilter { renderableTypes: RenderablesFilter.Opaque }
]
}
RenderPass {
id: transparentSubPass
commands: [
RenderablesFilter { renderableTypes: RenderablesFilter.Transparent },
PipelineStateOverride {
blendEnabled: true
depthWriteEnabled: false
}
]
}Vedi anche RenderPass, RenderablesFilter e PipelineStateOverride.
Documentazione delle proprietà
renderPass : RenderPass
L'RenderPass, che verrà eseguito come sotto-passaggio al momento dell'elaborazione di questo comando.
© 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.