WotLK "Procedural" Water (understanding and improving it)


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.

Tools
-MPQ Editor (or any other MPQ reader)
-Any DBC to CSV converter, such as Wow Parser
-Notepad
-Any BLP converter
-Photoshop (or any other image editor)

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.

cC87I59.jpg
http://i.imgur.com/cC87I59.jpg

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:
a484Hvl.jpg
http://i.imgur.com/a484Hvl.jpg

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.

aJbmEr0.jpg

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".

GOKN7Tb.jpg

Doing so will remove this pointless reflection:
J9kLiar.jpg

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\basicReflectionMap.blp
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:
XTextures\procWater\basicReflectionMap.blp
XTextures\procWater\basicWaterHeightTex_1.blp
XTextures\procWater\basicWaterHeightTex_2.blp
XTextures\procWater\basicWaterHeightTex_3.blp
etc.

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
Reflecting Texture
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:
l4y2yzD.jpg

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.

qFHzBCJ.jpg

Now that we know how it works, let's analyze this image:

qPIg1QX.jpg

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.

d1hb6CN.jpg

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":

LSkEks5.jpg

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:
YUQNGZ3.jpg

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:
rBTYfwy.jpg

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.

Ripples
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.

TOZmgrG.jpg

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.

onHS97a.jpg

Player wakes and splashes
If you want to update the old wake and splash textures, you have to replace the following files:
XTEXTURES\Splash\splash.blp
XTEXTURES\Splash\wake.blp

Here are some textures I made that match procedural water way better than the default ones:
ryGac2t.jpg
(You can download them HERE)

Water brightness
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).

AmFhfPZ.jpg

Conclusion
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!

  • Like 3


Recommended Comments

That's so profound, dude! Really great work. Definitely gonna use the information from here. Worth a contributor ;).
I have a question, though. Did you find anything that might control the "big waves effect", as I call it? Sometimes I like it and sometimes I don't as it might look weird for example on rivers or small ponds.

Share this comment


Link to comment
Share on other sites
3 hours ago, Skarn said:

That's so profound, dude! Really great work. Definitely gonna use the information from here. Worth a contributor ;).
I have a question, though. Did you find anything that might control the "big waves effect", as I call it? Sometimes I like it and sometimes I don't as it might look weird for example on rivers or small ponds.

Thanks for the rank!
Those big waves are related to texture tiling. Basically the game tiles the reflection map. It copies the texture, flips it vertically and attaches it to the previous tile, creating a "wave effect" as seen here:

EUbkXtZ.jpg

It's harcoded into the shader, so it can't be changed. However, you can make a texture with uniform contrast and brightness, like THIS ONE. This makes the effect less noticeable. Sadly, you can't slow down the water movement (even filling all the columns with 0 won't change it's speed), and the texture movement is not only vertical, so you can't get rid of this effect completly.

Share this comment


Link to comment
Share on other sites

The thing is that I don't really want to get rid of this effect completely. It looks so good on the ocean but can look bad on rivers and ponds. So, I thought I could try making different liquid types with different reflection maps. 

Share this comment


Link to comment
Share on other sites
8 minutes ago, Skarn said:

I thought I could try making different liquid types with different reflection maps. 

You can. Almost everything is in the texture. Just make multiple liquids in the dbc, each of them with a different reflection map. You can use the one I linked without big waves for rivers and a the default one for the ocean.

Share this comment


Link to comment
Share on other sites

Is it possible to download the modified .dbc?
(I do not manage to run the .dbc -> .csv converter)

Share this comment


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now