I want to be able to render complex 2D and 3D images using hardware acceleration on a server with no user context or logged in user. The best thing I could do so far is Mesa3D, but because it is pure software 3D rendering it is slow and does not take advantage of the video hardware acceleration. Could be Windows or Linux. Most of my work I have done so far in Windows.
Any suggestions on how to do this with OpenGL or DirectX?
For Linux, EGL +
MESA_platform_gbm
should let you get a completely headless/X11-less OpenGL context.The spec helpfully includes an example program demoing usage:
You can use
eglBindAPI( EGL_OPENGL_API )
to use OpenGL instead of OpenGL ES.For Windows, you can use Direct3D 11 "headless" (i.e. without an output window/swap chain and running in session 0) with a hardware device on Windows 8 / Server 2012 or later. Prior to that, people had some luck using WARP (a software renderer) and/or the NULL device.
See Direct3D 11.1 Features