Tape_Worm

June 13, 2018

So, it’s been a long time since I’ve posted anything here. Mostly because I’ve not been writing much code in the last while and real life has been my focus.  Since I’ve been gone, I’ve become a software architect at my job, and that keeps me quite busy.

Gorgon

I’ve uploaded Gorgon v2 (such as it is) to Git.  I’m not entirely happy with that version, and frankly I lost my motivation to finish it.  As it is, it’s feature complete, but may have bugs. However, the editor application is in an unfinished state (it’s usable, but it’s got issues).

From time to time I toyed with making a new version, but never really had the motivation to go beyond prototyping.  I tried using Unreal and Unity, and while those things are quite impressive, they seem to … I dunno, lack something. Especially in the 2D arena.  Also, as a programmer, and an oldschool one at that, it felt quite unnatural to use an editor like that to build up stuff.

However. Lately I’ve been in a fit of watching game documentaries on Youtube (and oddly enough, CBC.ca), and while watching a documentary series on game developers from the 80’s (henceforth known as the best decade), I felt compelled to have another kick at the can.

So, how’s it going?

Well.. it’s going quite well.  I’ve got the core graphics library done, and the 2D renderer is well under way (I can render text and sprites).

I’ve opted to learn how modern rendering engines do their thing to see if I can get some inspiration for performance improvements.  And I did.  The core Gorgon library now renders using a stateless drawing mechanism where an immutable draw call object, configured with immutable pipeline states (similar to how D3D 12 does a PSO). It’s quite a departure from the older versions.  But, I’ve seen some impressive performance gains because of this.

I’ve also decided that I absolutely HATE Direct3D 12.  I get it, it’s wonderful for squeezing every last ounce of performance from your machine so you can get incredible visuals.  But it is a complicated beast, leaving it to the developer to control almost every aspect of programming the GPU.  It kind of reminds me of Immediate mode back in the D3D 3.0 days (nowhere near that bad though).  So, to that end, I’ve decided to base Gorgon’s core graphics API on the latest (at least, latest available in SharpDX) version of Direct 3D 11, which is 11.4.  Honestly, from all I’ve seen, Microsoft has no intention of abandoning 11.x since it has a firmly rooted place in development due to how much simpler it is to use over 12.  That may change in the future, but for now it’s good enough for me.

And this is likely to piss some people off: This new version of Gorgon requires Windows 10. And no, I don’t care to hear about how I’m being spied on.

So, you’re probably wondering hows the performance of the rendering in the 2D API?

Well, see the image:

Yes, that’s 131072 sprites, plus text, rendering at above 60 FPS.

That’s running on a GeForce 1080 GTX.  A pretty high end GPU.  And you might think… “well, for that GPU, 70+ fps isn’t that great”  But keep in mind, those are alpha blended, textured, animated sprites (all 131072 of them).  This little test/example app has been with me since 1.0 and it’s served me well as a quasi benchmark.  To give you an idea of how much of an improvement this is from v1 to now (all on the 1080):

  • V1 – ~15 FPS with the same number of sprites, and a lower window resolution (800×600 vs 1280×800).  This version used D3D 9
  • V2 – 28-30 FPS.  Same resolution, using D3D 11.0
  • V3 – Well.. look at the screen shot.  It’s an improvement.

So yeah, that’s where I’m at.  Will I keep going and release this?  Who knows… I do have a v3.0 branch up on the GitHub repo, which contains just the core API for now (which, sadly has some bugs that I’ve since patched while creating the 2D API).  So, if you want, you can grab it, and mess around with it. Just keep in mind that I offer no support for that version, and it will change over time and may break your stuff.