Visibility of entities through skyboxes?

Discussion in 'Mapping Questions & Discussion' started by phi, Jul 13, 2012.

  1. phi

    aa phi For Whom The Sorrows Sing

    Messages:
    786
    Positive Ratings:
    1,479
    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:
    [​IMG]
    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?)
    [​IMG]
    Here it is from up close to the edge of the skybox (notice that barely anything shows up)
    [​IMG]
    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.
    [​IMG]

    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)
     
  2. Kill_the_Bug

    Kill_the_Bug L14: Epic Member

    Messages:
    1,454
    Positive Ratings:
    234
    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
     
  3. phi

    aa phi For Whom The Sorrows Sing

    Messages:
    786
    Positive Ratings:
    1,479
    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)
     
  4. henke37

    aa henke37

    Messages:
    1,832
    Positive Ratings:
    420
    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.
     
  5. Ravidge

    aa Ravidge Grand Vizier

    Messages:
    1,544
    Positive Ratings:
    2,492
    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
     
  6. LeSwordfish

    aa LeSwordfish semi-trained quasi-professional

    Messages:
    4,102
    Positive Ratings:
    5,982
    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.
     
  7. xzzy

    aa xzzy

    Messages:
    815
    Positive Ratings:
    393
    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.
     
    • Thanks Thanks x 1
  8. Ravidge

    aa Ravidge Grand Vizier

    Messages:
    1,544
    Positive Ratings:
    2,492
    We are so helpful! Go team tf2m!
     
    • Thanks Thanks x 1
  9. Tarry H Sruman

    Tarry H Sruman Large Orphanage Proprietor

    Messages:
    871
    Positive Ratings:
    820
    [​IMG]
     
    • Thanks Thanks x 1
  10. phi

    aa phi For Whom The Sorrows Sing

    Messages:
    786
    Positive Ratings:
    1,479
    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.)
     
  11. tyler

    aa tyler snail prince, master of a ruined tower

    Messages:
    5,031
    Positive Ratings:
    3,975
    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.
     
  12. phi

    aa phi For Whom The Sorrows Sing

    Messages:
    786
    Positive Ratings:
    1,479
    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.
     
  13. Ravidge

    aa Ravidge Grand Vizier

    Messages:
    1,544
    Positive Ratings:
    2,492
    decompiles often mess up areaportals.

    load the map ingame and use r_drawportals 1
     
  14. phi

    aa phi For Whom The Sorrows Sing

    Messages:
    786
    Positive Ratings:
    1,479
    Oh, well that makes sense then :M
     
  15. xzzy

    aa xzzy

    Messages:
    815
    Positive Ratings:
    393
    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.