Terrain Texture Generator

About

As the ZornGL-Engine had it’s own terrainrenderer, I decided to write this tool that can automatically generate a single huge texture map for a terrain. Based on the height-values in a greyscale image (the heightmap) it generates a single texture with a given set of texture distrbuted depending on the height of the map at a certain point.
Over time the tool evolved and a lot of functionality was added, even upon user request as this tool seems to be widely used (even in some known projects). So the latest version has a nice new interface, can generate textures up to 4096×4096 pixels, renders (and if needed blurs) a lightmap depending on the sun-position and orientation and much more.

And for all those interested in maybe putting on-the-fly terrain texture generation into their own projects, I also released the source for version 1.6 (recent one is 2.0).

The idea for the generation of the terraintexture comes from a FlipCode tutorial about Terrain Texture Generation. The shadowmap generator is based on a GameDev tutorial called Fast Computation of Terrain Shadow Maps .

Screenshots

Downloads
Installer Zipped Win32 executable version 2.0
zip Zipped sources for version 1.6 (Delphi)

Version 2.0
– Totally new user-interface (all options on one screen)
– You can now blur textures (especially useful for shadows)

Version 1.6
– Texturesize up to 4096*4096
– Much faster gernation of the terrain texture

Version 1.5a
– Fixed a bug that caused a crash when generating the texture without lighting

Version 1.5
– Shadowgeneration
– Different texture sizes
– Real-time 3D Preview (using OpenGL)
– Texturesizes now can differ
– 5 instead of 4 base textures

Version 1.0
– Initial Release

10 Comments

  1. Incredible, can you add some means of tiling the initial textures? Everything seems a bit stretched.

  2. this is the program iv been lookin for, cause iv tried making my own textures with photoshop and ended up with crappy textures in a huge file, lol. THANK YOU! my search is over!

    1. Well, that error message is not helping much. Could you please post or send me (webmaster@delphigl.de) your system specs, mainly graphics card, OS and installed graphics drivers. Also please make sure the application is installed in a directory where you have user rights to write files to.

  3. It’s nice in concept, and I wanted to see what I could achieve with it. Unfortunately, I am stopped when trying to load my own heightmap with an error “Stream-Lesefehler.” which leaves me non-plussed. Oddly it still seems to allow me to generate a texturemap for the bmp I try to load though am unable to see the heightmap in the preview window. I’m not entirely sure what is happening. I can only guess it has something to do with the fact that I am running it on windows 8 x64 or that the bitmap has to be a very specific format. I saved the heightmap in greyscale 8-bit which I believe it the same as your sample. It was also 1024*1024, so it was a supported size. Can you shed some light on the issue?

    I will try to create and load texture maps of my own creation rather than the sample ones, but if I get the errors with those as well, it may prove a bit too combersome to use even if it does generate heightmap textures with none of the preview windows working.

  4. Hi Sascha,

    Just want to thank you for a truly excellent utility. The terrain texture generator has solved a real problem for me in matching terrain texture to height maps. I am programming a simple 3D game that has a character shot from a cannon across an island to hit a large target, etc, etc. Your utility has enabled me to simply and quickly create any island and the game is proceeding perfectly.

    Many thanks!

    Paul

  5. How can I adjust how high say, the water texture is? My water is set a bit below what your heightmap considers as being water.

  6. After examine just a few of the blog posts on your website now, and I truly like your means of blogging. I bookmarked it to my bookmark website listing and will be checking again soon. Pls try my site as nicely and let me know what you think.

Leave a Reply

Your email address will not be published. Required fields are marked *