4 ms·
That sounds interesting. I've cloned score and libossia, but I haven't found that code yet. Could you point me at it?
by boudewijnrempt 6y ago
That sounds interesting. I've cloned score and libossia, but I haven't found that code yet. Could you point me at it?
- jcelerier 6y ago95% of the RHI code is in there: https://github.com/OSSIA/score/tree/master/src/plugins/score-addon-gfx/Gfx/Graph https://github.com/OSSIA/score/tree/master/src/plugins/score... - Window: https://github.com/OSSIA/score/blob/master/src/plugins/score-addon-gfx/Gfx/Graph/window.hpp https://github.com/OSSIA/score/blob/master/src/plugins/score... - Renderer: https://github.com/OSSIA/score/blob/master/src/plugins/score-addon-gfx/Gfx/Graph/renderer.cpp https://github.com/OSSIA/score/blob/master/src/plugins/score... - Example of a very simple node which renders a texture generated by a std::function: https://github.com/OSSIA/score/blob/master/src/plugins/score-addon-gfx/Gfx/Graph/texgennode.hpp https://github.com/OSSIA/score/blob/master/src/plugins/score... It was mostly written at my Ballmer peak during last year's christmas / new year's eve though :-) so lacks code quality a fair bit. There's a graph of nodes. The graph is walked from every output node (screen surfaces) to create a matching "rendered node" (pretty much a render pass). For every node "model", a node "renderer" will be created, which contains uniforms, GPU buffer (QRhiBuffer) & texture (QRhiTexture) handles, etc. and a QRhiGraphicsPipeline (the state in which the GPU must be to render a node, the VAOs, shader programs, layout, culling, blending, etc etc) Then every time the output node renders due to vsync or whatever, the associated chain of node (render passes) is executed in order. I recommend looking at the RHI manual tests in the qt source, they show the usage in a very straightforward manner: https://code.qt.io/cgit/qt/qtbase.git/tree/tests/manual/rhi?h=v5.15.0 https://code.qt.io/cgit/qt/qtbase.git/tree/tests/manual/rhi?... In particular, I started with this one : https://code.qt.io/cgit/qt/qtbase.git/tree/tests/manual/rhi/triquadcube/trianglerenderer.cpp?h=v5.15.0 https://code.qt.io/cgit/qt/qtbase.git/tree/tests/manual/rhi/...
- boudewijnrempt 6y agoThanks! Now I've got a place to start at least!