Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
    
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. – Andon M. Coleman yesterday
up vote 6 down vote accepted
  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.

share|improve this answer
    
Thank you, that help :) – Nikola yesterday
    
"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. – Cubic yesterday
    
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. – Dietrich Epp yesterday

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!

share|improve this answer
    
Geometry shader still can't be found in most GPU-s – Bálint yesterday
    
@Bálint Ah, hm, good point. May have been a bad example, then. – JesseTG yesterday
    
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 – Bálint yesterday

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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