Repository navigation
Description
Describe the bug
Last login: Thu Mar 16 22:30:16 on ttys001
XXX@XXX-MBP ~ % /Users/XXX/XXX/Ikemen_GO_MacOS/Ikemen_GO.command ; exit;
2023/03/16 22:31:26 Using OpenGL 2.1 ATI-4.9.48 (AMD Radeon Pro 5300M OpenGL Engine)
panic: Shader compile error: ERROR: 0:1: '' : version '400' is not supported
ERROR: 0:2: 'precision' : syntax error: syntax error
goroutine 1 [running, locked to thread]:
main.compileShader(0x1bd4c8?, {0x100528c55, 0xe4})
/Users/runner/work/Ikemen-GO/Ikemen-GO/src/render_gl.go:86 +0x14c
main.newShaderProgram({0x100528c55?, 0xc000000001?}, {0x100529480, 0x54e}, {0xc0000061a0?, 0xc0001bd578?})
/Users/runner/work/Ikemen-GO/Ikemen-GO/src/render_gl.go:51 +0x3d
main.(*Renderer).Init(0x10083e700)
/Users/runner/work/Ikemen-GO/Ikemen-GO/src/render_gl.go:201 +0x30f
main.(*System).init(0x10082cae0, 0x18?, 0x0?)
/Users/runner/work/Ikemen-GO/Ikemen-GO/src/system.go:417 +0x505
main.main()
/Users/runner/work/Ikemen-GO/Ikemen-GO/src/main.go:86 +0x187
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
[Process completed]
To Reproduce
i tried to launch IKEMEN GO v0.99.0-rc.1-macos (specifically Ikemen_GO.command) on my Macbook Pro 16-inch 2019 and it gave me this message
Expected behavior
No response
Screenshots / Video
No response
Engine Version (or source code date)
v0.99.0-rc.1-macos
Operating system
macOS 13.3.1
Extra context or search terms
No response
Activity
doomjoshuaboy commentedon Mar 21, 2023
same error but on a newer chip.
lokpro commentedon Mar 29, 2023
Hi @samhocevar , could you reply this case? looks like their OpenGL 2.1 is too low?
Should we add a minimum version requirement to readme?
Show verbose message to users if not meet version requirement in Renderer init()?
beterhans commentedon Apr 2, 2023
Same, can use mac version on Intel Mac
hans@MacMini2018 Ikemen_GO % ./Ikemen_GO.command
2023/04/02 13:54:21 Using OpenGL 2.1 INTEL-16.5.14 (Intel(R) UHD Graphics 630)
panic: Shader compile error: ERROR: 0:1: '' : version '400' is not supported
ERROR: 0:2: 'precision' : syntax error: syntax error
goroutine 1 [running, locked to thread]:
main.compileShader(0x1b94c8?, {0x100528c55, 0xe4})
/Users/runner/work/Ikemen-GO/Ikemen-GO/src/render_gl.go:86 +0x14c
main.newShaderProgram({0x100528c55?, 0xc000000001?}, {0x100529480, 0x54e}, {0xc0000061a0?, 0xc0001b9578?})
/Users/runner/work/Ikemen-GO/Ikemen-GO/src/render_gl.go:51 +0x3d
main.(*Renderer).Init(0x10083e700)
/Users/runner/work/Ikemen-GO/Ikemen-GO/src/render_gl.go:201 +0x30f
main.(*System).init(0x10082cae0, 0x18?, 0x0?)
/Users/runner/work/Ikemen-GO/Ikemen-GO/src/system.go:417 +0x505
main.main()
/Users/runner/work/Ikemen-GO/Ikemen-GO/src/main.go:86 +0x187
hans@MacMini2018 Ikemen_GO %
Lazin3ss commentedon May 25, 2023
Try modifying the shader version. Go into
src\shadersand change the versions on all shaders to the next:#version 130. After that, build the engine and share results here.romanthekat commentedon May 27, 2023
Fails Β±the same way for me w/ intel mac+amd video card, using version
130didn't help:If I got it right, OpenGL 2.1 corresponds to GLSL version 120.
Using this won't help though, w/ different error:
Removing
precisiondirective doesn't help either:(probably these are from higher version of GLSL)
It's strange it uses OpenGL 2.1, I believe macos drivers (w/ all the opengl deprecation considered) should be capable of 4.1 at least
upd.: seems like gl-js dependency can be a reason why:
macOS, Linux and Windows via OpenGL 2.1 backend.Why does it work fine on other platforms then? :)
upd. 2: found the message
Lazin3ss commentedon Jul 18, 2023
@romanthekat please, try building from this branch and share the results here:
https://github.com/Lazin3ss/Ikemen-GO/tree/shader-test
In fact, I'm seeing the solution might be easier. Just change
#version 400to#version 300 eson all shaders in the master branch and it should do the trick.romanthekat commentedon Jul 18, 2023
@Lazin3ss sadly neither options worked for me.
The
shader-testbranch failed with:Just changing to unpatched branch with
#version 300 esfailed with:Lazin3ss commentedon Jul 18, 2023
Alright, I think this is the reason why shaders stopped working on OS X:
https://stackoverflow.com/a/20278658
You see, in the past, shaders used to be compiled under GLSL 1.10 (as shader version wasn't declared in the original shaders), so statements like
inandoutused to bevaryingandattribute, andprecisioncouldn't be used. This changed in these commits: e7915ca a8bbb63In e7915ca, version 1.00 ES started to be mandatory and precision was added, as can be seen here:
Ikemen-GO/src/render.go
Lines 145 to 156 in e7915ca
This already started to affect OS X systems, but in a8bbb63, version was also changed to 4.00, and all deprecated statements were replaced.
So, possible solutions to this (that I can't properly test since I don't have an OS X-based system):
1 - Rewrite the shaders so they're GLSL 1.20-compliant. This might come at a loss of improved float precision, which could create artifacts and break stages such as Endless Stairs. In that case, we can write a GLSL 1.20-compliant alternative for each current shader we have and, if the system doesn't support 4.00 version, use 1.20 instead. That would improve float precision on all systems except those that don't support it, but we would also have to mantain both shader versions. Hopefully, we won't have to do any of that.
2 - Add a new "Render" parameter in config.json from which OpenGL context can be changed (maybe this parameter can accept "OpenGL 2" or "OpenGL 3" as values). This way, we can force a OpenGL 3.2 context on OS X, which should make the shaders work again. This seems like the best solution, the only thing is, I don't know if this will work, but we can test.
So, to help with testing, I will ask to build and test two branches, and share the results here:
OpenGL 2.1 with GLSL 1.20-compliant shaders: https://github.com/Lazin3ss/Ikemen-GO/tree/osx-opengl2
OpenGL 3.2 branch: https://github.com/Lazin3ss/Ikemen-GO/tree/osx-opengl3
Also, some info regarding OpenGL and GLSL versions will be parsed in the command line. If you can share this, I will be grateful.
romanthekat commentedon Jul 18, 2023
OpenGL 2.1 did work, but with classic thing "I'm rendering only a quarter":
OpenGL 3.2 did not work, with:
Lazin3ss commentedon Jul 18, 2023
Well, at least the engine can be run again. Personally, I didn't find problems with the endless stairs stage using the first solution, so we can go with it as it is. Ikemen GO command file already has
-AppleMagnifiedMode YESflag declared, so the engine might have to be run from there for now.https://github.com/ikemen-engine/Ikemen-GO/blob/master/build/Ikemen_GO.command#L7