Using DispGen to Make Terrain

- By BigBangQuint
This tutorial was last updated on Jun 26, 2006.

This tutorial will cover making displacements out of greyscale images using DispGen, made by Cannonfodder. We will begin making an image, I'm using Photoshop but you could use any other program aswell. DispGen is supposed to be able to open 16-bit .TIFF, .PGM, .JPG and .BMP files. However I will be using the .PGM format because that requires no further variables to set.

Click here to see the graphic for steps one through seven.

1. Create a new image. I used 512x512 because I like powers of 2. You could use any size you want, the bigger the image, the more detailed your map will be.

2. For this tutorial I used a big soft brush to cover the edges to make a cliff, note that white is full height and black is the lowest possible (you can set maximum height in DispEd). You will probably want to use soft brushes because hills and cliffs dont tend to be 90 degrees.

3.Go ahead and save it as a .PGM (note: .pgm and not .pbm). Try making the
image name as short as possible and preferrably not to use spaces and capital
letters, DispGen seems to have a problem with all three.

4.Next we will be making a new image for the alpha layer (very handy if you have a big terrain and you dont want to make the alpha by hand). Because I want my hill in the middle to be overgrown and my cliffs to be solid rock I will create the image the following way.

5.I filled my image with pure white (wich will give us full alpha, in my case 100% grass instead of rock). If you cant get what I have, fiddle around with the tolerance and fill up any remaining spots inside your newly created white area with the paint brush.

6.Now to make the aplha layer blend in and out I used Box Blur (Filter/Blur/Box Blur) with a radius of 6 pixels.

7.Save as a .PGM again (see step 3) but now name it something like what I did, aplhaimg.pgm or something.

8.The images are done now.

9.Open up DispGen.

Click here to see the graphic for steps ten through seventeen.

10.Set the brush parameters:
-The size is all up to you, for this tutorial I used 8192x8192x512
-The X and Y triangles define the detail of the brushes, 128x128 is pretty high detail for my size.

11.I would recommend checking "Adjust Terrain to minimize vertical texture stretching (pat. pending)" this makes the textures all just about the same size everywhere.

12."Heightmap File", for this open the first image we made.

13.I would also check "Run Smoothing", this will smooth your image, you could leave this out because we already blurred our image in photoshop, but I do it just to be sure it looks smooth.

14.You can set a material now, but it's less work if you leave this and select all in hammer and then change the texture.

15."Alpha Map", select "Use Image" and browse to the second file we made.

16."VMF output File", browse to where you want to put the result of our effort and name it (for example: C:\\Some_Random_Folder\\the_map_we_made.vmf).

17.I can also recommend checking "Create Skybox", this saves you hollowing a brush :P. If you want to be able to walk on the white part of the image (the highest part of our displacement) make the skybox big enough for someone to walk, for example, if the terrain were 512 units the minimum size for someone to walk in would be 512+64=576.

Here's the finished result:

Click for full size



Still need help? Ask your questions in one of our HELP FORUMS
Post A Comment
Name:
Email: Links Not Allowed In Comments
Comment:
What is the capital of France? Need Help?
All original content ©2006 EditLife.net. All Rights reserved. All files property of their rightful owners.
Get Firefox! Get Thunderbird! Get Notepad++!