Jump to content
The Dark Mod Forums

Visportals and FOV


SeriousToni

Recommended Posts

As I understand the article right, at: http://www.modwiki.net/wiki/Visportal

 

It says that a world brush will not block the field of view of the player (see right figure on the linked page).

 

Would this mean, that the attached figure is true? (It was created as a illustration of my understanding)

 

And if the Field of view goes through the world brushes, how come a room could be sealed by putting a visportal face into the doorways (if the FOV would still go through the world brushes).

 

It's hard to describe, but I think my understanding of visportals is wrong. :wacko:

 

ATTACHED FIGURE 1 in comparison to A.F. 2

post-3542-0-23201500-1323856540.png

post-3542-0-43032200-1323856545.png

Edited by SeriousToni

"Einen giftigen Trank aus Kräutern und Wurzeln für die närrischen Städter wollen wir brauen." - Text aus einem verlassenen Heidenlager

Link to comment
Share on other sites

It's hard to describe, but I think my understanding of visportals is wrong. :wacko:

 

They aren't that complex. Go ingame and look around with "r_showtris 3" and "r_showportals 1".

 

All the diagrams are correct, except the lower right one. The game will render the middle wall, but nothing behind it, until the visportal. The portion of the upper corridor, which is seen through the visportal is rendered.

 

Simple description:

Visportals are like windows. When attached to a worldspawn wall, only the scene seen through the window (the visportal) is drawn by the game. The worldspawn, next to the window, acts like a wall: it will block visibility. If you remove the visportal (the window) from the worldspawn wall, the game will render everything behind the wall until the next visportal window.

 

Rule of thumbs:

plan your map so that you will have bottleneck areas. Always put VPs in all bottleneck areas of your map. Doors, windows. You will also need to put VPs in corridor corners. You might also wanna check the sound propagation wiki entry.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

The lower-right diagram is correct if you assume the left-hand visportal should be green (open). It will indeed open if it is included in the FOV, irrespective of how much you can actually see through it.

 

Visportals are like windows. When attached to a worldspawn wall, only the scene seen through the window (the visportal) is drawn by the game. The worldspawn, next to the window, acts like a wall: it will block visibility. If you remove the visportal (the window) from the worldspawn wall, the game will render everything behind the wall until the next visportal window.

 

The game actually "processes" (i.e. sends to the graphics card) all of the geometry behind the open visportal, even the parts you can't see. However there is a "scissor optimisation" which means that only the portion you can actually see gets rasterised and drawn on screen. You can see this for yourself if you set "r_useScissor 0" in game.

Link to comment
Share on other sites

In the second example, only the area (room) you're in would be rendered as the portal leading out is not in view.

 

In the last, the outside might not be visible as the FOV is narrowed by the portal when looking through. If the areas of both portals as the camera sees them don't intersect (hard to tell from the picture) it's closed.

Link to comment
Share on other sites

In the second example, only the area (room) you're in would be rendered as the portal leading out is not in view.

 

Actually you're right. I missed that. Only the bottom-left room should be green, the room to the right should be red.

Link to comment
Share on other sites

Also don't forget that VP's can be placed at angles, the only problems I have come across is when I have I have stacked them on top of each other or side my side, for the most the aforementioned methods work, but occasionally you get the old game-freeze or black space where the VP is located. I was also about to say you canit griss-cross VP's but when I worked on the outside area in Winterharvest with SH, his method actually worked and well enough to save an extra 10fps over the usual sides of a box method.

Link to comment
Share on other sites

I think it was mentioned but it would be like this...

 

Think of your line of site as a pole. If it goes directly through the closest portal that will be open. If it can then continue straight through another that will also be open, if not closed.

 

I think it was also mentioned but...

 

If a portal is open everything in that area will be sent to the cue to be ready to be rendered, but only what can actually be seen will be rendered.

 

One thing I noticed at the bottom of the id page.

 

It says test with scissors disabled, but you can also use r_showportals 2 and 3.

3 being everything that is sent, 2 is everything sent with backfacing culled (I believe, just easier to see stuff on screen)

1 would be scissors enable, only drawing lines on what is actually rendered.

post-1981-0-27111300-1323880591_thumb.jpg

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

I agree that it would be good to have a section of the VP wiki entry that covers common questions & clarifications, and have some of these diagrams (the correct ones!) so we can see what's going on, particularly of complex situations with multiple VPs, embedded leafs (rooms inside vs. outside surrounding), overlapping & criss-crossing ones, etc.

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to comment
Share on other sites

Yep, I'm yet to run tests on visportaling myself, so any more info woulndt hurt. I have noticed horizontal portals too, I was wondering how do they work exactly. Could I justt create a visportal plane covering a large area with buildings, and it would effectively hide any objects completely above it (Im guessing the brushwork getting cut wouldnt be affected)? So if someone leaves the door open to a large city area, if you cant actually make visual contact with the horizontal visportal, the top part of the buildings (balconies, details, etc) wouldnt be rendered, right? I was thinking of adding some good amount of detail on some of my buildings, visportaling even by "levels" would be important to keep the map fluid, Im guessing (since Im building it all for the first time, I'll have to try and see how much I can actually get away with as I go).

Link to comment
Share on other sites

Horizontal work fine too, just the same way as vertical. They need to seal on all edges (Which can be tough to do in a city street).

 

Vertical is easier to deal with as far as city streets goes usually. It gets tougher when the player can get up high and 'break' the immersion.

 

----------

One thing I've been meaning to do (been saying this for a long time) is make a demonstration map of ways to seal 'complex' terrain.

 

It's pretty easy, 2 main things you have to realize.

 

1: Sky will always render behind caulk.

2: Func_statics can cross portals (the entire func_static will always render).

 

 

So you can build a roof line 100 units high. (think the triangle peak) and have 40 units of sky space above it (for view, chimneys, etc...).

And you can run the vis-portal up that wall all the way to the sky ceiling. And have a caulk wall that runs across the top of the roof to the back sky wall and it will seal.

Then throw a func_static roof on top of that to hide the caulk and it will look like a really complex area that couldn't be sealed, but under the details it's really basic.

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

So I think that means the player should always be able to climb over roofs from one side to the other, and you can still VP the two sides from each other and not have it kill performance. One thing, though, if you have a func_static roof then it's hard to have an attic in the roof area; then you're back to burying the VP in the roof brushwork if you want both, or just putting space between the ceiling of the attic and the roof and filling it with caulk.

 

We could also use tips and diagrams for designing & VP'ing tricky locations like forests, fields, & clearings, city squares, courtyards (with horizontal VPs), harbors overlooking open water, bridges and canals and rivers... Places like that where it's not immediately obvious under the "traditional rules". One thing that sometimes puts me off trying alt locations is that I don't have a clear idea how to design and VP it.

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to comment
Share on other sites

OK, I made a map.

 

couple things, 1 it was very quick. 2 I didn't put a sky in it, so it's ugly and the caulk walls show up as black not sky. If someone feels inclined they can fix that or whatever. (Also after last ati driver instal I haven't disabled CC, so I was walking on my head, but everything works)

 

It's just a quick example of these things:

==

*How to use func_statics to mask a simple visportal junction.

*How to use func_statics to render things that aren't in your area.

*How to seal under patches that run through visportals.

 

This is the ONLY documentation, if someone wants to wikifi feel free.

==

 

1- Using func_statics to mask simple vis portal in complicated terrain.

 

This shows why it's important to lay out very basic terrain in spots where you can seal the map. Then you can pile on details. But it's real easy to do this ahead of time and add details later. If you get all crazy with details, then try to make a simple seal it can be very hard.

 

Take a right out of spawn. There are two buildings across from each other. They could be 10 feet apart or 40, doesn't matter.

One has a pointy roof, and the roof sticks out over the street. It also has a foundation that sticks out.

The other is a tall flat top building with trims that stick out and a 'balcony'. All of those details are func_statics. It's important to go easy on yourself and have buildings like this NOT be enterable, You can, but that complicates things, keep it simple.

 

If you look in editor the visportal is in a really 'jagged' area. It wouldn't work. BUT, if you filter entities to hide the func_statics you'll notice that it is simply a cube on one side of street and a cube with a wedge on the other. The top of wedge is flat to seal against a caulk brush that runs along the roof line. That flat top is hidden within the pointy func_static roof to look nice.

 

One thing that will cause issues is having a func_static but through several vp's in a row. That doesn't happen in this map, and typically you don't need a lot of vp's in a row anyway, if thought out well there can be plenty of space between them.

 

You also typically don't need huge func_statics that would go through many vp's. We use them here simply for hiding the fact that the vp is in a square hole. It doesn't look square to the player by any means, but that's what it is.

 

==

 

2- Render things that are outside your area.

 

Chimney. The chimney is on one side of the roof, it's behind a wall of caulk and out of view of the visportal. Normally it wouldn't be rendered, so it might be odd to go around the building and see a tall chimney, go back and not see it. Depends on the view.

In this scene it SHOULD be visible from the start area.

So combining it into one func_static with the roof (that crosses several areas) will make the chimney visible from any area that any part of the roof is in. It (chimney) will be seen through the caulk wall in front of it (the caulk isn't in front of the roof which the chimney is part of).

(caulk doesn't block things visually because it simply doesn't render, but it does block things because it seals. Since the chimney is part of the roof it cannot be 'sealed' off with the rest of the area behind the caulk)

 

Tower. Straight across from the start door is a tower. It is completely sealed off from the area the player is in. The problem is, it's really tall and the player should be able to see it. We have 2 choices, the unoptimized it's all in one big area, or view it through a portal which will make it hard to seal from both sides. Or the optimized way, which is to combine it with a func_static that is in the same area as the player. (in this case a cube 'detail' that is above the start door).

 

This is a great way to fake skylines, or use the existing skyline from one area in another. It's not going to add much of a performance hit because it's really only a few tris shared from one area to another. Nothing else in that area will be seen or used (ie: guards, models, etc..).

 

Which leads to the main issue. Objects CAN NOT be shared in the same way. Unless you make a very specific model.

So you can have a giant 5000 unit tower with a clock MODEL on it. The model will be seen in the same area as the tower, but the model cannot be seen from the other side of the city even if the entire func_static tower CAN be seen.

 

You can always fake it somewhat. They player could see the face from a distance, but not model clock hands. And using the same techniques you can layer LOD's (level of detail func_statics) to control what the player sees where.

 

(ie from across the map they see a simple clock face with hands painted on it. It will be super small and they probably won't notice. Then as the get into the same area as the clock the actual face will be slightly bigger than the distance one and cover it up, so up close the player can't see the fake hands, they are hidden under the real face. And there are model hands in front of it (which were always there, they just can't be rendered in far away areas).

 

Of course that brings another issue. Do the hands move? Do you want the player to keep time by this clock tower. That could be really tricky to solve. Maybe simply only have the face of the clock be visible closer, but the back or side of the tower be seen far away...

 

Anyway, back to the map. If you go climb up in this tower you'll notice you can see the chimney here too. That is because the same roof func_static crosses every zone in this map. So the chimney and the roof will always render.

But across from the chimney you can no longer see the details on the tall building. Maybe an issue, maybe not noticeable. If you want that stuff to be seen, combine it into one func_static with the roof.

At some point you have to decide how much you want seen from where. This is a great technique to use for views here and there, but too much of it could kill performance, so you probably don't want an entire map built like that. A section here, a section there. It'll be easier to keep it under control and easier to deal with.

 

Now, from the tower look towards the start area. Yikes, just a big void (should be sky stars at least but I'm lazy). Except, there's a floating cube... That's the cube above the start door that ties the tower to that area. The start room though is not a func_static, it is world spawn so it can't be rendered through the wall.

So it's great to have a tower sticking up to see, but having the player climb the tower can complicate your job.

 

Fear not there is a fix. You can make the start room walls half as thick with the inside of them world spawn. And the outside of the walls can be facades. half thick walls that are func_statics. 'clothes for your wall' if you will.

Again, the main issue would be that if you want a door in that opening it won't be seen from the tower.

But, it is a horrible layout that you wouldn't want to use, but it serves the point that having the player get in every tower might not be a good idea.

 

==

3- Using patches through a portal, sealing under/behind them.

 

Really nothing new here. Patches don't seal the void, so they need worldspawn behind them to seal. They also don't effect vp's so they are also useful for hiding that 'square hole'.

 

http://dl.dropbox.com/u/15441325/vis_portal_tricks.zip

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

@demagogue

 

Take a look at this map, I think it will help some. No horizontal portal but it shows how to 'hide' n obvious square portal hole.

 

I think the main thing Dromeder's have issues with vp's is because of not having to use them. Dromed did it for you. It's definitely the crux of Doom mapping. But with practice it's easy peasy.

 

Dromeders tend to get away with detailing right off the bat because of this. No need to think 'clean'. No need to think in layers really (Of course timing is a layer system that more advanced Dromeders can really master and really is the closest thing to 'proper' build technique in Doom).

 

Still, it doesn't mean you can't detail early, hell I can't build any other way, too much Dromeding I guess. But you do need to lay a simple foundation first, then detail. This can be done room by room, or you can lay the foundation for the entire map THEN detail.

 

But basically you need to build a room or three, or a street with NO details. Just the very simple walls and doorways of the layout. And whatever skybox area you need. Seal up all those doors with vp's and make sure they work. Then detail until your heart's content, staying away from the last doorway into your next area.

 

And you can have an attic the player can go through, and have horizontal vp's on either side of roof. You just have to be clean, snap to grid, look at my map and build the portals to the very simple terrain, then overlay that with patches and func_statics so the terrain doesn't look simple.

 

The main issue with trying to use horizontal vp's in that way is that you need to seal all four sides. That's easy in a courtyard, or a sewer drain. But think of a long windy streets with cross streets. How would you seal a t junction? Better to have say two towers with a low roof between. The player can go from one side of roof to other, the vp can be vertical along the middle of the roof from tower to tower to sky and you have a nice square seal. Then you can have vertical vp's 90* to that one in the street touching the towers going up to the sky.

Then on the ground from one side of the roof the other side of that building would be sealed off and vice versa.

 

You also have to figure that Doom can render 10's of thousands of polys no prob. So having a lot of vp's doesn't matter, it's having ones that work well that you need. Horizontal ones just don't fit into medieval street maps all that well.

 

I think there's a strong misconception that vp's are the main issue of performance when I think it really comes down more to lighting (too many lights per tri) and ai thought process.

vp's can help to close off tris that are too heavily lit which does help, but not having them over lit in the first place is better.

Thinking ai, again comes down to having too many in one area, because they are still thinking even if they aren't being rendered. The ai on the far side of the map is still thinking, that's more intesive then rendering his 5,000 tris.

 

---------

 

To add...

 

It makes me cringe when people say 'bury the vp in terrain'.

 

It's just not needed. All you need is a good snapped to grid square of worldspawn. and a visportal in that. Then you can go crazy with details of func_statics, objects and patches to hide it. burying a vp in terrain and hoping for a seal is just sloppy work.

-----

 

more add...

 

Yeah, see you're naming a lot of areas that just aren't that great for Doom3.

 

Fields, bridges, canals, forests...city squares...

 

Well, OK, city squares is something that does need done and can be. Really you just need to think of everything as dungeons, or hallways. really tall hallways that have buildings at the bottom and sky up top.

 

So a city square could be maybe a large circle room with 3 hallways leaving it. At the entrance to each hall is just a big square and you put a vp in it. Then you hide the square with func_static rooflines and other details.

 

A forest is the same. I don't know if you played Relic:Left4Dead for T2? What I did there was basically had a tons of huge cylinder rooms with tree texture on them (forest texture). Then at the sharp corners where they cut into each other I placed cylinder brushes for sequoias. This helped mask the fact that you were walking through a bunch of round rooms and made it feel pretty organic for Dromed. Then I also added plants and tree models.

I don't think we have a good forest texture but we need one (looks like a wall of trees). Then I used wedges to make the ground uneven.

 

That's the technique you'd have to use. We can't just have one enormous free roam forest. So we have to build walls of tree textures, walls of cliffs, etc... and every once in awhile those walls need to pinch in tight and make a 'doorway' for a vp, then it can open up into another large area. Or you can have the player crawl through a tiny cave or hole between huge boulders.

 

A river canyon would be easy to vp (same thing, it's just a hallway), A harbor would be like a town square, a very large room with water on one side that limits the player from going to sea, and a couple hallways leading into it.

 

The easiest way to vp canals would be to have it go under a building once in awhile. Then you just have a small tunnel to seal at each side, and maybe in the middle.

 

I just don't see anyway you could build a bridge that can be seen from both sides and crossed and still vp it, it would just be in one very large room. So it would be super critical to have some good seals and 90* turns at either side that take you into a tight hallway and seal off that large room as quickly as possible.

Also, my map ^ has some tricks that you could use to see the bridge from other areas of the city, even though that very large room is actually sealed off. But that would be a more skilled endeavor than a lot of mappers could probably handle early on.

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

They really weren't all for me personally, just things I was thinking would be valuable to get wikified. Everything from your last 2 posts should be cleaned up and wikified IMO; good stuff.

 

It makes me cringe when people say 'bury the vp in terrain'.

 

Haha, yeah I know... Actually I learned this lesson in my first FM the hard way; I was burying VPs into walls and crossing my fingers and I got burned by it pretty badly like 3 times in a row, and I swore from then on I'd always plan the VPs to be flush against clean brushwork. Sort of surprising then that I used the term, but just shows you how bad habits dig their way in. :unsure:

If it's any reassurance though, the way I'm actually building nowadays is the right way, all clean & flush.

 

BTW, on forests, I have a pretty big forest area in my T2 FM that no one's seen, and it follows exactly the Left4Dead model, which itself is actually taken from the OM Trail of Blood, massive linking cylinders of "tree/rock wall". I was already thinking the model could be translated to DR petty easily, with the VPs covering the "links".... Although big cylinder walls aren't as straightforward to build in DR as in dromed.

 

Edit: Oh for goodness sake! I forget you're Schwaa sometimes haha. I don't have to tell you where you got the idea for your own FM. :laugh:

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to comment
Share on other sites

Lol, yep same guy. I think I might have ran through trail of blood for inspiration, but never looked at it in Dromed. That just felt like a pretty natural way to do it.

 

(actually, I started of with cubes and was killing myself in just a little area trying to make it natural, that's when I went to cylinders.)

 

Though if i did a similar map in TDM I'd probably just make box rooms out of caulk, then use a lot of patches for all the walls/trees... Could definitely get way more organic and awesome in DR. It could also turn into a lot more work.

 

---------

I'll probably try and do a couple more little test maps. Easy to whip this stuff out in an hour and not really get too involved, but if it helps other people map better it's worth it.

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

One thing I've been meaning to do (been saying this for a long time) is make a demonstration map of ways to seal 'complex' terrain. Then throw a func_static roof on top of that to hide the caulk and it will look like a really complex area that couldn't be sealed, but under the details it's really basic.

A good example of this is version 2 of Rttc, this is where I cut my teeth of Vizportaling.

Link to comment
Share on other sites

Yeah, well that's a prime example of why it's so important to do a very base terrain and layer on it.

 

I went through that map before you and was cleaning it up and I spent a lot of time func_staticing things, finding the base, sealing holes and getting portals to work, because the complicated terrain was what was sealing the void AND causing the portals to not work.

(But Melan decided not to do anything with it)

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

Because the complicated terrain was what was sealing the void AND causing the portals to not work. But Melan decided not to do anything with it.

To be fair, Melan did say at the time he didn't know about VP coming from a Dromeding background. And he has a busy RL, which is why he never got around to doing it.

Link to comment
Share on other sites

The new mappers should learn proper visportal techniques but they should also be aware that some scenes won't always seal where you want via visportals... (and Func_Portals come in handy for those cases...)

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

The new mappers should learn proper visportal techniques but they should also be aware that some scenes won't always seal where you want via visportals... (and Func_Portals come in handy for those cases...)

Be aware though that a portal can be closed, but not sealed.

 

And going back to the diagrams above, you can have multiple VP in a street, and even though they are all open and visable you will still get a perf boost.

Link to comment
Share on other sites

The new mappers should learn proper visportal techniques but they should also be aware that some scenes won't always seal where you want via visportals... (and Func_Portals come in handy for those cases...)

 

The idea is that by informing mappers early, they will know ahead of time what kind of geometry is good for visportaling so they don't get themselves into that situation (without a good reason anyway) when planning their map in the first place. Aka "feedback effects".

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
×
×
  • Create New...