Water in Terrain


(DAbell) #1

I am asking you guys and maybe girls for help on the map i am currently working on, it is my first map so i’m a bit of a noobie. I have created my terrain using height maps and Easygen, i have compiled it and it all runs fine i can enter the map and run around and it looks ok bit bare but ok.

What i have done is in Easygen i have created a ravine which will become a river the only problem is i’m not sure how to go about creating the water. I have read all the tutorials i can find on the matter (not many) and i was wondering how to do it for a winding river through uneven terrain.

Do i just create a large brush that fills all areas of the river bed i have made, this would mean a lot of brush underneath the terrain is this ok.

Also i have seen parts to add to the water shader to create the effect of murkiness where would i add this and how.

I have searched and searched thorugh lots and lots of threads and no real answers are evident to these questions.

I bow down and thank you all in advance.


(Shallow) #2

Surprised you didn’t find anything - there was a fairly detailed thread about this a couple of weeks ago.

If your river is quite windy then you should use multiple brushes, having big areas of water under your terrain will create a lot of overdraw that will slow things down. Use a non-drawing water shader (e.g. liquids_sd/siwa_waternodraw - don’t worry about the missing image thing for this one, it works fine) for all the brushes when you first build them, and once you have them in place texture all the top faces with a drawing water shader.

You can set murkiness by creating a custom water shader with fog parameters in it… IIRC the siwa_waternodraw is also an example of this.


(Danyboy) #3

If you want to be clever you could make another terrain - but make it from water brushes - that way if there were any rocks in river - you could have foam built up around them and normal clear water everywhere else

Battery has this with foam at the water line and where rocks poke up

Dont worry about water deformvetexes - but have terrained river might look very 1337


(MadMaximus) #4

Im not shure if i do my rivers proper either, I do try to minimize the overdraw as much as possible. Here’s a quick example of how i do it.

I 1st layout where my water will sit in caulk brushes, and use a seperate brush for the water, then i make the terrain fit it, but for this example i made the terrain 1st and layed out the water area after.

created the terrain with the river bed and painted it gravel style so i would know where it was oriented.

made the caulk brushes to fit the terrain and added the water brushes to fit the open caulked area’s, i added nodraw to where the seperate water bushes met each other else i would end up with a surface water barrier while swimming, no problem swimming through it, it just doesnt look proper.

finally compiled and it’s done.

for this example i just used a plain water shader for the all 3 water brushes, however the proper way of texturing the water is as Shallow mentioned above, use a waternodraw and texture the top with a visible water shader. hope this helps in some way.


(DAbell) #5

Well you guys have been super helpful i tried your tips as soon as i finished reading your advice works great i made it up out of lots of seperate brushes and also used the clipping to improve the line and keep the over draw to a minimum.

Now i would like to make the water murky like i mentioned before there is a link about adding some extra lines to the shader but how do i do this. i assume you can open the script up in notepad and just paste it in but where do i find that particular script to do that with.

Don’t shout at me if its something that is in the manual i’ve read that thing so many time and its just a bit above my understanding at the moment.

:moo: Worship the cow


(MuffinMan) #6

don’t change the shader itself, never do that with the original files, you need to create a new shader, copy the original and give it an other name, for the water movement I’d suggest a look into the shader manual…


(redfella) #7

Heres a sample code for murky water.

	{
		qer_editorimage textures/liquids/pool3d_5e.tga
		qer_trans .5
		q3map_globaltexture
		surfaceparm trans
		surfaceparm nonsolid
		surfaceparm water
	       	surfaceparm fog
		surfaceparm nolightmap
                	cull disable
		deformVertexes wave 64 sin .25 .25 0 .5	
                	fogparms ( 0.2 0.2 1.0 ) 512

                { 
			map textures/liquids/pool3d_5e.tga
			blendFunc GL_dst_color GL_one
			rgbgen identity
			tcmod scale .5 .5
			tcmod scroll .025 .01
		}
	
		{ 
			map textures/liquids/pool3d_5e.tga
			blendFunc GL_dst_color GL_one
			tcmod scale -.5 -.5
			tcmod scroll .025 .025
		}
	}

Youll obviously need to modify the path names and perhaps some of the values depending on what kind of look you are trying to achieve.

gl