Best projects to learn OpenGL from scratch?

Started by
4 comments, last by TheChubu 10 years, 1 month ago

So, i'm pretty decent with C++ and 2D game making, but 3D is still new to me with Unity being my only experience. Do you guys recommend which kind of projects to learn more about it? MD3/MD2 loaders/editors? Terrain editors? Terrain and object placement, etc?

Advertisement

Adaptation of the codes of 2000 to Visual C++ MS VS pro 2010-2012: NeHe's demo and codes OpenGL summary

I'm making the assumption that you are totally new to shaders and low level 3d...don't mean to be condescending, I'm still learning a lot myself. This is where I would start though if I could do it all over again...

Start with little...seemingly insignificant details. Rendering a point, a triangle, two triangles together (a quad), a cube, a sphere, then finally an arbitrary mesh from a parsed Wavefront OBJ. As you move to each new more complex piece of geometry focus on mastering it...for example, walk through these steps (not in any particular order) with a cube...

1. Can you put a different color on each face of the cube?

2. Can you map a texture to the cube?

3. Can you map/blend two textures onto the cube?

4. Can you rotate, translate, scale the cube and rotate it around both its axis' and another point in space?

5. Can you render the cube with either an orthographic or perspective projection? Can you switch back and forth on the fly?

6. Can you pick (or select) an individual face on the cube and turn that particular face to a black and white texture as opposed to a colored?

7. Can you put the same color on each face and still have them be distinguishable (as opposed to a blob) by using vertex normals and a directional or point light?

8. Can you switch between per vertex lighting and per fragment lighting?

9. Can you draw two, five, or twenty cubes with the same geometry but with different sets of shaders (swapping them in a single draw)?

Experiment. Above all, I would concentrate on writing your own shaders as you go...steal and loot other people's ideas once you understand them, but don't do an outright copy.

An even more basic exercise: setting up windows and contexts, with proper error handling and without stupid assumptions. Extra credits for multiple windows.

If you learn to tread carefully and check for errors, you will be ready when you have something serious to debug.

Omae Wa Mou Shindeiru

Thank you guys! I guess i'm going to start with viewers and, hopefully, editors. biggrin.png

It's turning into the cookie cutter answer but I'll post it anyway:

Since there is a big gap between "ye olde OpenGL" and "modern OpenGL", and various amounts of shades in between, you might find that resources differ quite a bit on how they go about doing things.

This online book teaches graphics theory and fairly modern OpenGL practices:

http://www.arcsynthesis.org/gltut/

Its 3.3 core, so you won't be using sparse texture arrays nor shader buffer storage like you can on the latest nVidia Kepler/Maxwell cards but, that stuff is usually sought for when you're doing (very) advanced things. So don't worry much about it, basic setup is pretty much the same from OpenGL 3.3 and above (VAOs, UBOs, sampler objects, etc) and you get used to the 'layout' 'binding' qualifiers in GLSL which become more prominent as new features were released in newer editions of OpenGL.

"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

My journals: dustArtemis ECS framework and Making a Terrain Generator

This topic is closed to new replies.

Advertisement