Water Shader Flicker

Hey guys.

I’m having a problem that I’ve never encountered before, nor have a definite cause or solution. In short, the water in one room in one of my maps is flickering oddly when viewed at certain, specific angles. Here’s a video.

Here are some of the things I’ve tried:

  • Tweaking/redoing the water brush geometry
  • Toying with water_lod_control
  • Changing textures
  • Modifying texture size/lightmap scale
  • Disabling world detail visgroup to troubleshoot (i.e. no props/func_details, problem still occurs)

Anyone have a clue why this is happening? I’ve looked around and asked around to no avail.

I’ve had this problem before with counter-strike source mapping, and it was a pain. Here’s a few other things to check that you didn’t mention, and while they seem basic, could be your problem.

  • Have you made your water brush from completely textured nodraw except the top surface?
  • If you’ve placed a env_cubemap entity over your water brush, is it about 64 units or so and actually assigned it to your water face?
  • Have you checked if you have any leak around?

Also, if you have more than one water brush you could try clicking one of the textured water faces, and while the Face Edit Sheet is open, use Alt + Right click to texture the adjacent ones, select them all and then click ‘Treat as one’ and ‘Fit’.

Most of that is the first stuff I checked. Thanks, though.

Anyway, I figured out the issue a short while ago. Apparently another place where I used water in a different part of the map was breaking it. I am confuse.

Hammer confused u!

you can’t have expensive water in two parts of the map, unless the water height is exactly the same all across the map, even Valve had to use cheap water in some areas because of that

Oh, wow. I’ve never learned that. Thanks! :slight_smile:

Actually, you are allowed to have multiple expensive water heights in the same map as long as the two heights are not in the same PVS. This is because expensive water reflections are essentially everything that is above the water’s surface, but rendered twice (with one of the views flipped upside down). If you have multiple expensive water heights in same PVS, then the engine needs to render the above-water geometry more than twice, which is for obvious reasons very undesirable.

So to prevent massive video lag, Source will simply refuse to render the reflections if multiple water heights enter the current PVS. That would explain why the reflections only flickered and disappeared when you looked at certain angles.

Tl;dr you’re allowed to have multiple expensive water heights, as long as it’s completely impossible to see both water faces at the same time.

Founded in 2004, Leakfree.org became one of the first online communities dedicated to Valve’s Source engine development. It is more famously known for the formation of Black Mesa: Source under the 'Leakfree Modification Team' handle in September 2004.