1. Create the room where you want to have the water. Let's make a simple hollow box.
2. The water will be composed by two brushes with two different textures. They could the the same textures but they have to be named differently. Add these textures to the txl archive you are using.
3. Create the first water brush. It has to be a 'solid' brush. It has to be contained by your room and it has to be a little smaller than the room. This will avoid a bad effect because we have to flag this brush as "wavy" (otherwise the wavy effect will "eat" the room brush). Use the first of the two water textures.
4. Create the second brush. It has t be 'solid'. Use the same X and Z dimension of the first water brush. Place it exactly on the top of previous brrush and make it high only a couple of texel. Use the violet 'transparent' texture. Then switch to 'face attributes' (PgDown) and select in the render view only the top face of the second brush, then apply to only this face the second water texture.
Another method that I suggest is to flag this brush as 'sheet'. The top will become yellow. Flip the brush using the "right click/Rotate45°" xommand until the yellow face is on the bottom, then move the brush 3-4 texel up. This should make the work of the engine easier.
5. Let's tune this water! select the first brush and flag it as 'empty' and 'wavy'. The second one must be only 'empty.'
Select again the first brush and go to the 'face attributes'section. this brush must be 'transparent' with a 'transparent value' of about 150. I use a draw scale of about 0.5 and I flag it as light with a value of 3000 (this could be optional). Click 'Apply'.
The second brush instead must be 'transparent with a value of 90. The draw scale is fundamental: I set a value of about 10. This will affect the wavy effect in the surface so changing this paramenter the waves will be larger or smaller (I suggest a value between 4 and 15 for a texture of 128x128). Click 'Apply'.
I didn't find a way to have a correct mirror effect with this attributes so I simply don't use any mirror effect and I suggest you to do the same.
6. Create an Echaos Entity and a Textureproc Entity.
7. Echaos Entity.In the AttachBmp parameter put the name of the first water texture.
MaxXSway:20
MaxYSway:20
XStep:2
YStep:2
I used this parameters to have a water fast enough to match the textureProc effect. If you set a lower value for the 'draw scale' of the two textures you will probably need a different Sway/Step value to have a faster or slower effect and larger or smaller. If you set the sway asimmetrically you can simulate the direction of the fluid.
8. TextureProc Entity. In the szTextureName put the name of the second texture.
szProcName: Water
Setting a DistanceFlag is up to you.
This Procedural effect takes no paramenter. To control it, change the 'draw scale' of the second texture and his transparency. For the scale is so high, consider to use a clone of the first texture scaled down to a size of 64x64 (no more than 128x128). I hacked the source to have a longer effect, changing in PrecWater.cpp, but with the existing parameter it should work well.
Code: Select all
CalcRippleData(Page1, Page2, 6, Water->Width, Water->Height);
10. Put some lights in the level. Choose a blue color for the lights on the water. The water looks better if it isn't completely lighted. I suggest you also to place an Audio3d entity with a water sound.
11. Compile and enjoy!
Screens.
Video:
http://www.youtube.com/watch?v=TrocWUnVvpQ and http://www.youtube.com/watch?v=CPnDsm2q07U