I wanted to share a little bit about what I’ve been working on over the past month, since it will probably have some impact on anyone playing the game… and we like to share with you guys, of course.



Specifically, I’m talking about graphics.



It’s not entirely surprising that’s what I am going to talk about. That’s pretty much all I do here at Uber… that, and drink a lot of coffee. Oh, and play the game a bunch, too.



Anyway, it became clear a little while ago we’d accumulated quite a bit of technical debt in the graphics engine, specifically because the engine evolved really, really quickly. To make progress, and get performance to where it should be, I decided it was time to pay back some of that debt. This involved a pretty extensive low-level re-write of the core graphics engine.



The best analogy I can think of (for the non-graphics programmers out there) is this: imagine you are building a house. The foundation is in place, the walls are up, the roof is on, the windows are in, and you’re about to put finishing touches in. Then you realize… hey, we actually want 3 floors in this house, not 2. Darn. The foundation won’t take the weight of 3 floors…. So, to stretch this analogy to breaking point, I basically had to go in and rebuild the foundation of our graphics engine/house, so it would fit the existing structure, but support future growth. And allow it to go really, really fast (OK, we’re not talking about houses any more. The only time houses go fast is in a tornado.)



Hopefully that made some kind of sense.



Anyway, this is done, and you’ll see the results in the next release. Now, bear in mind, you will not see miraculous improvements in performance. I readily admit that there’s still a long way to go. But you should see some (we’ve seen some good improvements in our internal testing).



I’ve also been talking a bunch to folks from NVidia (and more recently have engaged in a dialog with AMD). They’ve given me a bunch of pointers on (some of) the internals of how the drivers work, and the kinds of things we’ve been doing that the driver finds upsetting. I’ve only scratched the surface of improvements we need to make here; expect to see some big gains over the coming months.



The upshot here is, things will be a little better in the next release. We’ve tested quite a bit, and it looks pretty solid, but it’s more than possible some issues might come up (this is a major rewrite of some pretty core systems, after all). If you *do* have issues with graphics, I apologize in advance. But let us know, and we’ll fix them. We’re always working hard to make sure the game is as awesome as possibly for absolutely everyone.



For the terminally curious out there, here’s some down-and-dirty details of what’s changed:



· I added a “hardware abstraction” concept, that basically provides an ultra-thin layer between the graphics API (in this case, openGL) and the game. In doing so, I improved the way we do some things, that massively reduces the number of API calls we make, which in turn improves performance.



· The above hardware abstraction also provides more flexibility in how we do our rendering. From this, it will be possible to make our code even more efficient.



· The “effects” system (the system we use to manage materials and shaders) is now entirely high-level on top of the hardware abstraction. It also pulls in data from JSON files, meaning the effects as well as the shaders will be entirely customizable.



· I’ve added code-paths to support more advanced API features in OpenGL. Up to now, we’ve only had code-paths that support the lowest common denominator that we support (which was OpenGL 2.1). This has been limiting. By providing optional codepaths to leverage more advanced features, this helps us get more from the hardware. I’ve done this whilst still providing the fallback code-paths, so we’ll still run on older systems (albeit with less awesome than on newer hardware).



· I made the HDR luminance phase live entirely on the GPU (instead of round-tripping from the GPU to the CPU to perform the tone-mapping calculations). This makes life better on certain video cards. However, this wasn’t ready in time for the upcoming release, so you won’t get the benefit of that quite yet.



· And lots more. I could go on, but I have code to write…

Click to expand...