From eb967b02a1061a6e92f22d3f0dca346e32efee4c Mon Sep 17 00:00:00 2001 From: CuriousTorvald Date: Thu, 2 Mar 2023 14:16:33 +0900 Subject: [PATCH] Created OpenGL Considerations (markdown) --- OpenGL-Considerations.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 OpenGL-Considerations.md diff --git a/OpenGL-Considerations.md b/OpenGL-Considerations.md new file mode 100644 index 0000000..d20e6a5 --- /dev/null +++ b/OpenGL-Considerations.md @@ -0,0 +1,40 @@ +## GL Versions + +**GL Version 3.2 is forced** + +Because of the limited OpenGL support of macOS, we change the ingame target GL version to 3.2; this includes the GLSL shader version (which is 1.50) + +The modules that creates `Lwjgl3ApplicationConfiguration` must add following option to the app config: + +``` +appConfig = new Lwjgl3ApplicationConfiguration(); +appConfig.setOpenGLEmulation(Lwjgl3ApplicationConfiguration.GLEmulation.GL30, 3, 2); +... +``` + +### GLSL Versions + +**GLSL Version 1.50 is forced** + +Every GLSL code must start with following line: + +``` +#version 150 +... +``` + +and as this change brings significant syntax change, following replacement conventions also apply: + +**Vertex Shaders** + +| old | new | +|----|----| +|`attribute `|`in `| +|`varying `|`out `| + +**Fragment Shaders** + +| old | new | +|----|----| +|`varying `|`in `| +|`gl_FragColor = ...`|`out vec4 fragColor;`
`fragColor = ...`| \ No newline at end of file