Visibility of entities through skyboxes?

phi

aa
Nov 6, 2011
832
1,815
Alright, so I hate to ask a question as it's probably been answered before (and I like to figure everything out myself...) but I have a problem with controlling visibility of objects seen through a skybox, i.e. skyboxes like the ones that separate the stages of Dustbowl.
Basically, there are func_details, prop_statics, and info_overlays that can are on one side of the skybox that are visible from the other. Now I'd like to know how to make it so that all these objects can be seen either in their entirity (without causing optimization problems) or not at all, because this is awkward.
Pictures:
Here is the structures:
2012-07-13_00001.jpg

Here's the schematic from an average viewpoint, notice that only a certain portion of it is visible (also note the areaportal on the left, should that be there?)
2012-07-13_00002.jpg

Here it is from up close to the edge of the skybox (notice that barely anything shows up)
2012-07-13_00003.jpg

And here it is from very far away. Note that the smokestacks are still visible on the left but the machinery on the right (along with the arctitecture) is not.
2012-07-13_00004.jpg


Is there properties of skyboxes I should know about? Depending on distance, certain entities behind it flash in and out of view.
Any suggestions? (Leave discussion of the detailing in the maps' thread, please, this should only be for this quirk)
 
Oct 6, 2008
1,947
445
Are you using the 3d type or just a brush with the skybox texture.

if 3d - try it this way:

Hide you map - build your sky box - shift drag copy it - scale it down - scale down textures - destroy original skybox - unhide map - make sure there's a brush with skybox in between each level and compile - run map

See if that helps
 

phi

aa
Nov 6, 2011
832
1,815
No, the area with the geometry is in-bounds and the player can access both sides of the "skybox" (like in Viaduct). The skybox is a brush located over the buildings to "split" the areas, like Viaduct/Badlands.
EDIT: (The smokestacks may be moved to a 3d skybox later, but the actual func_details in playing area can't be seen from certain views as well)
 

henke37

aa
Sep 23, 2011
2,075
515
This is caused by the skybox brushes blocking visibility of the visleafs the items are in and thusly the contents of the visleafs the skybox hides not being drawn.

The solution? Fuck if I know.
 

Ravidge

Grand Vizier
aa
May 14, 2008
1,544
2,818
skybox brushes block vis.
They are always "see-through", in the way you think of it.

The only reason you don't "see through" them all the time, is because of how your visleaves are set up.
Because they (skybox) cut vis while being invisible it can cause situations where geometry and props behind them flicker into view. If you can see things through them that means you haven't optimized enough. Simply because you're actually rendering the things in that other area from your current position.

Typically you want to optimize your map/visleaves so that things behind the skybox brushes never ever render through them.
Things that should be "always visible" from across areas should be placed in the 3dsky (as it always renders, no matter what).

Example of this is the radio tower on Gravelpit cp A.
The stuff above the radar dish in Hydro
 

LeSwordfish

semi-trained quasi-professional
aa
Aug 8, 2010
4,102
6,597
The issue is that skybox brushes CUT vis, but dont block it. Like Nodraw. Build a box of skybox and put a prop inside it and the prop wont be visible, because your vis cannot see its vis, because its in a box. Build a wall of skybox, and put a prop on the other side of it, and the game calculates whether the prop should render or not based on that.

Solution, briefly, is to ensure that those props arent rendering fom that position, in the same way as you would any props, with optimisation. Hint brushes and areaportals and such.
 

xzzy

aa
Jan 30, 2010
815
531
Skyboxes break vis, so if you want to see things behind your skybox brushes, you have to come up with a way to tweak the vis calculations to get those objects rendered.

Valve does this on Dustbowl by putting props in the 3d skybox.

Viaduct does it by putting slits in the skybox and marking them with hints to avoid rendering the whole map all the time. It's a really neat solution, you should open up the vmf and study what they did.


Another trick you can try is using a quirk of func_details.. if any part of a given func_detail is in the PVS, the entire func_detail will be rendered. This means you can plop a roof func_detail right over the top of your skybox brush, and the whole thing will be rendered properly even if it's hanging out into the void.

Obviously you have to be a little careful doing this or else you will be rendering more than you bargained for, but it is an option.
 

Ravidge

Grand Vizier
aa
May 14, 2008
1,544
2,818
We are so helpful! Go team tf2m!
 

phi

aa
Nov 6, 2011
832
1,815
Thanks for all the suggestions, guys.
I figure I'm going to experiment with slitted skyboxes and hints at various positions to try to get the best optimization and visibility out of my map. I'll be experimenting with occluders as well like Viaduct but I'll most likely leave them out until beta-ish.
(While browsing through Viaduct I noticed that it didn't have a single areaportal. Are they really necessarily for a map its size? My map is about its size and I use them.)
 

tyler

aa
Sep 11, 2013
5,102
4,621
I'm a big fan of Viaduct's optimization. I'm on my phone or I'd double check but I'm pretty sure it has areaportals in the gates building. The rest of the map is basically a func_detail so areaportals aren't usable.
 

phi

aa
Nov 6, 2011
832
1,815
There are no func_areaportals or -windows in Viaduct, I can testify that.
I see what you mean, though, Viaduct is definitely a wonderfully optimized map that I will take note of for future reference.
 

Ravidge

Grand Vizier
aa
May 14, 2008
1,544
2,818
decompiles often mess up areaportals.

load the map ingame and use r_drawportals 1
 

xzzy

aa
Jan 30, 2010
815
531
If you do emulate viaduct's optimization, one recommendation I have: make additional skybox brushes that "seal" the slits you create, and put these extra brushes in their own visgroup.

When you need a faster compile, enable the visgroup. Otherwise disable them.

Important because cutting those holes will seriously crank up your vis calculation times, and if you're working on lighting or something where you don't need to see long distance stuff, it'll really speed things up.