Hey – good to see you! If you are new here, you can subscribe to the RSS feed for updates on this topic.
Every Christmas my parents are baffled with my choices when I provide them with a list of books that I would like to read. Last year (2010!) I decided that I would finally learn 3D graphics programming. First I needed to decide between OpenGL and DirectX as my primary platform. I have used DirectX before in a learning capacity, but that was back when I was a full-time Windows user. My bias towards open software led to me to consider OpenGL as any program I wrote could be ported to additional platforms. I had already researched some fantastic game and graphics development textbooks, but the OpenGL SuperBible (5th Edition) stood out among the crowd. I added it to the my Christmas wishlist and Santa Claus delivered.
The book is well organised, teaching you all of the basic principles of OpenGL from the ground up, with no prior experience required. I am quite fortunate in that having studied mathematics at University, I don’t have to worry about the “dreaded maths chapters” that cause confusion to some people when they first attempt 3D graphics. In addition, I am quite well-versed in C++ so the language choice is no barrier. Hence the book has been highly enjoyable to read through so far.
OpenGL is essentially a relatively low-level API to the graphics hardware. I have found that the level of abstraction sits perfectly between performance and ease of development. As the programmer you have to assemble your primitives (shapes) and order them in optimised buffer data structures. You then need to provide coordinate transformations to alter their positions as well as projective geometry transforms in order to provide the illusion of three-dimensionality on a two-dimensional surface.
Although I am nearly at the stage of programming my own very basic shaders (custom code applied to vertices and surfaces) through the book, I have only had one night of coding so far. The first tutorial involves drawing a single triangle on a blue background – in essence an OpenGL “Hello World”. Nothing spectacular, but the process of achieving this requires a lot of understanding of how the different components fit together. The next major task is to draw more advanced primitives and rotate them. Then textures and finally custom shaders for a more realistic look.
The reason for learning OpenGL is twofold. The first is that I am always interested in learning new mathematically-related software concepts. 3D graphics has a large body of mathematical literature associated with it and I imagine I can scour the arXiv and prior SIGGRAPH papers for interesting techniques to code up. The second reason is that I want to attempt to make a 3D game engine that is roughly equivalent to that of the Quake III engine. I want to learn about Binary Space Partitioning (BSP) as applied to graphics engines as well as spline-based curve rendering, which was one of the engine’s main “selling points”. There are also a multitude of interesting shader techniques that can be applied – such as bump mapping. If I really wanted to get creative I could try implementing some of the techniques on the latest and greatest CryEngine 3!
I’m off to read more of the book now. I’ll keep you updated with my progress, however. Watch this space.