mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-09 18:14:06 +09:00
Created OpenGL Considerations (markdown)
40
OpenGL-Considerations.md
Normal file
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 = ...`|
|
||||||
Reference in New Issue
Block a user