[CLOSED] demo issues under macOS

Started by BrickFarmer, January 07, 2018, 12:13:22

Previous topic - Next topic

BrickFarmer

Java 1.8.0_151 but also tried 9.0.1 - clean installs today
demos 1.9.8.snapshot  bf83d2b

Finally I have some time to play with LWJGL3 again :)  Great to see the work continues at an impressive speed!

Anyway I just tried the demos to wet my feet, I'm seeing a few problems which are probably macOS related:

1. screen tearing with space shooter demo when shooting (after remembering to add the startOnFirstThread fix).  The tearing only happen on shoot effects (doesnt seem to happen on the impact particle emitter).

2 org.lwjgl.demo.opengl.fbo.EdgeShaderMultisampleDemo20   - see attached image

Many of the demos start in a small corner of the screen like this, if I go to full screen mode everything looks correct, cube fills screen.  On this particular demo there is also an intense black and red flickering in the background 3/4 of the screen.

I'll update as I test more...
Oculus Rift CV1, MBP 2016 - 2.9 i7 - Radeon Pro 460  OSX 10.12.4,  Win7 - i5 4670K - GTX1070.
Oculus Rift VR Experiments: https://github.com/WhiteHexagon

spasi

1. Vsync is not enabled in that demo. Try changing line 310 to glfwSwapInterval(1). You may also want to change line 194 to private boolean windowed = false.

2. This is typical of many lwjgl3 demos that do not handle the macOS HiDPI behavior. It's not a bug and can be fixed trivially with a bit of code. You can also ignore the issue with glfwWindowHint(GLFW_COCOA_RETINA_FRAMEBUFFER, GLFW_FALSE). For a complete demo that even handles DPI transitions when moving a window across monitors, on both Windows and macOS, see org.lwjgl.demo.stb.Vorbis in the lwjgl3 repository.

BrickFarmer

Ah, I had completely forgotten about the demos in the test folders, thanks!

In the meantime I already went through all the demos on the demo repo...  I'll log the results here anyway for future reference for others trying to run them? Although I realize most of them are just issues with OpenGL on macOS.  I only just started work on programming again, and very disappointed to find a 1 year old laptop supports only a 7 year old API ie. OpenGL 4.1

Thanks for the tips!


java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.UniformArrayDemo            - NSGL: The targeted version of macOS does not support OpenGL 3.0 or 3.1 but may support 3.2 and above
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.SimpleDrawElements            - works


assimp

java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.assimp.WavefrontObjDemo         - java.lang.IllegalStateException: Unable to open file "/Users/peter/Downloads/lwjgl3-demos-master/file:/Users/peter/Downloads/lwjgl3-demos-master/target/lwjgl3-demos.jar!/org/lwjgl/demo/opengl/assimp/magnet.obj".

fbo

java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.fbo.DepthEdgeShaderDemo20         - works
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.fbo.EdgeShaderDemo20         - works
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.fbo.EdgeShaderMultisampleDemo20      - works but red bars in background
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.fbo.MultisampledFbo2Demo         - works
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.fbo.MultisampledFboDemo         - works
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.fbo.ReadDepthBufferDemo         - works

geometry

java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.geometry.GeometryShaderTest         - works
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.geometry.GeometryShaderTest20      - works
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.geometry.SilhouetteDemo         - works

glfw

java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.glfw.Multithreaded            - works

instancing

java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.instancing.GrassDemo         - java.lang.UnsupportedOperationException: ARB_vertex_array_object is not available

raytracing

java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.raytracing.AtomicDemo         - Requested OpenGL version 4.3, got version 4.1
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.raytracing.Demo            - Requested OpenGL version 4.3, got version 4.1
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.raytracing.Demo20            - ERROR: No definition of randomHemisphereCosineWeightedPoint in fragment shader
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.raytracing.Demo33            - works
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.raytracing.Demo33Ubo         - works
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.raytracing.DemoSsbo            - Requested OpenGL version 4.3, got version 4.1
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.raytracing.DemoSsboTrianglesStacklessKdTree - Requested OpenGL version 4.3, got version 4.1
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.raytracing.HybridDemo         - "
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.raytracing.HybridDemoSsbo         - "
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.raytracing.HybridDemoSsboInstancing      - "
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.raytracing.HybridDemoSsboInstancing45   - Requested OpenGL version 4.5, got version 4.1
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.raytracing.HybridDemoSsboTriangles      - Requested OpenGL version 4.3, got version 4.1
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.raytracing.PhotonMappingBindlessDemo   - "
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.raytracing.PhotonMappingDemo      - "
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.raytracing.TransformFeedbackDemo      - "

shader

java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.shader.ImmediateModeDemo
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.shader.NoVerticesBSplineDemo      - NSGL: The targeted version of macOS does not support OpenGL 3.0 or 3.1 but may support 3.2 and above
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.shader.NoVerticesGridDemo         - "
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.shader.NoVerticesPolygonDemo      - "
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.shader.NoVerticesProjectedGridDemo      - "

shadow

java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.shadow.ShadowMappingDemo         - NSGL: The targeted version of macOS does not support OpenGL 3.0 or 3.1 but may support 3.2 and above
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.shadow.ShadowMappingDemo20         - works

swt

java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.swt.SwtAndGlfwDemo            - objc[7404]: Invalid or prematurely-freed autorelease pool 0x7f901f813b50. Set a breakpoint on objc_autoreleasePoolInvalid to debug. Proceeding anyway because the app is old (SDK version 10.9.0). Memory errors are likely.
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.swt.SwtDemo               - works

textures

java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.textures.BillboardCubemapDemo      - works
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.textures.EnvironmentDemo         - works
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.textures.EnvironmentTeapotDemo      - works
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.textures.FullscreenCubemapDemo      - works but not fullscreen
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.textures.SimpleProceduralTextureDemo   - works
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.textures.SimpleTexturedQuad         - java.lang.NullPointerException, at org.lwjgl.glfw.GLFW.nglfwSetKeyCallback(GLFW.java:3483)
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.textures.Texture2DArrayMipmapping      - NSGL: The targeted version of macOS does not support OpenGL 3.0 or 3.1 but may support 3.2 and above


org.lwjgl.demo.intro.Intro2      - demo 2,3,4 has a crazy flickering between blackj and red backgrounds

java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.bgfx.Bump                  - works, but full screen is partially off screen
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.bgfx.Cubes                  - works, but full screen is partially off screen
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.bgfx.Metaballs               - works, but full screen is partially off screen
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.bgfx.Raymarch               - works, but full screen is partially off screen
Oculus Rift CV1, MBP 2016 - 2.9 i7 - Radeon Pro 460  OSX 10.12.4,  Win7 - i5 4670K - GTX1070.
Oculus Rift VR Experiments: https://github.com/WhiteHexagon

KaiHH

Wow! Thanks for the super-helpful "todo"-list ;)

Quote from: BrickFarmer on January 07, 2018, 18:40:32
java -XstartOnFirstThread -cp target/lwjgl3-demos.jar org.lwjgl.demo.opengl.raytracing.Demo20            - ERROR: No definition of randomHemisphereCosineWeightedPoint in fragment shader
At least this legitimate error has been fixed. I do not have access to a Mac, so I must rely on someone else to fix the issues. Maybe you or @Spasi have some time to do it.

BrickFarmer

I have no proper dev environment yet, but happy to help out once I get set up again.

As a foot note I went through all the demos in the test folders, and they seem to be working fine under macOS.  In fact a big well done for all the hard work everyone has done with the demos, some great demos tucked away in there, maybe they need a bit more visibility, and maybe some tips how to run them on the github page.  Anyway hopefully I'll be unpacked soon and will get my win VR box back and can test some of the VR stuff again :)
Oculus Rift CV1, MBP 2016 - 2.9 i7 - Radeon Pro 460  OSX 10.12.4,  Win7 - i5 4670K - GTX1070.
Oculus Rift VR Experiments: https://github.com/WhiteHexagon