Setting gamma correction on crashes everything.
Environment:
- Windows 8.1 32 bit
- 64 bit processor
- JME 3.3.2-stable
- jme sdk 3.2.4-stable-sdk1
- Intel integrated graphics
Error:
An OpenGL error has occurred!
OpenGLException: Invalid enum (1280)
Test code:
(Just a basic application, just make sure to check gamma correction in the display settings)
import com.jme3.app.SimpleApplication;
public class Test extends SimpleApplication {
public static void main( String... args ) {
Test main = new Test();
main.start();
}
@Override
public void simpleInitApp() {
}
}
I’ve been reading up on gamma correction in jme3, and everywhere recommends turning it on and not letting it be turned on (by the user).
Even if this is just my computer (and it’s hardware) causing the issue, what does this mean for the recommendation of always leaving it on?
I mean, I can have it on by default as recommended, and always parse cli to turn it off, but then that leaves some users in a position where they need to do extra steps just to get it to run, and even then, from what I’ve read and seen, it will not look right, and could even be unplayable.
I’ve also seen this thread with the exact same exception, but it seems the cause for that was too big a texture being loaded, but in my case, there are no textures being loaded.
There’s also a few threads saying it may be a graphics driver bug, but I’ve ran other (non jme) games on this same computer without issue.
Setting settings.putBoolean("GraphicsDebug", true)
yields the output:
Jan 22, 2021 1:39:51 AM com.jme3.system.JmeDesktopSystem initialize
INFO: Running on jMonkeyEngine 3.3.2-stable
* Branch: HEAD
* Git Hash: 1a05e3f
* Build Date: 2020-04-27
Jan 22, 2021 1:39:52 AM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: LWJGL 2.9.3 context running on thread jME3 Main
* Graphics Adapter: igdumdim32
* Driver Version: 10.18.10.3643
* Scaling Factor: 1
Jan 22, 2021 1:39:52 AM com.jme3.renderer.opengl.GLRenderer loadCapabilitiesCommon
INFO: OpenGL Renderer Information
* Vendor: Intel
* Renderer: Intel(R) HD Graphics
* OpenGL Version: 4.0.0 - Build 10.18.10.3643
* GLSL Version: 4.00 - Build 10.18.10.3643
* Profile: Compatibility
[JME3] OpenGL debug message
ID: 1280
Source: API
Type: ERROR
Severity: HIGH
Message: GL error GL_INVALID_ENUM
java.lang.Exception: Stack trace
at java.lang.Thread.dumpStack(Thread.java:1336)
at com.jme3.system.lwjgl.LwjglGLDebugOutputHandler.handleMessage(LwjglGLDebugOutputHandler.java:76)
at org.lwjgl.opengl.GL11.nglGetBooleanv(Native Method)
at org.lwjgl.opengl.GL11.glGetBoolean(GL11.java:1321)
at com.jme3.renderer.lwjgl.LwjglGL.glGetBoolean(LwjglGL.java:235)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.jme3.renderer.opengl.GLDebug.invoke(GLDebug.java:107)
at com.sun.proxy.$Proxy0.glGetBoolean(Unknown Source)
at com.jme3.renderer.opengl.GLRenderer.getBoolean(GLRenderer.java:602)
at com.jme3.renderer.opengl.GLRenderer.setMainFrameBufferSrgb(GLRenderer.java:3184)
at com.jme3.system.lwjgl.LwjglContext.initContextFirstTime(LwjglContext.java:291)
at com.jme3.system.lwjgl.LwjglContext.internalCreate(LwjglContext.java:424)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:117)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:213)
at java.lang.Thread.run(Thread.java:748)
Jan 22, 2021 1:39:52 AM com.jme3.app.LegacyApplication handleError
SEVERE: Failed to create display
com.jme3.renderer.RendererException: An OpenGL error occurred - Invalid enum argument (Error Code: 1280)
at com.jme3.renderer.opengl.GLDebug.checkError(GLDebug.java:101)
at com.jme3.renderer.opengl.GLDebug.invoke(GLDebug.java:113)
at com.sun.proxy.$Proxy0.glGetBoolean(Unknown Source)
at com.jme3.renderer.opengl.GLRenderer.getBoolean(GLRenderer.java:602)
at com.jme3.renderer.opengl.GLRenderer.setMainFrameBufferSrgb(GLRenderer.java:3184)
at com.jme3.system.lwjgl.LwjglContext.initContextFirstTime(LwjglContext.java:291)
at com.jme3.system.lwjgl.LwjglContext.internalCreate(LwjglContext.java:424)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:117)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:213)
at java.lang.Thread.run(Thread.java:748)
Jan 22, 2021 1:39:52 AM com.jme3.app.LegacyApplication handleError
SEVERE: Uncaught exception thrown in Thread[jME3 Main,5,main]
java.lang.IllegalMonitorStateException
at java.lang.Object.notifyAll(Native Method)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:128)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:213)
at java.lang.Thread.run(Thread.java:748)
Exception: java.lang.reflect.UndeclaredThrowableException thrown from the UncaughtExceptionHandler in thread "jME3 Main"
This output says SEVERE: Failed to create display
, which is a little confusing since the window does show up for a second, and even in my game, the full menu, with the scene and UI, loads and displays, right before the crash.
Does anyone know what’s going on here?
All help greatly appreciated!