I don't think I'm going to bother with occlusion testing on the rest of the entities (monsters/etc). Having thought about it, it occurs to me that most of the time these will be moving (not always but it's a good enough general rule) and actively hunting for you if you've been spotted, so the chances of a query result being invalid on a frame-to-frame basis are going to be quite a bit higher (especially as you're also moving).
With static entities (mostly torches) the worst case is that a torch that should be visible won't actually be for about 0.01 to 0.02 seconds, or a torch that should be hidden will be actually drawn behind a block or wall for a similar amount of time.
One thing I think I might do however is test for results every pass through the main loop, not just on passes where something is rendered (Quake renders new frames 72 times per second only). This should be a quick enough operation and might even let the results come in a more timely fashion.
Otherwise the only work that's left is the grunt work of checking if your hardware supports occlusion queries, bypassing the tests if it doesn't, and tying them into the dreaded D3DERR_DEVICELOST situation (although I think I have that covered by having them auto-destruct and re-create on-demand if an unknown error occurs, but I need to be certain).
UPDATE:
I may have found a way to run them on all entities all of the time without any concerns re: visibility. It'll be at least a day now before I can get stuck in again, but I'll report when I'm ready.
Friday, January 15, 2010
The final word on Occlusions
Posted by
mhquake
at
12:04 AM
Subscribe to:
Post Comments (Atom)
6 comments:
What about having it so that the occlusion queries are done only if a monster is idle. Then, when said monster starts moving, drop them.
That might work OK, but having thought about it some more, I may have found a way to do them all the time. :)
Woohoo! You're like Tony Stark/Iron Man with this thing, constantly tweaking and upgrading it. Damn... is there even any of the original Quake Source left?! It's going to be the most optimized Quake Engine in the world!
Coranth, I agree! I've asked before: where is the PayPal donation button?! Even the mad scientist deserves a free drink every now and again! :)
I'll pay for my own beer thanks very much. :D
For me it's a huge reward just seeing you guys downloading and choosing to use my work. That means more than anything else, and I seriously do not need any monetary or otherwise payment. I don't have to do this, but I do it for fun and I enjoy unleashing my stuff on the world. That's more than enough.
Off topic, but you should really make a nightly build system for this. :)
- c0burn from i3d
Post a Comment