Flatten a bit of terrain

Started by Harvey Birdman, October 18, 2007, 11:28:59 AM

Previous topic - Next topic

Harvey Birdman

Hey, all -

Here's a problem that bedevils me (and probably others) every time I create a scene - how do you flatten a bit of terrain where you want to place a building? Image map filtering of the heightfield works well if you want to flatten a large area, but what about just the immediate surroundings of a single building? I've looked at Terrapainter, but without a means of translating pixel coordinates used by Terrapainter to X/Z coordinates used in TG2, it was impossible to find a particular location in Terrapainter.

So what do you do when composing a scene in which you want varied terrain, but you also want a flat spot at a particular place?

Oshyan

I would think you could use some function magic and create a flat area. You could also use an image-based mask and, as long as it was the right shape and orientation, just use scale controls to adjust its size. You would use it as a blend between a constant height of your choosing and the terrain you're trying to "flatten", so rather than actually flattening the terrain you're basically replacing it in that area with another terrain. Easier methods of locally editing terrain will be added in the future.

- Oshyan

Harvey Birdman

I'm actually experimenting with both these methods. I can successfully block the heightfield out of a specific region using either method, but how do I substitute my 'flat' terrain value? Where I block the heightfield, a crater of sorts appears, right? How do I prevent that from happening? I tried applying the inverted mask to a displacement shader, but you get, at best, really ragged edges around the masked region, and I couldn't really get the desired affect.

Oshyan

I would use a Merge shader...

- Oshyan

Harvey Birdman


bigben

Or have a look at my tiled terrains setup.... It's basically the same thing.  Carve out a big hole in a terrain and fill it with another one. Attached the clip I use as a blending shader on a terrain. Use it on both, and invert it on the non-flattened terrain...

Harvey Birdman

Thanks, Ben. I'll check this out a little later today. I'll post the solution I put together later, too.

:)

Harvey Birdman

Hey, Ben -

Do you have a non-compacted version? I'm a little uncomfortable trying to expand the compacted version - I'm afraid I might disconnect something in the process.

Nice purple group color, by the way.

;D

bigben


Harvey Birdman


dhavalmistry

Quote from: bigben on October 19, 2007, 12:55:52 AM
Or have a look at my tiled terrains setup.... It's basically the same thing.  Carve out a big hole in a terrain and fill it with another one. Attached the clip I use as a blending shader on a terrain. Use it on both, and invert it on the non-flattened terrain...

you call that blending mask??? :o :o :o :o :o
"His blood-terragen level is 99.99%...he is definitely drunk on Terragen!"

Harvey Birdman

D - as long as it works; that's my primary criteria.

:)

I'm posting the little solution I came up with in the File Sharing area. It's nowhere near as sophisticated - it doesn't actually merge terrains, just allows you to merge a flat spot at a desired location, but it's not as scary, either.

;)   ;D

dhavalmistry

ohh...thanx.....exactly what I was looking for...do it fast...

hurry!!!!!!!  :D ;D
"His blood-terragen level is 99.99%...he is definitely drunk on Terragen!"

bigben

#13
Quote from: dhavalmistry on October 23, 2007, 01:02:35 PM

you call that blending mask??? :o :o :o :o :o

That's why HB asked for the network version  ;) ....  It's really quite simple... crude even, but quite effective for terrains. This is the square version. The rectangular version has a few extra nodes but is structurally the same.

Alfamike

Hello,

I might be thinking over simplistic here, but anybody got any ideas why screen shot beneath does not work?

The Distribution shader selects by minimum altitude.
Fractal shader 1-1 is a duplicate of Fractal shader 1, with the only difference that it is blending by shader.

The result here is, well, nada, zip, as if the blending input is not used.

I looked at the previous examples in this thread but I'd like to do this without loading masking images, just by a constraining shader output.

Thanks, been struggling with this for a while now.

AM.