3
\$\begingroup\$

I want to make a 3D voxel game, randomly generated planets, some with live (one minimum with life) , and they are spinning around the sun. For now I have this in OpenGL 2.1 (using fixed pipeline, glBegin / glEnd), and this planet and sun is sphere made out of triangles not blocks, and you will be able to travel to the other planets with your custom made spaceship: enter image description here And I have a couple of questions:

  1. Is it ok to use OpenGL 2.1 or should I use OpenGL 3.3+
  2. Do I need shaders to do something like not rendering block that are not visible
  3. Do you have some resources for voxel games?

And finally sorry for my English.

\$\endgroup\$
  • \$\begingroup\$ 2.1 is considered by some modern. It's all in how you use it. The stuff that 3.2+ core requires you use instead of deprecated functionality is (mostly) available in 2.1 (with the exception of stuff like Vertex Array Objects, though they are probably available in extension form on a good many 2.1-based systems). If you steer clear of the stuff that core profiles do not allow, then you are using modern GL even in a version as old as 2.0 or 2.1. \$\endgroup\$ – Andon M. Coleman Apr 10 '16 at 2:08
6
\$\begingroup\$
  1. Use OpenGL 3.0 to 3.2, 3.3 and above isn't supported by some machines.

  2. You seem to be mixing OpenGL 2.1 with immediate mode. There are better ways to draw in OpenGL 2.x than immediate mode (e.g. VBOs)

Your questions:

  1. You should definitely use OpenGL 3.3 if you can choose.

  2. No, but shaders can do it more effectively (in most cases)

  3. We can't recommend resources or tools to use.

\$\endgroup\$
  • \$\begingroup\$ "3.3 and above isn't supported by some machines" that seems like a pointless argument. Any technology you could name isn't supported on some machines, the question is how much of the market you're targeting is saturated with machines that don't support it. \$\endgroup\$ – Cubic Apr 9 '16 at 15:56
  • \$\begingroup\$ There are very few machines which support OpenGL 3.2 but not 3.3. If the machine has 3.x class hardware, it is practically guaranteed to support 3.3. The only cases I know of are OS X running 10.7 or 10.8. \$\endgroup\$ – Dietrich Epp Apr 9 '16 at 16:33
4
\$\begingroup\$

Is it ok to use OpenGL 2.1 or should I use OpenGL 3.3+

Unless you need your game to run on something eight to ten years old, use at least OpenGL 3.1. The main reason is that fixed-function APIs are just that; fixed. You can use the rendering functionality that they provide, and no more. Also, mobile devices don't support fixed-function OpenGL, so using it closes that market off.

Do I need shaders to do something like not rendering block that are not visible

No, but it can help a lot. One thing you can do with modern OpenGL is geometry shaders, which take vertices as input and generate more vertices as output; instead of having to give your GPU 8 vertices per cube, just give it coordinates and write a geometry shader to handle the rest.

Do you have some resources for voxel games?

Haven't used any, so I can't recommend any. Doesn't mean they don't exist, though!

\$\endgroup\$
  • \$\begingroup\$ Geometry shader still can't be found in most GPU-s \$\endgroup\$ – Bálint Apr 9 '16 at 18:00
  • \$\begingroup\$ @Bálint Ah, hm, good point. May have been a bad example, then. \$\endgroup\$ – JesseTG Apr 9 '16 at 18:02
  • \$\begingroup\$ Yeah, this is the problem with all the EXT stuff, especially with shaders (geometry shader or tesselation shader), it's hard to create a fallback fro them \$\endgroup\$ – Bálint Apr 9 '16 at 18:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.