DepthStencilAttachment QML Type
Defines a depth-stencil attachment for a RenderPass. More...
| Import Statement: | import QtQuick3D |
| Since: | Qt 6.11 |
| Inherits: |
Detailed Description
DepthStencilAttachment adds an implicit depth/stencil render buffer to a RenderPass. The render buffer is automatically created and managed by the rendering system. Because it is backed by an opaque render buffer rather than a texture, its contents cannot be sampled in shaders. If you need to read back depth values in a later pass, use DepthTextureAttachment instead.
Use DepthStencilAttachment when you need depth testing and/or stencil operations in a pass but do not need to access the depth data afterwards.
RenderPass { commands: [ ColorAttachment { name: "color0"; target: colorTexture }, // Add a depth buffer so depth testing works in this pass DepthStencilAttachment {} ] }
See also DepthTextureAttachment and RenderPassTexture.
© 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.