Thursday, March 31, 2011

DirectQ Update - 30th March 2011 (Part 2)

I haven't mentioned it yet, but a few days ago I added in optional dynamic light coronas. you can't really see them too well in a regular screenshot, but here's one anyway.



They're cvar-controlled, of course. I haven't really decided on the best way to handle them just yet, but I'm thinking that something copied from DarkPlaces makes sense; at least it's a well-established standard for this kind of thing. Personally though I would have extended the acceptable values of gl_flashblend to take a "2".

So there are 3 modes for dynamic lights now: coronas-only (just like GLQuake!), lightmaps-only, and coronas + lightmaps. In the third mode the size of the corona is reduced somewhat so that it doesn't overpower the scene and so that you can still see the regular dynamic lightmap update. There are also the usual loads of cvars to make things more user-controllable, all beginning with r_corona.

Whenever I implement (or work on) a feature like this I normally tend to look at all the "magic numbers" that ID Quake uses for it (or that could be used for it) and decide on whether or not they should be exposed via cvars. I think it's nice to give people lots of fine-tuning ability in this way, and it means that whenever anyone asks "is there a way of changing the size/time/number/etc of X" I can normally answer "yes" right away. Most of the time they don't get exposed in menus (an exception is if there's something new that I particularly want to draw attention to) but you can consider them little Easter Eggs for you to find and use.

cmdlist and cvarlist are your friends here, by the way. Give them an optional filename to dump the lists to disk.

Back to the subject of coronas and dynamic lights. You shouldn't consider them to be a viable alternative to regular dynamic lighting that can speed things up: dynamic lighting is already so fast that on most hardware the gains will be marginal at best. So in coronas-only mode they're something you can use if you prefer the old GLQuake look, in lightmaps + coronas mode they're just gratuitous eye candy.

0 comments: