Procedural Generation | Computer Graphics | Math

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.

Thanks Grace! In the case of these images, the tonemapping is really just a color filter, making the color a bit richer. With an HDR pipeline, it would make a bigger difference (since then you would need tonemapping), but I'm still in LDR.

Since transparency is handled the same as it would be in forward rendering, there's no performance hit. Yay! The downside is that lighting has to be rolled into the shaders for the transparent pass. It remains to be seen how much of a problem this is going to be for me. Luckily, I don't anticipate heavy usage of glass all over the scene.

But another nasty downside is that the GBuffer no longer reflects the true geometry, since it isn't updated in the transparency pass. So certain postprocess effects that use the GBuffer are going to have to be rolled into transparency shaders as well (depth-based fog, for example :/ ). Again, not sure just how bad it's going to be at this point. Crossing my fingers!