by date
Blended Terrain in TGEA from Terragen
Blended Terrain in TGEA from Terragen
| Name: | Russell Fincher | ![]() |
|---|---|---|
| Date Posted: | Mar 15, 2007 | |
| Rating: | 5.0 out of 5 | |
| Public: | YES | |
| Comments: | YES | |
| RSS Feed: | or Subscribe with . | |
| Profile Page: | View profile page for Russell Fincher |
Blog post
My Experience Building Blended Terrains in TGEA Using Terragen
Edit: this plan has now been reformatted as a TDN tutorial for TGEA users.







In-game shots from the GDC demo, sans foliage.
We're just back from GDC '07, where we had a great time. We saw some old friends, made some new ones, learned a lot, and slept little.
Some of you who strolled by the Garage Games booth may have noticed the Forest Technology preview that Tom has been working on over here. I was tasked with building the terrain for that demo and learned a ton in the process, so I figured I'd put some of it down in a plan so others could learn from my experience.
The demo consisted of a 6.5 km island built from a 4k x 4k heightmap, using blended terrain (as opposed to unique terrain) in Atlas. Obviously this is way bigger than most people will ever need for terrain, so keep that in mind. First, a quick overview of my process:
And a list of the files that were created through that process:

Step 1 - Creating the Terrain

Over the course of a couple of weeks I tried every tool I could find. We started with Freeworld but realized that, though it is a simple, inexpensive, and somewhat full-featured solution for creating terrain lightmaps, heightmaps, and diffuse maps, the level of quality of the resulting terrain and maps were just not that great. Also, in our case we needed a 4K height map, which Freeworld simply doesn't support.
. So I decided to do the opacity map creation, initial heightmap creation, and lightmap creation all in Terragen. This was a good move, since we all know how unbelievably good Terragen is at creating stunning, realistic terrain and terrain mapping. I just had to figure out a pipeline for exporting opacity maps and lightmaps from Terragen and use them with blended terrain in Atlas. More on that later on.
. Oh yeah... and it was about this time that we decided to use blended terrain instead of unique terrain. This was kind of a logical choice since our world needed to be 6+ km, and using one single diffuse map for a world that big would look pretty terrible, even with a detail texture, so after tooling around in Terragen and realizing I could use its awesome terrain mapping for opacity maps in Atlas, that was the way to go.
By exporting hi-res opacity maps and lightmaps from Terragen, you can imply a lot of detail that really isn't in the in-game terrain. I started by creating a base terrain in Terragen using it's random terrain generator... just something close enough to what I needed.

I needed to do some custom editing of the terrain, and since Terragen's editing tools are a little slim, I knew I'd need an external editor to tweak a few things. Now there are a ton of apps out there for modifying heightmaps, and most of them are simply awful (edit: see Phil's recommendation of EarthSculptor in the comments below...). However, I found a rather excellent tool for modifying Terragen terrains called Leveller. I love this app. It's solid, versatile, can handle huge files, and has a fantastic toolset (which, btw, is very Photoshop-esque... as an artist, I appreciate that). I know most indies will frown at the price point ($150 USD), but imo Leveller is worth every penny. It imports Terragen .ter terrains, but unfortunately doesn't export them in a file that Terragen can directly use (or at least I never figured it out). Currently the only way is to export a heightmap and import it back into Terragen. But that's a simple enough process.
Step 2 - Exporting Maps for Atlas
Terragen was used to create the opacity maps, lightmap, and original heightmap for the demo. I'll break these down individually.

*Now if anyone more versed at Terragen than myself knows of a simpler way to export opacity maps or lightmaps than this, please post a comment below. Or if you know how to create a Terragen script that would do this automatically, then you'll forever be my hero.

Using blended terrain with opacity maps allows you to get a fairly detailed texture in the ground (see example at right), so we decided to use the detail texture as a broad noise to break up any repetition from the ground textures from a distance. This worked great. Quite the opposite of what it is intended for... to create a tight pattern that adds detail. Below you can see the grass from a distance with and without the broad detail texture:

Step 3 - Preparing Files for Atlas

The 16-bit .raw heightmap was pretty much game-ready. It may have needed to be flipped/rotated in Photoshop. The lightmap was opened in Photoshop, color-adjusted as stated above, and saved out as a .jpg.
For blended terrain, the opacity maps for each surface all need to be pasted into separate channels of an RGBA (standard RGB file with one alpha channel) .png file. I also had to invert the colors. The channels act as masks for the repeating terrain textures which exist as separate .jpgs. This is standard blended terrain stuff.
At this point everything was ready to go!
Step 4 - Skybox Exporting
Just a little note that there is a very easy-to-run Terragen script out there that exports Torque-ready skyboxes without the hassle of manually pointing cameras in the right direction and dealing with lighting and rendering preferences. It batch-exports all 6 sides of your skybox cube all by itself. After attempting to export them manually once or twice, I was elated to find this simple script. Go grab it here
OK then...
I didn't intend that to be so long, but if I can give someone else a better starting point than I had, then it was all worth it. Believe it or not, I skipped over a bunch of little details there. Please post a comment or email if you'd like clarification on anything. A few side notes...
Take care.
Russell Fincher
Lead Artist | Co-owner
Sickhead Games
Edit: this plan has now been reformatted as a TDN tutorial for TGEA users.
We're just back from GDC '07, where we had a great time. We saw some old friends, made some new ones, learned a lot, and slept little.
Some of you who strolled by the Garage Games booth may have noticed the Forest Technology preview that Tom has been working on over here. I was tasked with building the terrain for that demo and learned a ton in the process, so I figured I'd put some of it down in a plan so others could learn from my experience.
The demo consisted of a 6.5 km island built from a 4k x 4k heightmap, using blended terrain (as opposed to unique terrain) in Atlas. Obviously this is way bigger than most people will ever need for terrain, so keep that in mind. First, a quick overview of my process:
- 1) Initial terrain generation in Terragen
- 2) Tweaking terrain in Leveller, exporting heightmap
- 3) Back in Terragen, exporting opacity maps and lightmap
- 4) Prepping of maps in Photoshop
And a list of the files that were created through that process:
- Ground textures - .jpgs of rock, grass, sand, and snow, most created in Genetica 256x256 - 512x512
- Detail texture - noise texture originally created in Genetica. 512x512
- Heightmap - 16 bit .raw file, 4097x4097. This is the file containing height information.
- Opacity maps - Large grayscale maps that mask or reveal a texture on the terrain. 2048x2048, all placed as channels in one RGBA file.
- Lightmap - Large texture that adds ground shadows to the Atlas terrain. 2048x2048

Step 1 - Creating the Terrain
Over the course of a couple of weeks I tried every tool I could find. We started with Freeworld but realized that, though it is a simple, inexpensive, and somewhat full-featured solution for creating terrain lightmaps, heightmaps, and diffuse maps, the level of quality of the resulting terrain and maps were just not that great. Also, in our case we needed a 4K height map, which Freeworld simply doesn't support.
. So I decided to do the opacity map creation, initial heightmap creation, and lightmap creation all in Terragen. This was a good move, since we all know how unbelievably good Terragen is at creating stunning, realistic terrain and terrain mapping. I just had to figure out a pipeline for exporting opacity maps and lightmaps from Terragen and use them with blended terrain in Atlas. More on that later on.
. Oh yeah... and it was about this time that we decided to use blended terrain instead of unique terrain. This was kind of a logical choice since our world needed to be 6+ km, and using one single diffuse map for a world that big would look pretty terrible, even with a detail texture, so after tooling around in Terragen and realizing I could use its awesome terrain mapping for opacity maps in Atlas, that was the way to go.
By exporting hi-res opacity maps and lightmaps from Terragen, you can imply a lot of detail that really isn't in the in-game terrain. I started by creating a base terrain in Terragen using it's random terrain generator... just something close enough to what I needed.
I needed to do some custom editing of the terrain, and since Terragen's editing tools are a little slim, I knew I'd need an external editor to tweak a few things. Now there are a ton of apps out there for modifying heightmaps, and most of them are simply awful (edit: see Phil's recommendation of EarthSculptor in the comments below...). However, I found a rather excellent tool for modifying Terragen terrains called Leveller. I love this app. It's solid, versatile, can handle huge files, and has a fantastic toolset (which, btw, is very Photoshop-esque... as an artist, I appreciate that). I know most indies will frown at the price point ($150 USD), but imo Leveller is worth every penny. It imports Terragen .ter terrains, but unfortunately doesn't export them in a file that Terragen can directly use (or at least I never figured it out). Currently the only way is to export a heightmap and import it back into Terragen. But that's a simple enough process.
Step 2 - Exporting Maps for Atlas
Terragen was used to create the opacity maps, lightmap, and original heightmap for the demo. I'll break these down individually.
- Heightmap - Exporting a 16-bit .raw file as your game-ready heightmap is just a simple export from the surfaces pane in Terragen or, if more terrain tweaking is done in Leveller, then the heightmap can be exported from there.
- Opacity maps - I had 4 different surfaces in my scene: 1) A base rock texture, 2) A spotty grass texture on flat areas, 3) A beach area next to water, and 4) Some snow caps on the mountains. This is where Terragen shines, in my opinion in comparison to Freeworld. The controls you have over the distribution of surfaces (or even default surface settings) are fantastic. So after setting these up to my liking, I would export them by setting all surfaces to white except for the one I'm exporting, which would be set to black. Turning off some lighting parameters and setting up the camera properly would allow me to export a top-down view of the scene that I could use as an opacity map for that specific terrain map in Atlas. I did this for all three non-base maps. (The base map was the dark rock, everything else was distributed on top of that)
- Lightmap - I exported a lightmap using a technique similar to the opacity maps, except I set all surfaces to white, and let the terrain cast shadows, so I'm left with only shadow information. Later, in Photoshop I decided to warm up the light areas by adding yellow and cool down the shadows by adding blue. It gives the shadows in the snow that realistic purple-ish tint.

*Now if anyone more versed at Terragen than myself knows of a simpler way to export opacity maps or lightmaps than this, please post a comment below. Or if you know how to create a Terragen script that would do this automatically, then you'll forever be my hero.

Using blended terrain with opacity maps allows you to get a fairly detailed texture in the ground (see example at right), so we decided to use the detail texture as a broad noise to break up any repetition from the ground textures from a distance. This worked great. Quite the opposite of what it is intended for... to create a tight pattern that adds detail. Below you can see the grass from a distance with and without the broad detail texture:

Step 3 - Preparing Files for Atlas

The 16-bit .raw heightmap was pretty much game-ready. It may have needed to be flipped/rotated in Photoshop. The lightmap was opened in Photoshop, color-adjusted as stated above, and saved out as a .jpg.
For blended terrain, the opacity maps for each surface all need to be pasted into separate channels of an RGBA (standard RGB file with one alpha channel) .png file. I also had to invert the colors. The channels act as masks for the repeating terrain textures which exist as separate .jpgs. This is standard blended terrain stuff.
At this point everything was ready to go!
Step 4 - Skybox Exporting
Just a little note that there is a very easy-to-run Terragen script out there that exports Torque-ready skyboxes without the hassle of manually pointing cameras in the right direction and dealing with lighting and rendering preferences. It batch-exports all 6 sides of your skybox cube all by itself. After attempting to export them manually once or twice, I was elated to find this simple script. Go grab it here
OK then...
I didn't intend that to be so long, but if I can give someone else a better starting point than I had, then it was all worth it. Believe it or not, I skipped over a bunch of little details there. Please post a comment or email if you'd like clarification on anything. A few side notes...
- Sickhead Games is still looking for a programmer familiar with Torque with a knack for physics for a full-time gig. Wanna get in on the indie developer lifestyle, have a say in the products created, and bake in the perilous heat of Dallas summers? Give us a shout. We're considering the intern thing as well. If you even think you might be interested, please send us an email and let's chat.
- I just put up some free 2D art good for casual games on the TGB forums this week. Hope someone finds it useful. (edit: sorry, access to that forum is TGB-owners only... here's a preview for anyone else interested)
Take care.
Russell Fincher
Lead Artist | Co-owner
Sickhead Games
Recent Blog Posts
| List: | 01/28/08 - CrazyBump = Better, Faster Art 10/03/07 - Sickhead Games is hiring! 03/15/07 - Blended Terrain in TGEA from Terragen 10/21/06 - Adventure Kit update 1.1 09/08/06 - Adventure Kit post mortem 06/21/06 - Update: Sickhead TGB Tile Pack 04/18/06 - Sickhead TGB Tile Pack #1 06/06/05 - Plan for Russell Fincher |
|---|
Submit your own resources!| Aaron Ellis (Mar 15, 2007 at 19:55 GMT) |
| Stephan (viKKing) Bondier (Mar 15, 2007 at 20:04 GMT) |
We are far from Geo-Terrain (TGE legacy terrain format).
The result is as good as the process to get it in game is complex...
Thanks for the reading. 8-)
| Phil Carlisle (Mar 15, 2007 at 20:37 GMT) |
| Russell Fincher (Mar 15, 2007 at 20:40 GMT) |
| Dave Young (Mar 15, 2007 at 20:43 GMT) |
| Pat Wilson (Mar 15, 2007 at 21:18 GMT) |
| Timothy Aste (Mar 15, 2007 at 21:45 GMT) |
| Russell Fincher (Mar 15, 2007 at 21:56 GMT) |
| Stefan Lundmark (Mar 15, 2007 at 22:25 GMT) Resource Rating: 5 |
| Affectworks (Mar 15, 2007 at 22:41 GMT) |
Fredrik S
| Jerane Alleyne (Mar 15, 2007 at 23:11 GMT) |
| Anton Bursch (Mar 15, 2007 at 23:19 GMT) |
| Russell Fincher (Mar 15, 2007 at 23:43 GMT) |
Edited on Mar 15, 2007 23:43 GMT
| James Laker (BurNinG) (Mar 16, 2007 at 09:32 GMT) |
| Steve Flowers (Mar 16, 2007 at 11:18 GMT) |
| Dave Young (Mar 16, 2007 at 12:26 GMT) |
| James Brad Barnette (Mar 16, 2007 at 15:28 GMT) |
| Russell Fincher (Mar 16, 2007 at 16:01 GMT) |
Edited on Mar 16, 2007 17:46 GMT
| Florian (Mar 16, 2007 at 17:38 GMT) |
now, if i get to know how to use normal maps of detail maps, that would just be terein heaven:D
| Sean H. (Mar 16, 2007 at 17:54 GMT) |
also, can a blended terrain support multiple opacity maps files allowing more than 4 blended textures?
| Russell Fincher (Mar 16, 2007 at 18:02 GMT) |
Also, I'm just not partial to the traditional 'blurry base texture and tight detail texture' look that one unique map would give. I never thought it was that believable, and it requires every surface to have the same detail texture.
As far as I know, you are currently restricted to 4 blended textures, the four channels in the RGBA file. But this could probably be hacked to provide more. It's just not supported by default.
Edited on Mar 16, 2007 18:07 GMT
| Jeremiah Fulbright (Mar 16, 2007 at 18:18 GMT) |
| Josh Williams (Mar 16, 2007 at 18:37 GMT) |
| James Brad Barnette (Mar 16, 2007 at 18:42 GMT) |
I'm using Vue 5 Infinite to create my terrain.
or maybe it is something I'm doing between photoshop and terragen but I can't get anything usable into terragen.
every time I try to take something into terragen it looks all interlaced and distorted to hell. any pointers you can give on how you are getting files back and forth?
Edited on Mar 16, 2007 19:08 GMT
| Russell Fincher (Mar 16, 2007 at 18:49 GMT) |
Josh: Will do! :)
Edited on Mar 16, 2007 20:24 GMT
| Russell Fincher (Mar 16, 2007 at 18:55 GMT) |

Was the problem you had when you imported your heightmap into Terragen that it was just a bunch of noise, so it created like a thousand skinny peaks?
Edited on Mar 16, 2007 20:28 GMT
| Erik Madison (Mar 17, 2007 at 11:09 GMT) |
| Tom Spilman (Mar 17, 2007 at 15:06 GMT) Resource Rating: 5 |
| Russell Fincher (Mar 19, 2007 at 22:06 GMT) |
It's in the TSEA section of TDN... I'm curious to know if it can be accessed by TGE owners as well...
Edited on Mar 19, 2007 22:08 GMT
| Michael Perry (Mar 20, 2007 at 16:14 GMT) Resource Rating: 5 |
So, since I can't access it I was wondering if you could answer a question about setting up the opacity maps in Terragen?
I've generated the terrain and tweaked the camera/lighting/atmosphere options to get what I think would be acceptable for rendering the proper image. I was wondering what your Surface Map Pane looked like before you exported
Surface Map
|
--base rock
|
--Grass
|
--Beach
|
--Snow
Is that your basic layout? Also, care to throw a non-artist a few sample values used for the Advanced Distribution pane of the surfaces? How about the bumpiness and terrain mimic feature?
The general usage stuff I've been reading up myself, I'm just wondering about those particular settings and how they would affect the final rendered version in the engine itself.
| Russell Fincher (Mar 20, 2007 at 16:45 GMT) |
As far as the Advanced Distribution pane... I gotta tell you, every time I tried to go through those Terragen tutorials, my eyes would start glazing over. I kinda learned through trial and error. But I usually left the "bumpiness" and "terrain mimic" settings at their defaults and pretty much just used "Coverage", "Altitude Constraints", and "Slope Constraints" to do everything. Someday I'll go back through those tutorials and maybe learn something, heh.
Sent an email to your gmail account.
| Russell Fincher (Mar 20, 2007 at 19:47 GMT) |
Edit: It looks like ONE of us here at Sickhead Games has a TGE license, but apparently it isn't me. So I'll get Tom to post it. But it still looks like it should be currently available to TGE owners. Can I get a second opinion?
Edited on Mar 20, 2007 20:03 GMT
| Stephan (viKKing) Bondier (Mar 20, 2007 at 20:11 GMT) |
Will be happy to do it for you.
| Russell Fincher (Mar 20, 2007 at 21:13 GMT) |
| Stephan (viKKing) Bondier (Mar 20, 2007 at 21:35 GMT) |
| James Brad Barnette (Mar 22, 2007 at 03:40 GMT) |
Edited on Mar 22, 2007 03:41 GMT
| Michael Perry (Mar 22, 2007 at 12:21 GMT) Resource Rating: 5 |
I'm a TGE user, and I've been working with this process for a few days now. Using these steps, if I can get a nice terrain in the TGEA demo, my company might switch engines.
| Russell Fincher (Mar 22, 2007 at 15:15 GMT) |
| Michael Perry (Mar 22, 2007 at 15:24 GMT) Resource Rating: 5 |
| Jason Nabors (Apr 06, 2007 at 03:14 GMT) |
Wilbur
| Deception Games (May 10, 2007 at 16:40 GMT) |
| Russell Fincher (May 10, 2007 at 19:16 GMT) |
Plus, I'm always glad to answer any questions here, or privately at the email address on my profile page. And if your questions are over the head of a humble artist, my colleague Tom here at Sickhead Games can certainly add his input about implementing this art into Atlas and Torque.
Edited on May 10, 2007 19:27 GMT
| Mahmudul Hasan Sohag (Oct 09, 2007 at 19:19 GMT) |
I am new to tse. I have created some terrain using atlas technology but I can not create a detail map like urs. Its amazing..One question how can I create the 4th channel of a image file?I have tried using ur tutorial but could not make it work.after saving the image file in .png when I reload it photoshop again it seems there is no alpha channel.so I have to use 3 textures only. :( Thanks for any help.
| James Brad Barnette (Oct 10, 2007 at 02:34 GMT) |
| Chris D. Walker (Mar 06, 2008 at 14:06 GMT) |
| James Brad Barnette (Mar 06, 2008 at 16:20 GMT) |
You must be a member and be logged in to either append comments or rate this resource.



5.0 out of 5


