Offscreen & MesaGL for Windows

I’m developing a server application which uses OpenGL to render 3D scenes. Therefore I need the offscreen features of jogl. My application is working fine on windows using a recent NVidia card & driver. However, when I’m trying to use an old nvidia driver (12.xx) or MesaGL for Windows, I’m keep getting the following exception

net.java.games.jogl.GLException: Method “wglChoosePixelFormatARB” not available
at net.java.games.jogl.impl.windows.WindowsGLImpl.wglChoosePixelFormatARB(WindowsGLImpl.java:22201)
at net.java.games.jogl.impl.windows.WindowsPbufferGLContext.createPbuffer(WindowsPbufferGLContext.java:207)
at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.makeCurrent(WindowsOnscreenGLContext.java:116)
at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:162)
at net.java.games.jogl.GLCanvas.displayImpl(GLCanvas.java:182)
at net.java.games.jogl.GLCanvas.display(GLCanvas.java:82)

when creating the offscreen renderer.
It seems that wglChoosePixelFormatARB is not implemented in all OpenGL drivers/implementations for windows.

Is it possible to get around this requirement somehow (maybe replace wglChoosePixelFormatARB with wglChoosePixelFormat?). Or was someone able to get the osmesa functions to work with jogl, which would be the best solution for me since I could then have a “pure” offscreen rendering?
I need the Mesa support to have a grapics driver independent solution since most server machines only have limited or no 3D hardware.

Andreas

I think the ARB version is needed for pbuffers.

  • elias

Mesa can run in Linux without a 3d card using pure software rendering if that’s any help (and they fully support OpenGL1.4 and tonnes of extentions) :slight_smile: perhaps it can in Windows too?

Will.

Yes, Mesa works fine on Windows running in a pure Software mode (exactly what I need), however, it only works when I do onscreen rendering. The problem is that jogl requires the wglChoosePixelFormatARB function for offscreen setup which doesn’t seem to be implemented in Mesa and I don’t know what it is used for.
Isn’t it possible to use the normal WGL offscreen support when pbuffers aren’t available in the Windows Implementation of jogl? (see http://www.mesa3d.org/brianp/sig97/offscrn.htm). Or can I somehow integrate the osmesa interface in jogl for Windows (or any other jogl implementation)?

I really need offscreen support that works on any configuration running jogl so I would be thankfull for any advice how to achieve this.

Andreas

The GLJPanel currently uses only software-accelerated rendering support on Windows (Device Independent Bitmaps) and X11 (Pixmaps). If you look inside the GLJPanel’s implementation you can see the construction of the offscreen context. You should probably be able to modify that code to do what you want, which would be to not display the results in a JPanel but do something different with the rendered bits. The caveat is that you’ll be using non-public APIs in JOGL which aren’t guaranteed to remain unchanged from release to release.

I took a closer look on the GLJPanel and it’s implementation as Ken suggested, but somehow I didn’t get it to work on my machines (running Windows 2000 and XP, latest NVIDIA drivers). The JGears demo isn’t working either, it always throws the exception

Exception in thread “main” net.java.games.jogl.GLException: Unable to set pixel format
at net.java.games.jogl.impl.windows.WindowsGLContext.choosePixelFormatAndCreateContext(WindowsGLContext.java:306)
at net.java.games.jogl.impl.windows.WindowsOffscreenGLContext.create(WindowsOffscreenGLContext.java:168)
at net.java.games.jogl.impl.windows.WindowsGLContext.makeCurrent(WindowsGLContext.java:129)
at net.java.games.jogl.impl.windows.WindowsOffscreenGLContext.makeCurrent(WindowsOffscreenGLContext.java:128)
at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:199)
at net.java.games.jogl.GLJPanel.reshape(GLJPanel.java:131)
at java.awt.Component.setBounds(Component.java:1664)
at java.awt.BorderLayout.layoutContainer(BorderLayout.java:691)
at java.awt.Container.layout(Container.java:1020)
at java.awt.Container.doLayout(Container.java:1010)
at java.awt.Container.validateTree(Container.java:1092)
at java.awt.Container.validate(Container.java:1067)
at java.awt.Window.show(Window.java:461)
at demos.jgears.JGears.main(JGears.java:35)

I tried the latest jogl build and the september 5th build, both versions don’t work. What’s wrong with the GLJPanel implementation for Windows?

Andreas