Tag Archives: deferred rendering

Deferred Shading, Trade Lanes, Asteroids

A lot of my recent work has been on internals (an unfortunate fact that I always hate admitting). But I'm really trying to nail down the cleanest possible abstractions and pipelines for a deferred renderer in GL. I think I've already come further than I ever have before. I've also got transparency integrated properly with the deferred engine, which is another first for me.

My current project is looking more and more like a game each day. There are now "trade lanes," a la Freelancer, for intra-system transport. Asteroids also made a first appearance yesterday.

As the screenshots suggest, I've implemented a vignetting postprocess filter (just for the sake of screenshots). I'm also using the filmic tonemapping operator from the classic Uncharted 2 (John Hable) presentation. It's really a magical little piece of math :)

The most serious challenge I'm currently facing is performance. Having done much of this stuff before in DX9, I'm seriously concerned that my frametime is already hitting 16ms at 1280x768 with only a reasonable amount of geometry on the screen, and reasonable post-processing. I think this is just a fundamental challenge with OpenGL. I've said it once, I'll say it again. DirectX is a better API. It's significantly harder to figure out how to "correctly" do something in GL such that it is as performant as the DX equivalent - which is precisely the problem I'm running in to now. There are so many different ways to do something in GL that it's exceptionally hard to tell when you've done something the "right" way. This is in stark contrast to D3D, in which, generally, if something works, then you have done it the "right" way.

Decent Reflections

By decent, I mean better than better, which, of course, is two levels above bad, so at least I'm making progress. This time the color looks correct and the reflection is more subtle, but it really brings the scene to life (I know, I said that about SSAO too..)

Just for comparison, here's what the same scene looks like as it would look in my forward renderer (e.g., last week):

Yes indeed, I think XDX rendering has come quite far in a week.


Experimenting with a simple SSAO implementation. Testing it with a procedural city of cubes (textured by the procedural texture generator, of course). Even this simple SSAO makes a huge difference in the appearance of the image - the whole thing just becomes 100x more believable with the occlusion.

Deferred Rendering

Ah, yes. There comes a point in every engine's life where, in order to be hip and cool and eligible to play with all the other cool engines, it must succumb to deferred rendering. XDX is no different.

It will be a long and painful process of converting the existing pipeline to support the deferred renderer, but it will certainly be worth it. During the process, I'm also hoping to unify many of the draw shaders to make everything as simple and clean as possible.