Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

95% of the RHI code is in there: https://github.com/OSSIA/score/tree/master/src/plugins/score...

- Window: https://github.com/OSSIA/score/blob/master/src/plugins/score...

- Renderer: 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...

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?...

In particular, I started with this one : https://code.qt.io/cgit/qt/qtbase.git/tree/tests/manual/rhi/...



Thanks! Now I've got a place to start at least!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: