In this tutorial we will learn how the so called wotLK procedural water works, and how to activate it.
This water was added to the game files in patch 3.0 for internal testing only, so keep in mind that it's not perfect. It's called procedural but actually isn't, because nothing is created algorithmically, it's just a group of textures that interact with each other and give a nice visual effect.
There are some patches available online with this water activated, but most of them have errors or look bad (based on my own judgment). We will also learn how to improve it and customize it.
Step One - Editing the DBCs
Open MPQ editor and extract the file "DBFilesClient\Liquidtype.dbc".
Convert this file to CSV (you can't edit it directly with a DBC editor for some reason) and open it with notepad.
Each line corresponds to a liquid type. The one with ID 100 is the procedural water. We will do a line swap.
You have to delete these entries: 1 (Water), 2 (Ocean), 5 (Slow Water), 6 (Slow Ocean), 9 (Fast Water), 10 (Fast Ocean).
Now copy the line with the procedural water and give it the same name and ID of the entries you deleted.
You will notice that there are 2 kinds of water: simple water and ocean water.
If the entry has "Water" in its name, replace the "1" in the 4th column with "0". It should look like this:
Also, if the entry has "Water" in its name, go to column 20 and replace "proceduralOceanDepthTex" with "proceduralRiverDepthTex". The game uses a special illumination for the ocean, so this step is important or your water could look weird.
Technically we are done, but there is one last thing we can do:
Go to the column 21 (it's the last texture in the line) and replace "XTextures\ocean\ocean_h.%d.blp" with this transparent texture: "World\GENERIC\PASSIVEDOODADS\ParticleEmitters\DemonGlow04.blp".
Doing so will remove this pointless reflection:
It's quite annoying and unnatural because it goes against the position of the sun. It's better to remove it, but totally optional.
Now you can save your CSV and convert it back to DBC.
Note: you can also swap the wintergrasp and hyjal water if you want. Just check the spell id in column 6.
Step Two - Extracting the missing textures
As you may already noticed, the procedural water uses a few textures that don't exist in-game.
Blizzard tested this new water internally, that's why they never added the textures to the WotLK client, but they are present in updated client versions.
You can download the missing textures HERE.
If you want to extract them by hand, just open an updated wow client (4.x or beyond) and extract the following textures:
XTextures\ocean\basicWaterHeightTex_X.blp ("X" is a number between 1 and 32, you must extract them all)
Rename the folder called "ocean" to "procWater" and it's done. You should have 33 textures, something like this:
Note: the reflection texture has a unique compression and most blp converters can't read it. If you are having trouble trying to convert this image, install BLPView, preview the texture in the Windows preview pane, take a screenthot and paste it in a new document (768x128).
Step Three - Tweaking the Textures
Now you can test the water in-game. If you did everything right, it should be working correctly. BUT it can look much better.
Before starting, it's important that you understand how the reflection texture works. The game only reads the texture if it's 768x128 (width x height). Bigger or smaller images won't work.
The texture is divided into 3 sections:
The 1st section is a panoramic photo, the reflection itself. The texture bends to form a ring around your character (from another point of view, it wraps around a cylinder). Then, the 2nd section of the texture fills the gap at the center of the ring.
The 3rd section overlays all layers. The farther from the center, the more it becomes distorted. Also, it creates some small waves.
Now that we know how it works, let's analyze this image:
This is how the procedural water looks with the default texture. Yes, it looks like radioactive waste. We have a reflective texture with a lot of green, and the 3rd section of the texture overlays even more green, messing the original color of the water (it should be blue, not yellow).
-The first thing we must do is opening the texture with photoshop and removing the sun. Why? Because the water is always reflecting the sun, even at night, and it doesn't look good.
-Then, we must desaturate it. If the image is in black and white it doesn't mess the original color of the water (if the water is blue and your reflective texture is red, you will get purple water). You should avoid using color.
-We can also darken it a little bit and give some yellow to the third section of the texture. This will give us subtle golden reflections.
Now it looks much better.
In case you want to remove the 3rd section because you don't like the overlay reflection or waves, just fill it with black.
You can even make a lot of new water ids, each one for a different zone, with a different reflective texture (you just need to change the texture name in the DBC), or you can make new liquids, as this "mana water":
The "wave effect"
You will notice that after some time the water starts doing some kind of fractal movement, creating a weird wave effect. It can look good in the ocean, but a little out of place in ponds or lakes.
This is caused by texture tiling. In order to repeat the reflective texture, the game tiles it. Since the texture has different contrast levels, it makes an optical illusion similar to a succession of waves:
This effect is hardcoded into the shader (even filling all collumns with 0 in Liquidtype.dbc won't change it), however you can make it less noticeable by using a dark texture with homogeneous contrast, like THIS ONE. You will see less reflections, but the "wave effect" is almost gone:
You can use the default texture for the ocean and the one with less reflections for small bodies of water, but it's a matter of taste.
The ripples are created by the sequence of 32 textures named "BASICWATERHEIGHTTEX". They distort the reflection texture. Each one of them is a frame. Basically these textures are normal maps simulating movement and depth.
You can also try to apply other textures, but I won't get deeper into that, because I think it looks good with the default sequence, and it's quite difficult to make a new animated normal map.
Player wakes and splashes
If you want to update the old wake and splash textures, you have to replace the following files:
Here are some textures I made that match procedural water way better than the default ones:
(You can download them HERE)
Procedural water is brighter than classical water. This is more noticeable at night (specially in places like Theramore or Booty Bay).
This happens because the texture is not affected by the diffuse and ambient lighting (the same occurs with the default water, but since it has transparency and the material beneath is indeed affected by lighting, you don't notice this effect).
There are a few things you can do to counter this issue:
-Darken the reflection texture.
-Decreasing the water color lightness by half in the DBCs (LightIntband.dbc, last 4 IDs, more information HERE).
That's all the basic information you need to know about this "procedural" water. You can also download a few custom textures I made HERE, so you can see how different the water looks with different environments. Feel free to make your own textures and explore this topic even further.
Also, remember that this water is some kind of alpha testing phase for the liquid system released with Cataclysm, so you can find some artifacts like random lines in the ocean.
My goal with this tutorial is to stop people from asking for procedural water mods, it's fairly simple to do it yourself.
If you have more information to contribute, please send me a private message and I will add it to the tutorial.
Thank you. Have fun!