Lesson Index
The lessons on this page may contain mistakes, poor commenting, and should not be considered the best resource to learn OpenGL from. What you do with the code is up to you. I am merely trying to make the learning process a little easier for those people new to OpenGL. If you are serious about learning OpenGL, you should spend the money and invest in the following books: Red Book Version 1.4 (4th ed.): 0321173481, Blue Book Version 1.4 (4th ed.): 032117383X, Orange Book Version 1.4 (Shading Language): 0321197895. Although they can be difficult for the new OpenGL programmer to understand, they are by far the best books written on the subject of OpenGL. Another book I would recommend is the OpenGL Superbible, although opinions vary. It is also important that you have a solid understanding of the language you plan to use. Although I do comment the non-GL lines, I am self-taught, and may not always write proper or even good code. It's up to you to take what you have learned from this site and apply it to projects of your own. Play around with the code, read books, ask me questions if need be. Once you have surpassed the code on this site or even before, check out some of the more professional sites such as OpenGL.org. Also be sure to visit the many OpenGL links on my page. Each site I link to is an incredible asset to the OpenGL community. Most of these sites are run by talented individuals that not only know their GL, they also program a lot better than I do. Please keep all of this in mind while browsing my site. I hope you enjoy what I have to offer!

One final note, if you see code that you feel is similar to someone else's code, please contact me. I assure you, any code I borrow from or learn from either comes from the MSDN or from sites created to help teach people in a similar way that my site teaches GL. I never intentionally take code, and never would without giving the proper person credit. There may be instances where I get code from a free site not knowing that site took it from someone else, so if that happens, please contact me. I will either rewrite the code, or remove it from my program. Most the code should be original however, I only borrow when I absolutely have no idea how to accomplish something, and even then I make sure I understand the code before I decide to include it in my program. If you spot mistakes in any of the lessons, no matter how tiny the mistake may be, please let me know.

One important thing to note about my base code is that it was written in 1997. It has undergone many changes, and it is definitely not borrowed from any other sites. It will more than likely be altered in the future. If I am not the one that modifies it, the person responsible for the changes will be credited.
Lesson 41
Volumetric Fog & IPicture Image Loading
This tutorial will introduce you to the world of extensions. In this tutorial you will learn how to create Volumetric Fog using the glFogCoordf Extension. You will also learn how the IPicture code works, and how to use it in projects of your own. Because of very limited free time, the demo is not all that complex. The only keys used in this demo are the up and down arrow keys. The only effect displayed in this demo is volumetric fog. Keeping that in mind, the fog effect is extremely cool, and the tutorial is very detailed. After reading through this tutorial you should have no problem adding volumetric fog to demos of your own. It's important to note that this tutorial only runs on video cards that support the EXT_fog_coord extension. If you are not sure if you care supports this extension, download lesson 24 and scroll through the list of supported extensions. Hopefully someone will find this code useful! 
Lesson 42
Multiple Viewports
This tutorial was written for all those people that have emailed me wanting to know how to display multiple views on a single screen. This tutorial will teach you how to set up multiple viewports, how to display both ortho and perspective views on the same screen, and how to display a variety of effects with each effect running in it's own viewport. As an added bonus, you will learn how to get the size of your OpenGL window, you will learn a very fast way to update a texture without rebuilding it. You will learn how to use GL_COLOR_MATERIAL to color a texture and you will get to play around with my maze code :) I hope you appreciate the time I put into making this tutorial. It a simple idea, but writing the tutorial and then the HTML was very time consuming! 
Lesson 43
FreeType Fonts in OpenGL
Recently many of you have written to me asking how to create an anti-aliased font. Bitmap fonts are usually blocky looking when zoomed, and outline fonts eat up too much CPU. Thanks to Sven Olsen, you can now create extremely nice looking fonts using the FreeType library. By using the FreeType library you can create anti-aliased text. The text is easy to rotate and works well with OpenGL's picking functions. The example program is based on lesson 13, and uses the older NeHe basecode. The example is not all that fancy, but after running it, you will see a clear difference between the older WGL Bitmap Font and the new FreeType Font! If you enjoy this tutorial, please email the author and let him know! 
Lesson 44
3D Lens Flare With Occlusion Testing
Learn how to do lens flares by extending a glCamera class. If you look at a lens flare you will notice that they all share one thing in common. They all seem to move through the center of the screen. With this in mind you could actually just throw out the z coordinate and make your flares all 2D. The only problem with this approach is without a z coordinate how do you find out if the camera is looking at the light source or not? In this tutorial we will be making 3D lens flares so get ready for a little bit of math. Occlusion test by Dario Corno a.k.a. rIO of Spinning Kids. 
Lesson 45
Vertex Buffer Objects
When you need raw polygon-pushing power, you can always utilize the optimizations provided by OpenGL. Vertex Arrays are one good way to do that. For even more boost you can use a recent extension to graphics cards called 'Vertex Buffer Objects'. The extension, ARB_vertex_buffer_object, works just like vertex arrays, except that it loads the data into the graphics card's high-performance memory, significantly lowering rendering time. Because the extension is relatively new, not all cards will support it. This awesome tutorial was written by Paul Frazee. If you enjoy the tutorial please e-mail him and let him know. 

I am not a guru programmer. I am an average programmer, learning new things about OpenGL every day.
I do not claim to know everything. I do not guarantee my code is bug free. I have made every
effort humanly possible to eliminate all bugs but this is not always an easy task.
Please keep this in mind while going through the lessons!

Back To NeHe Productions!