Since I started working on a general particle system for the engine, I have to deal with a lot more (raw) OpenGL stuff than before. At the moment there are no guidelines on what versions of openGL to use.
Judging by the LWJGL imports, it seems that we are currently mixing version 1.1, v1.5, v2.0 and v4.3 (although the last one is only used in debug mode).
I am by no means an expert on OpenGL, but wouldn't it be best to stick to one version? The mixing of different versions is really confusing, especially in the case of shaders (different versions allow different keywords etc).
The rendering stuff would probably be more robust, if we could stick a version tag on each glsl source, so the compiler can warn about incorrect/deprecated usage.
Updating the existing code to use one specification is probably a bit too much work to do in one go. However if we can decide on which version to use and document it somewhere, than at least all future OpenGL code is using the same version.
If we are going to decide on what version to use than I would vote for version 3.3. Reasons being:
edit2: The GLSL shader class prepends all shader with "#version 120", which would mean that the engine expects OpenGL2.1. I only noticed that because adding a version tag to a shader file resulted in a crash...
Knowing this, I would actually just prefer to continue using openGL2.1 and document this somewhere (wiki?).
Judging by the LWJGL imports, it seems that we are currently mixing version 1.1, v1.5, v2.0 and v4.3 (although the last one is only used in debug mode).
I am by no means an expert on OpenGL, but wouldn't it be best to stick to one version? The mixing of different versions is really confusing, especially in the case of shaders (different versions allow different keywords etc).
The rendering stuff would probably be more robust, if we could stick a version tag on each glsl source, so the compiler can warn about incorrect/deprecated usage.
Updating the existing code to use one specification is probably a bit too much work to do in one go. However if we can decide on which version to use and document it somewhere, than at least all future OpenGL code is using the same version.
If we are going to decide on what version to use than I would vote for version 3.3. Reasons being:
- that more than 95% of all steam users have hardware supporting openGL3.x (== DirectX 10.x). (edit: unity survey)
- OpenGL4.x only enables new hardware features and does not really change the API.
- OpenGL versions before 3.0 have a lot of stuff that is now deprecated and that probably has its reasons.
edit2: The GLSL shader class prepends all shader with "#version 120", which would mean that the engine expects OpenGL2.1. I only noticed that because adding a version tag to a shader file resulted in a crash...
Knowing this, I would actually just prefer to continue using openGL2.1 and document this somewhere (wiki?).
Last edited: