Underwater Rendering Issue

Discussion in 'Mapping Questions & Discussion' started by LoftyTheMetroid, Mar 3, 2013.

  1. LoftyTheMetroid

    LoftyTheMetroid L1: Registered

    Messages:
    16
    Positive Ratings:
    0
    Hey all, I'm a graduate student working with a team of students developing a Team Fortress 2 map for a class. We're having a rendering issue that we could use some help with.

    We have an underwater cavern below the center of our map, and there are no issues if the player is above a midsection in the area. However, if the player is low near the ground and looks up, the above geometry doesn't render.

    I've provided some screenshots below:

    Near the ground (skybox shows through):

    [​IMG]

    Moving a little further up, skybox no longer renders, and instead everything is black:

    [​IMG]

    And just above is the "midsection" line, after which the above geometry renders normally:

    [​IMG]

    Looking down from there, you can see where the geometry nicely divides the space into "upper" and "lower" halves. I've tried to draw some lines to point out the exact division, where problems only occur at a height below those lines:

    [​IMG]

    Any help would be greatly appreciated. I'm not terribly familiar with Hammer, but my guess is that it's either a Visleaf issue or I'm missing some sort of water rendering entity. (Or, perhaps I simply misunderstand how water works and have placed improper water brushes in the space...)

    EDIT: I think one of the problems might be that there are water brushes at different heights at different parts of the map. If that's the problem, is there any way around it, or is that a strict limitation in Hammer/Source?
     
    Last edited: Mar 3, 2013
  2. colacan

    colacan L5: Dapper Member

    Messages:
    235
    Positive Ratings:
    66
    Waterbrushes are not an issue as long as they are NOT expensive. Just use the water_2fort texture or something similar for it, not anything that has expensive in its name if you use multiple levels of water in the same PVS.
     
  3. Samniss Arandeen

    Samniss Arandeen L1: Registered

    Messages:
    33
    Positive Ratings:
    7
    To answer your question about water height limitations, no, that is not a hard limit. Cheap water can be at many different heights. However, the expensive, hard-to-render water can't.

    That is all. For now.
     
  4. colacan

    colacan L5: Dapper Member

    Messages:
    235
    Positive Ratings:
    66
    Technically speaking, expensive water can be at different levels, as long as they are not possibly both visible from one place at the same time. (i.e. in the same PVS)
    Also, it's TF2, you should not use expensive water, since it's not a good idea in multiplayer games due to performance drops.
    EDIT: Also, you may not use expensive and cheap water in the same PVS.
     
    Last edited: Mar 3, 2013
  5. duppy

    duppy L1: Registered

    Messages:
    35
    Positive Ratings:
    8
    Valve developer wiki has some info on adding water if you haven't seen it already... Adding_Water
     
  6. Dïcecübe

    Dïcecübe L3: Member

    Messages:
    114
    Positive Ratings:
    31
    Expensive water is, for best performance, used on low-ground water and scenery water. Take the rivers from HL2: EP2 as a exemple. You shouldn't use any water with a expensive water-surface texture on deep water-brushes.
     
  7. LoftyTheMetroid

    LoftyTheMetroid L1: Registered

    Messages:
    16
    Positive Ratings:
    0
    Thanks for the responses! I'll boot up Windows/Hammer and try switching out the water texture.

    I actually don't need/care about expensive water, I just went with one that seemed appropriate for the environment and didn't have "expensive" in the name. (I think it's the Sawmill water...?) I bet that's the issue, I'll look for a cheap substitute.
     
  8. LoftyTheMetroid

    LoftyTheMetroid L1: Registered

    Messages:
    16
    Positive Ratings:
    0
    Sorry for the double-post, but I wanted to give a quick update.

    First, I tried switching the water texture to something "cheap", so I used the suggested water_2fort. However, I was still getting the same problem, so I made a test project to isolate the issue.

    Below are two screenshots from the test project, which has two separate height levels for the water. (And yes, I'd like to keep this aspect of our map if possible, it factors into the map layout and gameplay.) From one side, within the brush with the lower water level, there are rendering problems. From the other side, within the brush with the higher water level, there are no rendering problems. According to the rules linked here, there shouldn't be a problem, right...?

    Within lower water level brush:

    [​IMG]

    Within higher water level brush:

    [​IMG]

    I've also got the test project VMF I used if anyone wants to take a look.

    I was able to eventually address the issue somewhat by including a water_lod_control and setting both values to zero, but of course it doesn't look super great. Is this what was meant by "cheap" vs "expensive" water? I thought it was referring to the textures themselves, which I assume are inherently "cheap" or "expensive" (i.e. water_2fort is cheap, whereas water_sawmill [which I was using previously] is expensive). If this isn't true, I must be misunderstanding how water rendering works.
     
  9. Samniss Arandeen

    Samniss Arandeen L1: Registered

    Messages:
    33
    Positive Ratings:
    7
    It is. Expensive water is supposed to be super-realistic. TF2 doesn't do realism and it sure as hell could use the render cost savings. Textures have cheap/expensive in their names to denote what they were created for, actual expense is at water_lod_control.

    That is all. For now.
     
  10. LoftyTheMetroid

    LoftyTheMetroid L1: Registered

    Messages:
    16
    Positive Ratings:
    0
    That makes sense. I've known/heard about cheap/expensive water in the past, I just always assumed it was an inherent texture thing.

    I'll go ahead and throw the water_lod_control in the map and let my students know what's going on with the water. Thanks for the help, everyone.