Tiled terrains progress

Started by bigben, September 05, 2007, 04:58:48 PM

Previous topic - Next topic

bigben

Hi All

Here are a couple of test renders that better illustrate what I'm trying to do with my tiled terrains. Fractal detail is turned off to give a better idea of the terrain resolution. The shaders are pretty basic and were ripped directly from my alps test. I guess this also means I've started my own planetary shader project... but based on TER files. The shaders are mainly restricted by altitude and slope, and eventually I'll add successive child layers to provide increasing levels of detail for different camera altitudes. Some of the shaders will then be masked with image maps to be more realistic.

But back on topic.... I still have a problem in this terrain which I have to investigate to see if it's a problem with the mask or an error on my part. The latter is quite possible as I've been tacking bits onto this TGD over a long time. If you zoom in to 200% to Mt St Helens on the high altitude view you can see a dip along the edges of the highest res terrain which theoretically shouldn't be there. Only 3 x 4097 terrains in this test... 10m, 100m and 200m resolution.

nvseal

This is going to look great. Looks good so far.

sjefen

Wow. This is looking really nice.
ArtStation: https://www.artstation.com/royalt

AMD Ryzen Threadripper 1950X
128 GB RAM
GeForce RTX 3060 12GB

bigben

#3
Thanks. It's going to make one hell of an animated zoom when it's finally finished, which is one of the main reasons for me extending the terrain so far.  I rebuilt the terrain on the train this morning and I'm still having some problems with the mask edges. I'll have to try loading this into the previous version to check whether it's a problem with my function or related to the update (looked fine in the preview of the previous version.. I just couldn't render it at all). I have dips along all of the terrain edges which doesn't quite make sense since the combination of masks should always be adding up to 1 at every point across the blend. TGD attached if anyone can see a problem with the mask.  The expanded mask is in this post: http://forums.planetside.co.uk/index.php?topic=2036.msg20030#msg20030 It's basically a linear gradient 0 to 1 with a customisable width.

As for the shaders.... My approach to most problems is to break processes down into smaller components and then build them back up piece by piece. This is partly why I do so much masking, and on some of my more complex projects the mask nodes look just as complex as the surfacing nodes. Essentially, I split up the surfacing into two tasks... the surface itself and its distribution.. and for a planetary shader this will be further split into detail levels...  Create shader > create distribution mask > combine with previous detail level.  I haven't done much in the way of orbital renders and have learnt a lot from some of the files you've shared.  I'll post some files as well when I get a bit further along.

sjefen

Thank you very much bigben. Very generous of you :)
ArtStation: https://www.artstation.com/royalt

AMD Ryzen Threadripper 1950X
128 GB RAM
GeForce RTX 3060 12GB

bigben

No shaders in that one though, so not that generous ;)  It's a bit too basic to share yet...

bigben

Quote from: bigben on September 05, 2007, 07:11:00 PM
I'll have to try loading this into the previous version to check whether it's a problem with my function or related to the update (looked fine in the preview of the previous version.. I just couldn't render it at all). I have dips along all of the terrain edges which doesn't quite make sense since the combination of masks should always be adding up to 1 at every point across the blend.

Loaded in previous version.... just the same, so it's my problem?  Close though  ;)

Attached the expanded mask clip here if anyone wants to look at it and see if they can point out what I did wrong..

Also attached the shaders I used for this.... I told you it was very basic  ;)

rcallicotte

Thanks, Ben.  I'm in testing today and tomorrow.  If I finish what I'm doing, I'll look at these then.
So this is Disney World.  Can we live here?

Harvey Birdman

Hi, Ben -

How about writing up a little procedure explaining how to use your tiling technique on a set of terrains? Or have you already? I hadn't seen anything like a step by step procedure.

bigben

#9
Quote from: Harvey Birdman on September 06, 2007, 11:47:03 AM
Hi, Ben -

How about writing up a little procedure explaining how to use your tiling technique on a set of terrains? Or have you already? I hadn't seen anything like a step by step procedure.

Most of it is in the generation of the terrains.  Terrains/reference images are exported from GlobalMapper usng UTM projection which produces a reasonable looking result with TG2's current terrain mapping. I export multiple 4097x4097 terrains at varying resolutions (e.g. 10m, 20m, 50m, 100m, 200m, 500m per pixel), centred on my area of interest. I use a spreadsheet to calculate the required numbers to enter into GM when exporting. If there are multiple areas of interest close to each other I'll create a TER for each of these, with a calculation in my spreadsheet to figure out the offset of the center of each terrain from my main reference point (this is where the UTM projection is really useful).

Each TER is then loaded into TG2 from largest to smallest (lowest to highest res), positioned by their centres (less number crunching than using lower left). With a flat terrain, the defaults for Displacement: Flatten First (ON) and Border Blending (0.1) will merge the terrains nicely, but the terrain is flat, not mapped to the planet surface. To fix this, you turn off Flatten First... but doing this also stacks the terrains on top of each other. To workaround this I created a mask to be used as a Blending shader to simulate the terrain merging of flattened terrains. If you look at the TGD above using the compact version of the clip there are a few basic inputs... width of terrain (in metres), X,Z coordinates of the centre of the terrain and the width of the blend (same usage as Border blending setting)

The following only works for terrains positioned without overlapping edges... I need to get this working before I try dealing with overlaps...

Border Blending for each terrain must be set to 0 in the heightfield shader. Each terrain is then blended by a combination of its own mask minus the mask of the next smallest terrain (subtract scalar node). The exceptions of course are the smallest terrain (only uses its own mask) and the largest terrain (apply the mask of the previous terrain and invert). As each border uses the same border blending twice (normal and inverse), the combined values for any point in the blended area should be 1 ... mask value + (1-mask value)

This post contains some screen grabs and the expanded clip.
http://forums.planetside.co.uk/index.php?topic=2036.msg20030#msg20030

The test in this post http://forums.planetside.co.uk/index.php?topic=2036.msg21346#msg21346 was successful, but it was merging two small terrains within a larger terrain so there's only a single overlay (2 TERs at most at any point). The problems seem to arise when you have more than 2 TERs in a border (in theory all of the other terrains should be at 0).

The math for my mask is hardly rocket science.... just a linear gradient for each edge (so that 0 = outer edge of TER and 1 = inner edge of border blending), clamped to 0,1 and then combined using multiply nodes.

I'll be releasing the terrains officially later, but if anyone wants a sneak preview for testing I'm loading them up here: http://www.path.unimelb.edu.au/~bernardk/terragen/terrains/us_3peaks/files/

Still filling in the data gaps.  I can only access USGS in bursts... they seem to spit the dummy at me after a couple of Gb for a few days.

efflux

This looks pretty amazing. Something you could never do with procedurals.

bigben

I should have twigged to this earlier, but my functional mask will also be useful for tiling my image maps for masking... particularly the canopy maps :)  Trying out a test render at the moment but I think I have to make it a bit smaller.  It's not crashing with 4.5 million billboard trees, but the render's not progressing either.  I'll try splitting the population first (you never know your luck) but but if that doesn't wrk I may have to drop the population radius to 40km from the camera (currently 50km).

bigben

#12
It (the border depression) was my fault  ;)  My original image mask had a black border around it which was deliberately a bit wider than necessary to eliminate glitches at the edges of my terrain caused by my TER conversion process. 

In my earlier tests with a function mask had set the mask size to be smaller than the terrain for the same reason, but I forgot to do this in the test above, and when I set the border blending to 0 I saw that the glitches created a narrow ditch dropping to 0 altitude. I've successfully tiled 4 terrains now.  The only test remaining now is to include multiple high res TERs within a low res TER.

cyphyr

This is looking very promising, keep in there. 8)
When I'm rich I'll be able to buy UK elevation maps and this will come in very useful.
Richard
www.richardfraservfx.com
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 5950X OC@4Ghz, 64Gb (TG4 benchmark 4:13)

bigben

I stopped working on my UK terrains when I had these problems. I should finish them now that the update has fixed this. http://www.path.unimelb.edu.au/~bernardk/terragen/terrains/ 3 Peaks, at the bottom of the page. They're only SRTM3 so the resolution's not that great. I'll probably shift my reference point to be centred between these peaks and set the largest terrain to include Ireland. I won't be releasing slope maps for SRTM3 terrains as I have really found them to be of any use yet, but I'll still include matching Landsat images.