How To Create DuDv Map For Water Refraction With Photoshop And TGAToDUDV Tool

Du/Dv is a derivative of normal map and is usually used for water refraction. In this tutorial, we create a base texture with Photoshop filters, save it as TGA, and generate a Du/Dv map from our TGA file with TGAToDUDV utility.

I was always using NVIDIA Photoshop plugin to generate Du/Dv map. However after installing NVIDIA Photoshop plugin for Adobe Photoshop CS6, I noticed that DuDv function does not work correctly.

Creating The Base Texture

Run Photoshop, open up a new document by pointing to New on the File menu, and set the size of your document and hit OK button. [alert color=”blue”]Because we are creating a texture, it’s strongly recommended to use power of two dimensions for width and height. Otherwise, game engines have to resize texture dimensions at runtime. In the worst case scenario, game engines won’t display textures if you save them as DDS format. I used 512 * 512 dimensions.[/alert] Set the active foreground color to white and background color to black and go to Filter | Render | Cloud menu to generate tileable cloud patterns.

Photoshop-Filter-Tileable-Cloud-Patterns

Now go to Filter | Filter Gallery…, expand Sketch filters, select Bas Relief, and hit OK to apply the filter. You final texture should look something like this:

Photoshop-Filter-Bas-Relief-Cloud

Save your texture as TGA and close Photoshop.

TGAToDUDV Utility

Please download TGAToDUDV Utitlity from their website (it’s right after Usage section). open TGAtoDUDV.exe, locate your TGA texture, and hit OK button to generate the Du/Dv map. A message box should appear saying “success…”. Your new Du/Dv map is saved beside original TGA texture and has the appended _dudv to the end of its name.

DuDv-Map-Texture

I applied Du/Dv Map to water surface in Vanda Engine. Here’s the result:

(c) copyright Zehne Ziba Co., Ltd. For more information, please refer to copyright notice.

adminHow To Create DuDv Map For Water Refraction With Photoshop And TGAToDUDV Tool