Left 4 Dead 2

Left 4 Dead 2

View Stats:
How to change water texture flow direction in L4D2?
I'm editing a default water texture (water_swamp_m4) for use in a custom campaign and I'm not sure how to change the direction the water is flowing in. Based on the top-down view in Hammer, the water is currently flowing west-to-east, but I want it flowing south-to-north — to put it another way, it's -x to +x and I want it turned 90 degrees for -y to +y.

I've tried the following things and none of them seem to work:
  • Rotating the water texture in Hammer
  • Rotating the flow map texture (c3m4_hflowmap)
  • Setting the normal map to water_normal_z instead of water_normal_x
  • Adding $scroll1, $scroll2 and a TextureScroll proxy (copied from HL2 water)

Note that each solution was tried separately, so I don't know if a combination of multiple ideas will help me.

Yes, I know I could technically just rotate the level geometry around the water to make it flow in the "correct" direction, but that would be a last resort for several reasons. Any advice?
Last edited by Kyle H. McCloud; Jan 24 @ 5:13pm
Originally posted by AlwaysToast:
Ok, I figured this out at one point. So you are about to benefit from a lot of work I did previously. Starting with the water info. Which eventually gets you to this explanation. If you want to do all the reading.

But the really bloody important thing is this one image. That shows you the color for the flowmap for each direction.

You can make a custom flowmap (which is just a colored image), then make a custom water .vmt which references the custom flowmap.

Basically the colors on the flowmap tell the water in which direction they should flow on that part of the texture based on the color. So to get all the water flowing in one direction you just need a texture that is all one color (and the color tells it in which direction to flow) (I used 32x32 pixels, but 16x16 pixels should also work). If you want to make a complex flowmap you need a bigger image, but if the flow is uniform across the entire texture the size doesn’t matter. I basically made a flowmap for every major direction while I was figuring this out.

So I made a texture .vtf named water_flow_control90_n (to tell me it was 90 degrees from 0,0,0 and I think of that as north. (and oh thank god I labeled my files properly and could find the originals). I used 127,255,0 for the color (bright green) covering the entire image. I got the color value based on the one image the explains which color applies to which direction.

Then just make a .vmt which is a copy of the .vmt of the water you want to use, give it a unique name, and replace $flowmap with your texture.

$flowmap "custom_texture_file/water_flow_control90_n"
Or whatever you named it.
< >
Showing 1-2 of 2 comments
The author of this thread has indicated that this post answers the original topic.
AlwaysToast Jan 24 @ 6:38pm 
Ok, I figured this out at one point. So you are about to benefit from a lot of work I did previously. Starting with the water info. Which eventually gets you to this explanation. If you want to do all the reading.

But the really bloody important thing is this one image. That shows you the color for the flowmap for each direction.

You can make a custom flowmap (which is just a colored image), then make a custom water .vmt which references the custom flowmap.

Basically the colors on the flowmap tell the water in which direction they should flow on that part of the texture based on the color. So to get all the water flowing in one direction you just need a texture that is all one color (and the color tells it in which direction to flow) (I used 32x32 pixels, but 16x16 pixels should also work). If you want to make a complex flowmap you need a bigger image, but if the flow is uniform across the entire texture the size doesn’t matter. I basically made a flowmap for every major direction while I was figuring this out.

So I made a texture .vtf named water_flow_control90_n (to tell me it was 90 degrees from 0,0,0 and I think of that as north. (and oh thank god I labeled my files properly and could find the originals). I used 127,255,0 for the color (bright green) covering the entire image. I got the color value based on the one image the explains which color applies to which direction.

Then just make a .vmt which is a copy of the .vmt of the water you want to use, give it a unique name, and replace $flowmap with your texture.

$flowmap "custom_texture_file/water_flow_control90_n"
Or whatever you named it.
Thank you! That is indeed the solution, it works perfectly.

Funnily enough, I coincidentally discovered this solution all by myself a few minutes before you posted your reply, but I appreciate you typing this up — it'll be a good reference point for anyone who needs this info in the future.

I've created a flowmap texture that's all one color (128 red, 255 green, 0 blue) and Source Engine water has never looked better :praisesun:
< >
Showing 1-2 of 2 comments
Per page: 1530 50