Seeing as performance has been on my mind recently, I tweaked the core render loop a bit and saw some reasonable gains. The one thing I realized is that most of the objects in the scene are static, and don’t need their combined transformed matrices recalculated every frame. I expected to see wild improvements after caching the values. What I received was a decent 50% gain. Not monster, but certainly substantial. Now the average framerates are in the upper 200’s to lower 300’s. More acceptable but still maybe not where I want it to be. Just as a sanity check I decided to recreate the sameRead More →

I don’t have much time, so I will be brief. Basically for the past few days I have been trying to optimize the engine. With the stress test you see above (around 13K cubes) I was only getting around 200 fps. Just slightly above my target of 120 fps, and with such a simple scene I was expecting more. So I got to hacking, fully realizing that early optimization is evil… yeah, yeah. In any case, I needed to know if the engine architecture was flawed in some way, and if I was going down the wrong path. Through some crude debugging I found that myRead More →

  Today I have gotten the camera system to a decent place, and made a simple free look demo. Most of the code had already been implemented, inside the vector and matrix classes, I just had to piece it together into a camera object. I also added a grid of cubes, to better see the camera working. Sadly these extra 200 cubes slowed down the performance by a good chunk. Previously I was getting around 3,500 FPS (with 3 cubes), now I’m only getting around 2,000 FPS (with around 220 cubes). Granted the performance is bound to drop as more objects are added, but IRead More →

  Though the above video might not seem like an overly impressive jump from the last, there’s actually a ton of work behind it. The new additions include a node-based scene graph hierarchy, more robust math libraries, and keyboard control using DirectInput. Plus, I’ve tried to abstract as much as I can into modular classes and remove the hard-coded hacks I had in there. Finally I hid away the Windows stuff into it’s own class so clients just need to create a normal main() function and can launch the window from there (removing much of the nasty Win32 looking code from sight). Here is an example of launching anRead More →

  The demo is starting to shape up now, with texture mapping and some simple lighting (ambient and directional). To be fair, I’m not sure if I would really call this an “engine” quite yet. It’s still very much a bare-bones, hard-coded demo done in DirectX 11. But once I can get the features working, then I can properly abstract and generalize the functionality. I have plans to start implementing keyboard and mouse controls (probably using DirectInput) and then a simple camera system so I can move around in the space. I’d also like to get a model importer up and running, but I expectRead More →

  Today I have finally gotten a simple sort of animation working. It looks easy, but I made my life a lot harder by implementing by own math library. So far I have a Vector3D and a Matrix4x4 class almost finished. Well the Vector class is pretty much done. The Matrix class still needs some fleshing out, but I got it working well enough to spin a triangle. I realize I could have used the D3DX library (which is deprecated), or XNAMath (also deprecated), or DirectXMath (safe for now), but I thought making my own math functions would be a good learning experience. I didRead More →

So I buckled down and spent the better half of the day actually getting something to show on the screen. Yes, it’s still just a triangle, but it feels pretty satisfying after struggling to get it to work all morning. While there are tons of triangle tutorials online, and it would seem like a 20 minute hack, I ended up having some difficulty for a few reasons. One, I decided last night to upgrade to Visual Studio 2013 so I could take advantage of C++11 and the 64-bit compiler. Right off the bat, this resulted in a bunch of warnings. I eventually found the instructions toRead More →

Beginning DirectX 11 Game Programming by Allen Sherrod is, what I’d consider, a great introduction into DirectX programming. Just to be clear, it’s really only an overview of the DirectX APIs (Direct3D, DirectInput, etc.) and not really a graphics or game programming book (despite the title). So there is very little in the way of actual gameplay type programming, as you never really get to the point of having any sort of game demo. In that same respect, you don’t really deal too much with computer graphics theory, though there is some brief coverage of lighting models in regards to shader programming. That said, whatRead More →

I know it has been quite some time since the last update, and I thought I would be much further by now. Truth be told, I have been a little distracted the last few months with things totally tangential to graphics programming. In any case, I’ve had some motivation recently to continue on the 3D game engine and began doing further research and reading. However, research doesn’t get results on it’s own. 90% of the time, you just have to start doing whatever it is you want to do whether you think you’re ready or not. So that brings us here, to this totally underwhelmingRead More →

Alan Thorn’s Game Engine Design and Implementation was quite an interesting read. Overall I thought it was good, but the book struggles at times to find it’s audience. On one hand, it covers a lot of great topics and there are some good code snippets to be found. On the other hand, it seems to jump around between APIs and frameworks and never really culminates with a complete engine. Even so, engine development is no breeze and any help in this area is much appreciated. The text begins with the basics: downloading Visual Studio or Code::Blocks and configuring a development environment. It shows you how toRead More →