Water analog not working properly

Any aspects of level design for the Source engine.

Water analog not working properly

Postby FPSMoto on Fri May 16, 2014 5:24 pm

Hi,

I'm adding water to my map that I can raise/lower the level of to flood the bottom floor of my map. I got all that working, the water raises and lowers as it should, but it becomes less than one unit thick so if the flooded water is high enough, I can walk or crouch underneath the water that is raised and it no longer feels like I am underwater.

Screenshots:
Image
Image

I know only certain types of water textures are meant to work with this entity but I've tried a few different known safe textures and got the same result. Any idea how I can fix this? I've even considered making a regular water brush as a func_brush and parenting it to the rising water but I'm not sure if that would cause issues.
User avatar
FPSMoto
Member
Member
 
Joined: Wed Nov 06, 2013 5:26 am

Re: Water analog not working properly

Postby Riomaki on Fri May 16, 2014 5:41 pm

From my experience, all of the "safe textures" for Half-Life 2 pretty much suck. What I ended up doing was making my own material based on the Refract shader instead of the Water shader and then applied it to a func_water_analog. I basically followed this tutorial to create the texture and then created a couple material files that used it. Though they are Refract shaders, they are sort of hybridized to have the water and fog settings. So, when you're underwater, you get the fog effect and when you're wading through it, you get the normal water effects. The only consequence of this is that they don't reflect the world, but I kind of liked the distortion effect.

The reason I used a func_water_analog instead of a func_brush, despite it not using the water shader, is because without it, I couldn't get the splash and gameplay effects to appear.

In my case, ft_water_01.vmt is the material applied to the top of the func_water_analog. You can remove the part about TextureScroll if you don't want it to scroll.

Code: Select all
Refract
{
   "$normalmap"      "nature/ft_water01"
   "$refractamount"   .08
   
   "%compilewater"      1
   "$surfaceprop"      "water"
   
   "$bottommaterial"   "nature/ft_water_beneath01"
   
   "$fogenable"      1
   "$fogcolor"         "{31 36 55}"
   "$fogstart"         0.0
   "$fogend"         150.0
   
   "$abovewater"      1

   Proxies
   {
      TextureScroll
      {
         "texturescrollvar"      "$bumpTransform"
         "texturescrollrate"      0.4
         "texturescrollangle"   270.0
      }
   }
}


And ft_water_beneath_01.vmt is what you see when you're underwater and looking up:

Code: Select all
Refract
{
   "$normalmap"      "nature/ft_water01"
   "$refractamount"   .08
   
   "%compilewater"      1
   "$surfaceprop"      "water"
   
   "$fogenable"      1
   "$fogcolor"         "{31 36 55}"
   "$fogstart"         0.0
   "$fogend"         450.0
   
   "$abovewater"      0

   Proxies
   {
      TextureScroll
      {
         "texturescrollvar"      "$bumpTransform"
         "texturescrollrate"      0.4
         "texturescrollangle"   270.0
      }
   }
}
Riomaki
Regular
Regular
 
Joined: Sun Jul 14, 2013 12:28 am

Re: Water analog not working properly

Postby FPSMoto on Fri May 16, 2014 7:09 pm

Oh nice so I can even make the moveable water scroll too? I wanted to mess around with some neat water effect if the water contained behind that ramp in the first image i posted overflows into the bigger area. I think this info should definitely come in handy. Thank you for these tips!
User avatar
FPSMoto
Member
Member
 
Joined: Wed Nov 06, 2013 5:26 am

Re: Water analog not working properly

Postby Gary on Tue May 20, 2014 3:20 am

If you really wanted dynamic reflection. You could rig up a func_reflective_glass to follow right below the water plane.
Have a question related to modding or something I posted? Something that needs staff attention? I haven't been active lately, but feel free to PM me or message me on Steam(link below)

User avatar
Gary
Interlopers Staff
Interlopers Staff
 
Joined: Wed Dec 16, 2009 12:40 am
Location: USA, FL

Return to Hammer Editor Help

Who is online

Users browsing this forum: No registered users