Swimmable Water: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
(use atdm:water_liquid)
Line 12: Line 12:
Draw a brush that is going to be your water volume and texture it with common/nodraw
Draw a brush that is going to be your water volume and texture it with common/nodraw


[It has now been recommended that nodraw solid be used instead of nodraw as sometimes the water fails to function. - Fidcal]


[[Image:Watertutorial2.jpg]]
[[Image:Watertutorial2.jpg]]

Revision as of 13:49, 21 January 2009

written by angua

Create some walls

Watertutorial1.jpg

In this example, I made this little rectangular pool, but you can also use differently shaped structures.


Fill in your water

Draw a brush that is going to be your water volume and texture it with common/nodraw


Watertutorial2.jpg

Create the entity

In DarkRadiant: Select your brush, Click the right mouse button -> Create Entity -> atdm:liquid_water

Watertutorial5.jpg

In the Entity Inspector you can see that the classname is now atdm:liquid_water, and the name atdm:liquid_water_1 (or similiar). It should also have a blue outline in the orthographic view (The XZ Front in this case).

Note: If you use "func_liquid" instead of "atdm:liquid_water", your water will not function correctly. It will f.i. not extinguish flames.

Texture the surface

Select the face that is going to be the surface (CTRL + SHIFT + Click the left mouse button) and texture it with a nice water texture, for example water_source/water_clear.

Watertutorial6.jpg

Do not assign the water texture to the whole brush, or you will see this: (You can also get rid of that z-fighting by dragging the brush into the wall so that it insersects with it.)

Watertutorial4.jpg


Test your water

Watertutorial3.jpg

And there it is!


Current Flow

There is at least one flowing stream surface texture at the time of writing. If you want to create your own variations then just examine that material shader, copy and modify it. Probably it can be used with other existing surface texture images or you can create new ones.

Flow Force

A force field can be placed in water to apply a tangible flow, eg, to push the player and/or other objects along.

See Func Forcefields

Wave Frequency and Direction

You can set the frequency of the surface waves from tiny undulations to large slow ones just by changing the surface texture scale in Surface Inspector. Flowing surfaces such as stream textures can of course be rotated to get the direction you want.

Troubleshooting Problems

Visible Joints Between Water Brushes

If you place brushes of water against one another, eg, along a channel, round corners, to form a canal, etc. and you can 'see the joins' then the most likely cause of the problem is that the surface textures do not align. We are used to aligning static textures but it is not so obvious with the dynamic translucent surface of water that we might not think of it. Just copy and paste shader one of the surface textures to all the others to get the same scroll and scale alignment and it should be OK.

NOTE: If you want to use the NoDraw Solid texture, be sure NOT to use it between water entities, otherwise you won't be able to swim between them.