Qt3d Offscreenrenderer

This project is based on the Qt 3D basic shapes C++ example.
Alternatives To Qt3d Offscreenrenderer
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Geometrize1,016
a year ago1otherC++
:white_square_button: Geometrize is a desktop app that geometrizes images into geometric primitives
Phantomstyle192
2 years ago13otherC++
Cross-platform QStyle for traditionalists
Panoramix75
7 years ago5C++
Code of my CVPR'16 paper: "Efficient 3D Room Shape Recovery From a Single Panorama."
Pillow56
7 years agoC++
a 3d modeler
Qt3d Offscreenrenderer38
2 years ago2gpl-3.0C++
This project is based on the Qt 3D basic shapes C++ example.
Qml_customcontrol30
3 years agoC
QtQuick 子控件实现,以及自定义控件实现方法,提供了测试案例。
Qt_painter22
3 months ago56C++
CAD framework tool on top of Qt
Qtasciimage7
8 years ago1mitC++
QtAsciimage - Asciimage for Qt Applications
Raytan7
2 years agoC++
Advanced Raytracer in C++
Extend Mesh4
9 years agoC++
3D shape stretching while preserving surface details
Alternatives To Qt3d Offscreenrenderer
Select To Compare


Alternative Project Comparisons
Readme

Qt3D-OffscreenRenderer


Note: If you want to use the offscreen renderer in your project to embedd Qt3D without having to use Qt3DWindow, checkout my implementation of a Qt3DWidget. It renders everything offline and uses the offscreen texture to paint a quad in a QOpenGLWidget.


This project is based on the Qt 3D basic shapes C++ example (https://doc.qt.io/qt-5.10/qt3d-basicshapes-cpp-example.html).

It renders the whole scene using a QOffscreenSurface offline and displays the image in a QLabel. To get the image to resize adjust the OffscreenEngines rendering size on resize of the widget. I guess the rest should be self-explanatory.

This is supposed to show how to construct an offline framegraph and save everyone who needs such a renderer the hours of trial and error and the despair I encountered.

Qt version

Make sure to use Qt >= 5.9.2 due to a bug in earlier versions: https://bugreports.qt.io/browse/QTBUG-61382

The framegraph

                            root
                             |
                        renderSettings
                             |
                     renderSurfaceSelector
                             |
                      renderTargetSelector
                             |
         ---------------------------------------
         |                   |                 |
    renderTarget        clearBuffers        viewport
         |                                     |
 renderTargetOutput                      cameraSelector
         |
     texture2D

Note

Somehow the first image that is captured is blank and without rendered objects. I suspected the problem to be that the render capture was triggered right after the clear buffers node. But it doesn't seem to have any effect when we place the capture node anywhere else. So basically the first image has to be skipped.

To enable depth tests just add a QRenderStateSet as a child to the camera selector and a QDepthTest as a child to the render state set and add it as a state. Then, in the render target add a texture to the depth attatchment point. This is it.

I experiemented with multisampling, and added a QMultiSampleAntiAliasing render state to the render state set and instead of adding a QTexture2D used a QMultisampleTexture2D but it gave me version errors with OpenGL. If maybe someone gets it running they can fork the project and I can then do a pull.

Disclaimer

Please note that part of the code was written by the Qt Company or KDAB and they hold the respective copyright. For further information read the copyright notice in the source code.

Popular Shape Projects
Popular Qt Projects
Popular Graphics Categories

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
C Plus Plus
3d Graphics
Qt
Shape