Experimenting LWJGL3


#1

Hi

Some testing result with lwjgl3 :
Lenovo laptop
Ubuntu 16.10
Intel HD 3000 and AMD HD 6370m switchable graphic.

1 -Running on Intel graphic it runs fine but on AMD graphic card screen goes black.

2- Testing on sim-eth-es example first time it runs fine but next times it fails (when switch to full screen or turn off Vsync or change screen resolution) :

 Executing: gradle :run
Arguments: [-PmainClass=example.Main, -PcmdLineArgs=, -c, /media/idea/01D0ABF282E1DD20/Java/jME_NB-PW-11-6-2015/Examples/sim-eth-es/settings.gradle]

:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:assets:compileJava UP-TO-DATE
:assets:processResources UP-TO-DATE
:assets:classes UP-TO-DATE
:assets:jar UP-TO-DATE
:run
SimEthereal Example 2
Setting root JUL log level to:INFO
logger config:root
Setting JUL Log: level to:INFO
logger config:com.simsilica.sim
Setting JUL Log:com.simsilica.sim level to:FINER
logger config:example
Setting JUL Log:example level to:FINE
19:06:52,922 INFO  [JmeSystem] Running on jMonkeyEngine 3.2-1
 * Branch: master
 * Git Hash: cd70630
 * Build Date: 2016-10-04
19:06:53,316 INFO  [LwjglContext] LWJGL 3.0.0 build 90 context running on thread main
 * Graphics Adapter: GLFW 3.2.0 X11 GLX EGL clock_gettime /dev/js Xf86vm shared
19:06:53,614 INFO  [GLRenderer] OpenGL Renderer Information
 * Vendor: Intel Open Source Technology Center
 * Renderer: Mesa DRI Intel(R) Sandybridge Mobile 
 * OpenGL Version: 3.0 Mesa 11.2.0
 * GLSL Version: 1.30
 * Profile: Compatibility
19:06:53,670 WARN  [AssetConfig] Cannot find loader com.jme3.scene.plugins.ogre.MeshLoader
19:06:53,672 WARN  [AssetConfig] Cannot find loader com.jme3.scene.plugins.ogre.SkeletonLoader
19:06:53,673 WARN  [AssetConfig] Cannot find loader com.jme3.scene.plugins.ogre.MaterialLoader
19:06:53,674 WARN  [AssetConfig] Cannot find loader com.jme3.scene.plugins.ogre.SceneLoader
19:06:53,675 WARN  [AssetConfig] Cannot find loader com.jme3.scene.plugins.blender.BlenderModelLoader
19:06:53,679 WARN  [AssetConfig] Cannot find loader com.jme3.scene.plugins.fbx.FbxLoader
19:06:53,686 WARN  [AssetConfig] Cannot find loader com.jme3.audio.plugins.OGGLoader
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
19:06:53,809 INFO  [ALAudioRenderer] Audio Renderer Information
 * Device: OpenAL Soft
 * Vendor: OpenAL Community
 * Renderer: OpenAL Soft
 * Version: 1.1 ALSOFT 1.17.2
 * Supported channels: 64
 * ALC extensions: ALC_ENUMERATE_ALL_EXT ALC_ENUMERATION_EXT ALC_EXT_CAPTURE ALC_EXT_DEDICATED ALC_EXT_disconnect ALC_EXT_EFX ALC_EXT_thread_local_context ALC_SOFTX_device_clock ALC_SOFT_HRTF ALC_SOFT_loopback ALC_SOFT_pause_device
 * AL extensions: AL_EXT_ALAW AL_EXT_BFORMAT AL_EXT_DOUBLE AL_EXT_EXPONENT_DISTANCE AL_EXT_FLOAT32 AL_EXT_IMA4 AL_EXT_LINEAR_DISTANCE AL_EXT_MCFORMATS AL_EXT_MULAW AL_EXT_MULAW_BFORMAT AL_EXT_MULAW_MCFORMATS AL_EXT_OFFSET AL_EXT_source_distance_model AL_LOKI_quadriphonic AL_SOFT_block_alignment AL_SOFT_buffer_samples AL_SOFT_buffer_sub_data AL_SOFT_deferred_updates AL_SOFT_direct_channels AL_SOFT_loop_points AL_SOFT_MSADPCM AL_SOFT_source_latency AL_SOFT_source_length
19:06:53,809 INFO  [ALAudioRenderer] Audio effect extension version: 1.0
19:06:53,810 INFO  [ALAudioRenderer] Audio max auxiliary sends: 4
19:06:53,959 INFO  [GuiGlobals] Initializing GuiGlobals with:com.simsilica.lemur.GuiGlobals@117e949d
19:06:53,985 INFO  [GuiGlobals] Lemur build date:20161104
19:06:53,988 INFO  [BaseStyles] loadStyleResource(com/simsilica/lemur/style/base/glass-styles.groovy)
19:06:54,735 INFO  [BaseStyles] Loading base resource:jar:file:/home/idea/opt/packages/gradle/gradle-3.0/caches/modules-2/files-2.1/com.github.jMonkeyEngine-Contributions.Lemur/lemur/master-SNAPSHOT/ec36eb374aca205b9e778c5eb791686892dbdd50/lemur-master-SNAPSHOT.jar!/com/simsilica/lemur/style/base/glass-styles.groovy
19:06:56,130 INFO  [BaseStyles] Loading extension resources for:com/simsilica/lemur/style/base/glass-styles.groovy
19:06:56,131 INFO  [BaseStyles] Loading extension resource:jar:file:/home/idea/opt/packages/gradle/gradle-3.0/caches/modules-2/files-2.1/com.github.jMonkeyEngine-Contributions.Lemur/lemur-props/master-SNAPSHOT/8bc7f2570ae0a503a37ed51c2c58f4f684d0a986/lemur-props-master-SNAPSHOT.jar!/com/simsilica/lemur/style/base/glass-styles.groovy
19:06:56,257 INFO  [BaseStyles] Loading extension resource:jar:file:/home/idea/opt/packages/gradle/gradle-3.0/caches/modules-2/files-2.1/com.github.jMonkeyEngine-Contributions.Lemur/lemur-proto/master-SNAPSHOT/2f68eae1a197f52b1ff198bfb1e48cc7d22b421e/lemur-proto-master-SNAPSHOT.jar!/com/simsilica/lemur/style/base/glass-styles.groovy
19:06:56,549 INFO  [BaseStyles] Loading extension resource:jar:file:/home/idea/opt/packages/gradle/gradle-3.0/caches/modules-2/files-2.1/com.simsilica/lemur/1.8.2/6be7911edec09aca630ebda559f2cfd01ed403f1/lemur-1.8.2.jar!/com/simsilica/lemur/style/base/glass-styles.groovy
X Error of failed request:  RenderBadPicture (invalid Picture parameter)
  Major opcode of failed request:  139 (RENDER)
  Minor opcode of failed request:  7 (RenderFreePicture)
  Picture id in failed request: 0x2c00023
  Serial number of failed request:  1422
  Current serial number in output stream:  1423
AL lib: (EE) alc_cleanup: 1 device not closed
:run FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':run'.
> Process 'command '/usr/local/jmonkeyplatform/jdk/bin/java'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 11.528 secs



Build failure (see the Notifications window for stacktrace): gradle :run

I will post as i run to new issues.


Should I move to LWJGL3?
#2

In Windows it runs fine.


#3

Even with AMD graphics? Because with LWJGL and AMD Radeon I has black screen with default Lightning/Unshaded too


#4

In Linux

It seems it is a problem with Lemur groovy glass style. Turning off groovy glass style it works fine for me.


#5

In windows i tested with AMD HD 7650m and worked OK.

Black screen happens for me only on Linux with lwjgl 3.x.


#6

I have AMD Radeon 6670 and Windows 7. (AppSettings.LWJGL_OPENGL3) But javadoc says that it uses OpenGL3.3 as core renderer. So I thought blackscreen is ok.


#7

So it seems like a bug in the AMD driver triggered by transparent texxtures?

Lemur is doing nothing special here and seems to work fine everywhere else. So there must be a bug in lwjgl3 or in the AMD drivers.


#8

Could solve this error : X Error of failed request: RenderBadPicture (invalid Picture parameter)

I just needed to disable setting menu app.setShowSettings(false);
It’s Swing splash screen problem.
More info https://github.com/LWJGL/lwjgl3/issues/149


LWJGL3 startup crash
#9

lwjgl 3 works fine with JavaFX on linux systems :slight_smile:


#10

Yes, i recently updated to SpaceShift Editor 0.7.8 which is based on LWJGL 3.1.0 and it is working just fine.

Thanks


#11

I use the LWJGL3 in my editor from 0.5.0 editor version :slight_smile:


#12

Hey guys sorry for bumping up my old post.

I just noticed this commit from @renanse on his Ardor3D library

and provided a fix for our JME, I already tested it and now LWJGL3 works just fine with JME’s Settings menu on Linux. :slightly_smiling_face:

@renanse calls System.gc(); two times in his commit, not sure why ?
I just added one call to System.gc(); and works fine. Here is my PR:


#13

I called it twice based on a recommendation from lwjgl’s @Spasi in issue
149 linked above:

"Run System.gc(), at least two times. Not sure how AWT handles native
resources, maybe there’s a finalizable/PhantomRef-ed resource that is not
released immediately, but a subsequent GC triggers a (too late) free. "


#14

Could you maybe comment the line System.gc(); with the below explanations and links to the discussions/issues that lead to it? Because usually people who see System.gc() think it’s a mistake or useless for a good reason (even static analysis tools will highlight that)


#15

So this brings up another LWJGL3 issue i’ve run into. I’ve been getting some major performance problems on a new macbook pro with lwjgl3. Like Spoxel went from 15% graphics card utilization to 85%. So far it looks like it may have something to do with flushing the buffers based on the profiling i’ve done but i’m not 100% sure how to start tracking this one down.


#16

@Darkchaos Done

            // System.gc() should be called to prevent "X Error of failed request: RenderBadPicture (invalid Picture parameter)"
            // on Linux when using AWT/Swing + GLFW. 
            // For more info see: https://github.com/LWJGL/lwjgl3/issues/149, https://hub.jmonkeyengine.org/t/experimenting-lwjgl3/37275
            System.gc();

I


#17

And the Keyboard Issues I have with lwjgl3…
Edit @Ali_RS you forgot the second System.gc() if it’s really necessary as pointed out
But other than that: perfect! now one knows why this is there


#18

I do not know about this really. It worked with one call for me on java 11.
But if you think so I am going to add the second call.


#19

Well then it might depend on the actual version maybe.
Let’s see what others think, but too much gc() doesn’t matter much^^


#20

Okay, went ahead and added the second call to gc

I am pinging @nehon , @Empire_Phoenix and @pspeed just in case.