Reputation: 4952
I have an iPhone game which I am porting to PC. The game uses OpenGL ES 2 (shaders) and I am to decide which version of OpenGL to use.
Should I port all shaders to OpenGL 2 (and support older hardware)? Or should I port to OpenGL 3 (which I don't know very well yet, but it seems that the shaders are more compatible)? Which will be easier to port?
Upvotes: 1
Views: 1018
Reputation: 45948
Since OpenGL ES 2 is a subset of desktop OpenGL 2, you should be pretty fine with 2.x if you don't need your game to use more advanced techniques on PC (like instancing, texture arrays, geometry shaders, ..., things your ES device never heard about).
Just keep in mind, that the fact that you can use immediate mode and the fixed-function pipeline in desktop GL 2 doesn't mean you should. You can code completely forward-compatible modern GL (VBOs, shaders, ...) in OpenGL 2.0 just fine. On the other hand GL 3.x isn't really any different from previous versions, it just brings some additional features, which can be included later on if need arises. There is no real decision between GL 2 or 3, only between modern VBO-shader-based GL and old immediate-mode-fixed-function-based GL, and with your game already using GL ES 2.0 you have made the correct decision already.
Actually your shaders would be more compatible with GL 2 than 3, as ES 2 uses the old attribute/varying syntax. But that as a side note, nothing to really drive your decision as you may have to change your shaders a little bit, anyway (e.g. handle/remove precision qualifiers).
Upvotes: 2