A nice improvement has just gone into dynamic light handling. DirectQ will now move each dynamic light into the same space as the brush model entity it's (potentially) affecting before calculating the light contribution, meaning that dynamic lights are applied properly to moving brush models.
You can see this in e1m1 if you ride the first platform down to the open area. Fire your shotgun at the top of the platform and it's lit properly; fire it at the bottom and it's not. Well, it wasn't, because now it is. (You can also see it by riding the plats in e3m4.)
This was something picked up from the RMQ engine, but was able to be somewhat simplified as DirectQ doesn't attempt to light BSP brush models (RMQ does, with varying degrees of success).
I also got rid of some heavyweight CPU-side checking in these functions; it's marginally faster to just update the lightmap.
An idea I have brewing is in relation to entity lighting. Here we have more CPU-side checks and calculations for the light level; it strikes me that instead of doing some of that I can just store a lightmap texture number and the texcoords to be used, then sample the lightmap in my pixel shader. That will give identical lighting to the world and with better quality too (a lot of special case crap will just go away too).
There are some complexities to be worked out here; the surface beneath the entity may not be in the PVS, in which case the lightmap will need updating separately. There's also the case where an entity may straddle the line between two surfaces, although I'm not certain if that's such a big deal.
This is one for trying out first in my experimental engine, I think.
Wednesday, January 4, 2012
More DirectQ Lighting
Posted by
mhquake
at
1:42 AM
Subscribe to:
Post Comments (Atom)
3 comments:
Will BSP2 be incorporated to Direct?
dear mhquake creator. i want directq can works xp! i have one computer in there is quake i love this port its very meganice1
BSP2 will be incorporated but the RMQ engine has first dibs on that feature and I'm not going to add it to DirectQ before the next RMQ demo comes out. This is in the interests of fairness and of doing what I believe to be the morally right thing.
Current versions of DirectQ do wot=rk on XP. I can't make guarantees about future versions; XP is an 11 year old OS and I no longer have an XP machine to test on.
Post a Comment