Skip to main content
GameDev.net gamedev.net

PRO Tired of ads? Read GameDev.net ad-free and help keep the community independent with GameDev Pro — $3/month.

/cast Resurrect HeightMapEditor

/cast Resurrect HeightMapEditor

JTippetts
JTippetts
/* Why you crying? */ · · 2 min read
2,838 7
A short while ago (translation: 10 years) I had been working on a heightmap editor for a game project I was working on. Like most of my projects, it fell by the wayside. I haven't really had time lately to do much, but I have resurrected that old project... in a way, at least. In spirit, if nothing else, since none of the code has made it from backup onto my current hard drive.

Anyway, I've been re-building the heightmap editor using Urho3D. The forum thread where I show stuff is here, and the github repo for the project is here. It requires the Urho3D library to be built with Lua support, and so far the shaders I have written are HLSL only. GLSL shaders are on the TODO list.

The editor allows simple brush-based editing of height and up to 8 terrain layers. I've been experimenting with various shader schemes, starting with Urho's 3-layer scheme and elaborating up until I have settled on the current scheme: 8 terrain layers stored in 2 composite 4x4 texture atlases and a blending approach that uses the scheme described in this article. The results are quite nice:

F9Jytpo.png
hU7ENNX.png
4hfXxPc.png

The editor supports a rudimentary filter script system, wherein you can write scripts in Lua that apply effects or alterations to the terrain. Included filters so far include a basic Perlin fractal height generator, a Perlin fractal terrain layering generator, a river builder tool, a road builder tool, a tool to turn slopes greater than a specified threshold to cliffs, and so forth.

The UI is very rough. I am not in a polish stage on it yet, so things are barely usable. But I am working on it pretty steadily as I can. I'm getting to the point where I can start cleaning things up, though I am sort of waiting on some pending merges to the Urho3D master regarding shader structure before I really commit to a lot of the cleanup.

Anyway, that's about all I've been up to. I did dig out the Goblinson Crusoe code and attempt to build it against the latest master, but all I get is a black screen so clearly there is going to be some refactoring there if/when I ever get back to that game.

Discussion

Loading comments...