OoliteProject / oolite

The main Oolite repository.
https://www.oolite.space
553 stars 70 forks source link

Minimum OpenGL version requirement should be 1.4 #156

Open AnotherCommander opened 9 years ago

AnotherCommander commented 9 years ago

I recently tried to test Oolite on a Windows XP Virtual Machine which reported S3 Trio as the graphics chip (integrated Virtual PC component), running OpenGL v1.1. in software emulation. I wasn't expecting anything in terms of performance of course, just wanted to verify that the game was launching correctly. And it didn't. This is what I got at the end of the log:

11:23:21.910 [rendering.opengl.badExtension]: ***** An uninitialized OpenGL extension function has
been called, terminating. This is a serious error, please report it. *****

The problem is that Oolite tried to use an OpenGL extension that was not provided by the driver. A quick investigation in the extensions that we use shows that there is at least one extension (glUniformMatrix3fvARB and almost certainly others too), which belongs to the ARB_shader_objects extension, which according to https://www.opengl.org/registry/specs/ARB/shader_objects.txt, is written against the 1.4 specification.

OOOpenGLManager.m specifies 1.1 as the minimum version for OpenGL and at this moment this is not correct. The game's startup should halt before getting to the point of calling a non-existent extension. I believe the minimum requirement should be raised to 1.4.

kanthoney commented 9 years ago

Doesn't the extension manager check for ARB_shader_objects and disable shaders if it's not there? Is that one of the cards alluded to in checkShadersSupported that claims to support shaders when it doesn't?

AnotherCommander commented 9 years ago

You are most likely right. I'll have to check tomorrow what happens if I launch the game with -noshaders. If it runs, then we can close this.

AnotherCommander commented 9 years ago

It turns out that I had already tried the -noshaders option and the error is always the same. Here is the full log from the run that initiated this report. The command line options used were -noshaders -nosplash:

Opening log for Oolite version 1.82 (x86-32 test release) under Windows 5.1.2600 Service Pack 3 32-bit at 2015-06-25 11:23:20 +0100.
1 processor detected.
Build options: OpenAL, new planets, JavaScript console support, OXP verifier, localization tools, debug GraphViz support, JavaScript profiling.

Note that the contents of the log file can be adjusted by editing logcontrol.plist.

11:23:20.678 [display.mode.list.native]: Windows native resolution detected: 1360 x 988
11:23:20.708 [gamma.set.failed]: ----- WARNING: Could not set gamma: 
11:23:20.708 [joystick.init]: Number of joysticks detected: 0
11:23:20.708 [rendering.opengl.version]: OpenGL renderer version: 1.1.0 ("1.1.0"). Vendor: "Microsoft Corporation". Renderer: "GDI Generic".
11:23:20.708 [rendering.opengl.extensions]: OpenGL extensions (3):
GL_EXT_paletted_texture, GL_EXT_bgra, GL_WIN_swap_hint
11:23:20.718 [rendering.opengl.shader.support]: Shaders will not be used (disabled on command line).
11:23:20.748 [searchPaths.dumpAll]: Resource paths: 
    Resources
    D:\Documents and Settings/barknikk/Desktop/OoliteTrunk32.app/GNUstep/Library/ApplicationSupport/Oolite/ManagedAddOns
    D:\Documents and Settings/barknikk/Desktop/OoliteTrunk32.app/GNUstep/Library/ApplicationSupport/Oolite/ManagedAddOns/oolite.oxp.cim.camera-drones.oxz
11:23:20.928 [shipData.load.begin]: Loading ship data.
11:23:21.759 [startup.complete]: ========== Loading complete in 1.11 seconds. ==========
11:23:21.910 [rendering.opengl.state]: Incorrect OpenGL state in -[Universe drawUniverse] (line 4389)->OOSetOpenGLState
11:23:21.910 [rendering.opengl.state]: Expected previous state: <canonical initial state>
  11:23:21.910 [rendering.opengl.state]: GL_ACTIVE_TEXTURE should be ENABLED but is ENABLED.
  11:23:21.910 [rendering.opengl.state]: GL_CLIENT_ACTIVE_TEXTURE should be ENABLED but is ENABLED.
11:23:21.910 [rendering.opengl.badExtension]: ***** An uninitialized OpenGL extension function has been called, terminating. This is a serious error, please report it. *****

Closing log at 2015-06-25 11:23:21 +0100.

If I run the game without any options in the command line, the log is this:

Opening log for Oolite version 1.82 (x86-32 test release) under Windows 5.1.2600 Service Pack 3 32-bit at 2015-07-15 08:42:32 +0100.
1 processor detected.
Build options: OpenAL, new planets, JavaScript console support, OXP verifier, localization tools, debug GraphViz support, JavaScript profiling.

Note that the contents of the log file can be adjusted by editing logcontrol.plist.

08:42:47.426 [display.mode.list.native]: Windows native resolution detected: 1360 x 988
08:42:51.051 [rendering.opengl.state]: Incorrect OpenGL state in -[MyOpenGLView initSplashScreen] (line 689)->OOSetOpenGLState
08:42:51.051 [rendering.opengl.state]: Expected previous state: <canonical initial state>
  08:42:51.051 [rendering.opengl.state]: GL_ACTIVE_TEXTURE should be ENABLED but is ENABLED.
  08:42:51.051 [rendering.opengl.state]: GL_CLIENT_ACTIVE_TEXTURE should be ENABLED but is ENABLED.
08:42:51.051 [rendering.opengl.badExtension]: ***** An uninitialized OpenGL extension function has been called, terminating. This is a serious error, please report it. *****

Closing log at 2015-07-15 08:42:51 +0100.

I think we may have a rogue call to a non 1.1 OpenGL function somewhere. I would try to look first at any functions inserted in the OOOpenGLManager.m between 1.80 and 1.82.

kanthoney commented 9 years ago

Can you run it under gdb, setting a breakpoint for the OOBadOpenGLExtensionUsed function and getting a backtrace?

AnotherCommander commented 9 years ago

Unfortunately that will not be possible under a virtual machine, which is the only computer I have available that is low-spec enough to trigger the problem.