Kids these days with their free 3D game engines have no idea what life you used to be like! In addition to walking 5 miles up hill in the snow, both ways, to get and from school, if we wanted to render a polygon on screen, we needed to create a polygon first!
I’m not really kidding either. In the DOS and early Windows 95 days, OpenGL was only available on high end SGI workstations. There was no 3D accelerations, there were very few game engines and those that were available were insanely expensive. If you were creating a 3D game engine, you really needed to roll everything yourself… line drawing routines, triangle rasterizing routines ( the act of turning shapes into pixels ), everything was created from scratch and you had no hardware to help you out. Looking back, its rather amazing how far things have come in such a short period of time! I don’t think anyone could have even fathomed the existence of the Unity game engine back in those days. If you ever felt that OpenGL or DX11 programming was low level, you should have been programming in those days!
Truth told though, it was a lot of fun too. You opened up your copy of Michael Abrash’s Zen of Graphics Programming (still an amazing book!) and got to work. Perhaps most importantly, you also had a better understanding of what was going on than you do now. Strangely enough, I struggle more now with modern shader programming than I ever did back in those days. So, while you had to do a great deal more it was also a great deal more simple. You were always in control of your code, something that has become less and less true.
So, why am I talking about this… am I having an old person moment? No, not at all! Or at least, I don’t think so… do you recognise if you have an old person moment anyways?
Ok, back on track… I mention this, because oddly enough David Rousset over at MSDN is creating exactly such a tutorial series. In his words:
So why building a 3D soft engine? Well, it’s simply because it really helps understanding how modern 3D works with our GPUs. Indeed, I’m currently learning the basics of 3D thanks to internal workshops delivered within Microsoft by the awesome David Catuhe. He’s been mastering 3D for many years now and matrices operations is hard-coded in his brain. When I was young, I was dreaming to be able to write such engines but I had the feeling it was too complex for me. Finally, you’ll see that this is not – that – complex. You simply need someone that will help you understanding the underlying principles in a simple way.
Through this series, you will learn how to project some 3D coordinates (X, Y, Z) associated to a point (a vertex) on a 2D screen, how to draw lines between each point, how to fill some triangles, to handle lights, materials and so on. This first tutorial will simply show you how to display 8 points associated to a cube and how to move them in a virtual 3D world.
If you’ve ever struggled understanding HOW DX or OpenGL work, as in actually work not how to use them, running through this series would be a very good idea. Currently part one and part two are online. Here is the end result of part two:
Of course, this is all for educational purposes only! Creating a software based 3D engine in this day and age makes about as much sense as buying a horse and buggy instead of a car. So if you ever wanted a peek behind the curtains, you may want to keep an eye on this tutorial series.