Created OpenGL Considerations (markdown)

2023-03-02 14:16:33 +09:00
parent 7a978a49e7
commit eb967b02a1

40
OpenGL-Considerations.md Normal file

@@ -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 <type> <identifier>`|`in <type> <identifier>`|
|`varying <type> <identifier>`|`out <type> <identifier>`|
**Fragment Shaders**
| old | new |
|----|----|
|`varying <type> <identifier>`|`in <type> <identifier>`|
|`gl_FragColor = ...`|`out vec4 fragColor;`<br>`fragColor = ...`|