[QT Quick 3D] QRchi shaders and QQuick3DRenderExtension
-
Hi everyone.
I'm trying to create a render extension node for View3d, but i cannot find any useful documentation. I saw the OutlineRender example in the QQuick3D examples, but it doesn't use any shaders at all:
https://doc.qt.io/qt-6/qtquick3d-extensions-stenciloutline-example.htmlLater, i found this QRhi example on the Qt documentation, but i couldn't get it to work and it doesn't use QQuick3DRenderExtension
https://doc.qt.io/qt-6/qrhi.htmlWhat I’m trying to do is apply a shader as a post-process to the View3D framebuffer using the extension property list. Could anyone either explain the QRhi example or provide a commented example that goes through each step? I have experience with OpenGL, but I just can’t get this to work. Thanks!!
-
This post is deleted!
-
"Stencil Outline Extension Example" is the main documentation for this at the moment. There will be more API, examples and documentation coming in this area in future releases. The "outline material" is where the shader lives in this example (here it is a built-in PrincipledMaterial).
Note that render extensions are for quite advanced use cases where you want to introduce additional render passes. In this case, for instance, we are introducing an additional color pass which also renders to the stencil buffer.
If you only want to apply a post-processing shader, then there is also built-in support for this, so maybe this is more appropriate: https://doc.qt.io/qt-6/qml-qtquick3d-effect.html