I'm currently writing a game in C++/Qt5 using the Qt3D module.
I can render the scene (QGLSceneNodes) on a QGLView but am now stuck on overpainting the scene with some GUI elements. I haven't decided yet whether to use QML or C++ to define the look and feel of the interface, so I'm open to solutions for both. (Note that the QML module is called QtQuick3D, the C++ module is called Qt3D and they are both part of Qt5.)
I'm very much preferring a QML based solution.
How can I do some overpainting?
The following things have to be possible:
- Draw 2D items (images) at given screen coordinates, of course with support for alpha channels.
- Draw text using system fonts, maybe by first painting on a image and using this as a texture in the Qt3D OpenGL context.
- Reacting on mouse input in screen coordinates (in contrast to 3D scene object picking).
I think this is all possible using just another QGLSceneNode for the 2D GUI part. But I think positioning and orienting some scene node in order to just be re-oriented and re-positioned during rendering (using the vertex shader) doesn't make sense, introduces numerical errors and seems inefficient.
Is using another "GUI" vertex shader the correct way?
(How) can I make post-rendering effects and overpainting work together?
It would be really nice if I can do the following post-rendering effects:
- Read the previously rendered scene, apply some 2D image effects (I can imagine to implement those as a fragment shader and render the previously rendered buffer on the final screen using this effect shader). This enables me to make some parts of the GUI look like glass with a blur effect.
- Some more advanced effects could make the scene look more realistic: depth & motion blur, heat dependent air flickering, glow effects. They can all be described us