Offscreen rendering for server application

I'm interested in developing an app which runs on a headless server as a background service. This app would render images off screen, grab the pixel data, and send it to clients. It is important that it use hardware acceleration yet still operate purely in memory. I'm not sure how to make this sort of setup happen though. Any advice is highly appreciated. Thanks Smiling

The most obvious way would

The most obvious way would be to render to a fbo on the graphics hardware and retrieve the fbo content afterwards. This will however result in quite some data transfer, so don't expect performance to equal rendering directly to the screen.

Thank you. Before creating

Thank you. Before creating the FrameBuffer you must create a rendering context and to do that you must have a device context. I'm confused as how to get those contexts when there's no window, desktop, or GUI at all.

Is this Windows Server 2008?

Is this Windows Server 2008? (just curious)

Is there a video adapter? If yes, and assuming you can create a window handle, it should be possible.

If you cannot (CreateWindow fails, and there is no desktop window to hijack either), it might not be possible. Worth checking out if CUDA works in this case.

------
OpenTK

The development machine is

The development machine is Vista Ultimate SP1 but the server may end up being 2008. Most likely it'll be 2005. In either case there will be a capable video card. The complication is that it will run in an environment where no windows can be created and a desktop does not exist. I'll check out CUDA. Thanks. I'm also looking into PFD_DRAW_TO_BITMAP, but it doesn't look promising. I also heard that SDL 1.3 adds off screen rendering. This is going to take some research.

I have zero experience with

I have zero experience with Windows Server versions, but on XP even the LocalSystem user has a (invisible) desktop. I presume that's the same on servers (maybe except for 2008). You tried if GetDC(null) (User.GetDC(IntPtr.Zero) with Tao) gives a valid DC? it should give you the default device context for the desktop.

That's why I was asking

That's why I was asking which Windows version this is. Versions prior to Server 2008 always have a desktop window, which you can use for OpenGL.

Windows Server 2008 is the first version that can run headless. I don't know if this precludes the creation of windows, but if it does (and it's likely), you won't be able to use hardware accelerated OpenGL at all (you might be able to use Mesa with a memory buffer, but that's counterproductive).

------
OpenTK

Theme by La Boite a site | Powered by Drupal