Monday, July 5, 2010

Updates for 5th July 2010

Having resolved the problem of the skybox cubemap in much less time than I had originally budgeted, I now find myself with the opportunity to add some extra "value added" stuff. This is something I like to do from time to time, and today's chosen victim is the video options menu.

Much of this menu dates back over a year, and some of the implementation is quite crude. So a nice layer of polish is going to be added to the mode selection, with the ability to select windowed or full screen modes, bit depths, resolutions, and possibly even refresh rate separately from each other.

I'm also going to add the ability to select a depth buffer format. Right now DirectQ locks the depth buffer format at startup time, and prefers 24-bit depth and 8-bit stencil. The reason for this is to make r_shadows mode look as acceptable as possible (the major flaws with it being beyond redemption), but some people (and I'm included in their number) frankly couldn't be arsed about r_shadows.

Now, it's a strange thing among certain Quake players, but they seem to love those cheesy, hacky and unstable "not very robust but cool to look at" (John Carmack, 1996) GLQuake effects. Even if there are obvious flaws with them, and even if other games before and since have done them much better, they still want to see their crap shadows, they want to see their crap mirrors and they want to see their crap fog. The fact that DirectQ can run Masque of the Red Death at 200 FPS, fixes the rubbish GLQuake sky and water, and restores the old classic underwater warp doesn't seem to matter much to this kind of person. No crap mirrors - DIE!

OK, enough of that. If you're one of those people I obviously don't include you among those I'm complaining about! But if you couldn't give a flying one about r_shadows there is a 10-15% performance gain to be had from not even creating a stencil buffer in the first place - even with r_shadows 0! I think you deserve to have that performance gain, so you're going to be able to get it.

On the other hand if you do care about r_shadows, there is still a performance gain to be had by not using a stencil buffer and drawing the shadows opaque black. Not as much (drawing the shadows adds overhead) but worth getting. So you should be able to get that too. Finally if you want an intermediate level of shadowing with the stencil buffer used to draw them, you should also be able to get that.

However, at the end of the day it is my engine, and I'm the one calling the shots here, so the default mode is going to be a fast one that doesn't have a stencil buffer. I expect you all to remember that and not come complaining to me when your shadows look crap later on. :)

So that's today's "spare time" project, and I'm currently carefully crafting the code that will let you do all of this, as well as cleaning out some accumulated legacy junk that was originally written to resolve problems that I've since resolved elsewhere in a much more elegant manner.

It should be fun.

0 comments: