Hi, I am trying to implement a rendering where the output is cached and rendered in the main window as quad. Consider following "simple" setup:
The app has 2 windows - left window renders Nodes in RQ 50 and right window renders Nodes in RQ 51. On top of that there is another scene pass which renders a mouse cursor. Normally the rendering should be just with 2 quads in both windows using a cached output of the rendering and only mouse cursor is rendered there (as it moves frequently). Until there is no change in nodes in RQ 50 and 51, the cached texture is not needed to be updated. When I trigger a redraw in Ogre, then it should check whether there is a change in nodes of RQ 50 - if yes, re-render the scene, update the cached texture, do the same with RQ 51.
I would like to reuse the same texture for the rendering of the cached content. My problem is, that e.g. according to this post the compositors are immutable. This means that I need to hard-code the RQs and cannot change the definition afterwards.
I would like to have a system of compositors like this:
- compositor A to update the cached output - reused by all the windows in the app (internal textures are resized to the biggest window in the app)
- compositor B for left window with 1 local texture (cache)
- compositor C for right window with 1 local texture (cache)
- When left window is about to be updated through compositor B, I have to check whether the cache texture is valid - if not, setup compositor A for rendering (resize textures, setup RQ ids, etc.), render it, copy result to the B's cache and then continue with rendering compositor B
- Do the same for right window
How can I achieve this? I am struggling with all the options - whether I should create a single huuuuge CompositorWorkspaceDef and then in the instance CompositorWorkspace enable/disable the nodes, or should I separate it to multiple instances of CompositorWorkspaceDef? What about the dynamic part of the setup when I need to update the definitions?