Sculpt Terrains

sculptterrain_004

I do a fair amount of work with people in urban planning. Realism in those virtual environments is the starting point for the imagined plans they have in mind. The very first thing they want is the realistic terrain of the area. It has proven difficult to get the elevation data of specific areas, but we always end up finding it in some obscure place or other. Unfortunately, the terrain by itself doesn’t quite give the feel of the area as it exists today. Instead, it gives the feel of the area as it might have existed 10,000 years ago! — no signs of human civilization. Which, as nice as that may be, doesn’t quite do the job for urban planning. This weekend I was finally able to generate realistic terrains in OpenSim overlayed with a realistic image. Here is the story.

Terrains in OpenSim/Second Life have always been a source of frustration for me. The problem is that the standard terrain in OpenSim/SL is textured with an inflexible combination of  4 textures, the details of such combination being completely hidden from us. We cannot do the simplest and most natural thing, which is to overlay one existing image on top of it. I have no idea why Linden Lab made this decision, as it seems like the single texture approach would be easier to handle than the complicated generative algorithm they have. But that’s what we have to deal with.

So far, my urban planning colleagues have managed to stay away from areas with interesting terrain, so we’ve simplified by flattening the areas and using mega-prims overlayed with the aerial images. However, recently we had to deal with an area with a non-flat terrain, and I could not escape the issue. Luckily the stars were aligned to my advantage.

My attraction to terrains is nothing compared to Nebadon‘s obsession with them. From all I can tell, he has spent hundreds (thousands?) of hours working on producing the most amazing sculpt-prim terrains. Here is an example, and here is another one. So I turned to him. We were talking about terrains last week, when he casually mentioned that Adam Frisby had given him a program that takes a heightmap and a texture and generates sculpt-ed terrain overlayed with the texture. That’s how he had been producing those amazing terrains. The tool was very rough, and he still had to do a huge amount of work manually. But at least the core of the algorithm for generating sculpties from heightmaps was there! I was excited, and quickly dived into the code — Nebadon was kind to share.

It took me about a day (yesterday) to clean that code up, and to understand the math, but I finally have the tool I wanted for the past three years! The result can be seen in the picture above, as well as many more pictures if you follow the link to Flickr. The tool now is completely parametrized, and, additionally to the textures, it also generates the prims themselves. Everything is automatic. I have a feeling I’m going to spend a lot more time on this amazing tool… at least until some viewer does the right thing and let us place our own images on the terrains.

5 replies on “Sculpt Terrains”

  1. Marcus Llewellyn says:

    Looks wonderful. :)

    I was also able to get my hands on the tool Adam wrote, and experimented with sculpted terrain. I chose to try Ayer’s Rock in Australia, and then Beringer Crater in Arizona. The tool produced the necessary sculpts flawlessly, but I ran into a wall with texturing them. For some reason, the sliced terrain texture tiles never seemed to line up quite right for me.

    If you want lots of detail you also need lots of sculpts, and rezzing/arranging these by hand is laborious. I wound up creating a tool in-world with LSL to lay them all out for me. It isn’t at all user-friendly, as you need to tweak the scripts by hand to fit the situation, but it does the job. It consists of two prims. The first one generates notecards for each row containing that row’s constituent sculpt UUIDs, and then a rezzer that spits out the sculpts in the correct arrangement. Each rezzed sculpt contains a script. Immediately after being rezzed by the rezzer, it can be sent information like it’s name, description, size, scale, or texture. Once that sculpt script completes, it deletes itself, leaving the sculpt clean.

    It has been… oh, maybe a year since I played with this stuff, so I may misremember a few details.

  2. Bill says:

    What’s the possibility that we could have a go with this script? I’ve been in serious need to something to help me generate terrains and I’ve tried quite a few.

  3. Katy says:

    I am a high school Visual Arts teacher currently working with Grade 10 students (15-16 year olds) to produce prototypes of sustainable architectural designs in the virtual world using OpenSim. Students are using their research, creativity and imagination to design what they believe, buildings will look like in the future. You may wish to have a look at their work on our website.

    I would be very interested if you could point me in the direction of this script as we would like our students to be able to consider urban planning for the next phase of this project. Our students are very keen to learn more about terraforming and are currently building a suitable library of scripts to use in OpenSim. Obtaining this particular script will be extremely helpful for our students on this project.

  4. Lance Lowrie says:

    I have the terrain and I have the texture… But thats where it comes to a stop
    any chance of getting this tool for my own use to learn more ?

    Thanks for what you have done with the DIVA Distro. It has left me more time
    for other things I am trying to learn :)

    thanks Lance

Comments are closed.