News | Forum | People | FAQ | Links | Search | Register | Log in
Real-Time Vis = How?
Interpret byte-code. No problem. Unwind brushes. Ok. Point-polygon collision? At the end of the day, that one isn't so hard. Physics, manageable.

Real-time vis? I don't even know how to begin to develop a plan for that.

Yet somehow has to know how this can be done, Saurbraten did it, right? What are the fundamental concepts in developing a strategy for visibility?
First | Previous | Next | Last
 
Or even Q3BSP and manually creating portals.

OK, OK, I'll stop it. 
 
How many entities are actually doing anything each frame? Most monsters are standing around waiting for the player to show up.

And how do they know that the player's shown up? By doing a vis test, that's how (like I said, look at PF_checkclient and PF_newcheckclient, both of which use the PVS). So if you run with the "just draw everything" approach, ignoring vis data, then that vis test will always pass. And then they're no longer just standing around doing nothing. 
Network Traffic 
Testing e1m2 with protocol 666, the network traffic difference is a factor of 10. 
 
"And how do they know that the player's shown up? By doing a vis test, that's how (like I said, look at PF_checkclient and PF_newcheckclient, both of which use the PVS). So if you run with the "just draw everything" approach, ignoring vis data, then that vis test will always pass. And then they're no longer just standing around doing nothing."

Sure, but then you come up with a different method. :)

I'm just noodling around the ideas here. I think VIS was great 20 years ago ... not sure there aren't better solutions these days. 
 
"Testing e1m2 with protocol 666, the network traffic difference is a factor of 10."

This only affects people playing across a network and ... well, I guess both of them would have to find a new hobby or something. :P 
 
I guess where my brain is heading is a thinking exercise for engine programmers ... what if VIS didn't exist? Go. 
 
I guess where my brain is heading is a thinking exercise for engine programmers ... what if VIS didn't exist? Go.

Just to be clear are we talking about something that requires no pre-processing step? Also, how much work should the designer have to do? 
 
I don't know. I think anything is fair game ... LDs placing portals or totally automated. It's just interesting to think about. 
 
I always thought Doom 3's system was pretty decent - designer places the portals, and the compile time is measured in seconds. 
Although 
concerning bsp portals, the phrase "good luck with that" comes to mind once you get into the realm of Tronyn-style monstrosities (and I don't mean that word in a negative way). 
 
kinn, doom3's system is fucking horrible. try portaling anything that isn't room-corridor-room and there's no fucking way.



Run the existing vis algorithm as the map is played? In the first few unrendered spawn frames, vis only the leaf the player is in, assume all other portals closed. All the right monsters will still wake up, because portal visibility is a symmetric relationship. Keep up with the player's current position vising one leaf at a time as he runs around, use any spare frames to follow the bsp structure outward to try to keep ahead of him. Cache it all to the same PVS structure. Areas that players or monsters never go will get skipped naturally.

Then, if you've still got a poorly build monstrosity of stupidity that would have taken six hours to vis, the framerate will just be bad :P 
 
kinn, doom3's system is fucking horrible. try portaling anything that isn't room-corridor-room and there's no fucking way.

I guess it is. I never tried doing anything fancy (layout-wise) when I was tarting about with D3. 
Lol 
this thread is awesome... it's probably my utter lack of knowledge on this subject that makes my maps such technical problems for vising (and despite the time-sink of trying to finish a degree, I hope to put out a couple more visbreakers yet...). 
I Had An Idea Once... 
...to run vis using hardware occlusion queries at load time, rendering to a lower-res offscreen surface (you'd actually need a cubemap (or 6 renders) because vis is agnostic to orientation), which should have substantially speeded things up, as well as successfully dealing with map layouts that aren't amenable to the standard software vis.

A typical modern GPU that can handle Quake at 1000+ FPS should easily be able to crunch through most maps in seconds. The whole "portal flow" paradigm just doesn't scale, and the simpler option of "build a depth buffer and do a depth test" is more robust in the face of geometric complexity in a way that portals aren't.

The only gotcha lies in the fact that occlusion queries work from a single point, whereas leafs occupy a volume.

Even so, and if this can be overcome, an offline pre-processing tool using this idea should also work, and remove all of the burden of long vis times.

But the real appeal of run-time vis is being able to dynamically move around large sections of the world and still have valid visibility. Load-time or even accelerated pre-processing would lose that. 
 
And since we don't have dynamic sections of the world moving around ... 
Slightly Related 
Since we're talking about dynamic stuff moving around, Quake 2's areaportals system would also be a useful addition to Quake, and would give you a good starting-point for run-time visibility. 
That I Would Like 
although, designwise, areaportals are a poor substitute for static limitations in visibility. An areaportal is only a good idea when the player for whom visibility is being limited is the one opening the door. If the thing that's stopping you from seeing into the next room and getting slow performance is just one door, and a monster comes through it while you've got everything in view, for at least part of the time that door effectively isn't there and performance is as bad as if you'd just left it open.

Whenever I get annoyed that I have to still build some kind of visblocker on one side or the other of a door, I remember that that's better design anyway and the lack of areaportals is simply reminding me of that. 
Q2 Bsp Format 
Surface flags instead of alpha entity, r_whatever alpha, and texture naming hacks. Also external textures.

On-topic: DP has built-in vis? Not sure if orealtime. 
 
Sauerbraten's precomputation apparently uses this. http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.31.6463 
 
Thanks for that link and perhaps I can use it to find others like it. 
GPU-accelerated Vis 
I've been thinking more about the idea I mentioned above (using occlusion queries) and it seems to me that something may be possible by using a combination of the world bounds and reducing to the same 16-texel scale as lightmaps.

So what I'm thinking here is to divide the world into a grid of 16x16x16 boxes, then for each box do a Mod_PointInLeaf on the center. If it's in solid don't bother, otherwise run a 6-view-draw with occlusion queries and merge the resulting leafs into visibility for this leaf (which will have been cleared to nothing visible at initialization).

Obviously there are probably edge cases that I haven't fully thought through, but overall this is an interesting enough approach that I might even code something up. 
 
I guess your only concern there is memory usage but these days, who cares? 
 
what about the case where there is a point in between your chosen sample points that can see more than any of the neighboring sample points? That seems like a really common case. 
@metl 
Like I say, I haven't really thought through everything yet. It may be possible to use a finer grid, or you may be able to say things like "if leaf A can see leaf B then leaf B can also see leaf A", or whatever.

I'm not going to let "what ifs" detract from putting together a proof of concept; at the very least I'm interested in comparative performance on a known vis-breaker, and if it runs well enough then it'll be worthwhile putting in the extra effort to deal with this stuff. 
 
Might I suggest a certain UnVISable Qonquer map from the last map jam. :P 
First | Previous | Next | Last
You must be logged in to post in this thread.
Website copyright © 2002-2024 John Fitzgibbons. All posts are copyright their respective authors.