Pygmy's picture

Offscreen rendering & output on multiple monitors.

I want to render (realtime) to a big offscreen texture, and display parts of that texture in different windows / on different monitors, while controlling parameters from a UI.

My idea :
- Main thread runs the Windows UI,
- spawns a Render-thread that renders stuff to the offscreen texture in the background,
- and creates a couple of output windows, windowed or optionally full-screen, on different monitors.
but how do I handle the "output parts of the rendered texture to multiple monitors" part ?

Each of the output-windows would get it's own render-thread I assume,
and in that I'd bind the offscreen rendered texture to render a quad in the window.

Can anyone help me a bit more on how to make this all work ?
I need to share contexts I think ?
How do I sync the output-window display with the background-render thread ?
General advice ? :)

Cheers !


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

OpenTK always tries to share contexts, unless you set GraphicsContext.ShareContexts = false. Check the GraphicsContext documentation.

You can use GL_ARB_sync to sync the offscreen render thread with the output windows.

General advice:

  • Avoid mixing UI toolkits (e.g. WinForms for the main UI and GameWindow for the output windows).
  • Intel drivers do not support context sharing.
  • Context sharing may fail unless you make existing contexts non-current first (context.MakeCurrent(null)).
renanyoy's picture

and now how can do it, as all gfx cards accept context sharing ??

I need to a background rendering thread to do big jobs and to keep the main thread (UI in GL) at max fps, and smooth for the user.