Planetside Software Forums

General => Terragen Discussion => Topic started by: RealUser on October 08, 2007, 09:31:37 AM

Title: Exporting Terrains out of TG2TP as hightmaps?
Post by: RealUser on October 08, 2007, 09:31:37 AM
Hi,
is it possible to export (proc) terrains as hightmaps including stone populations or fakestones?

--
Markus
Title: Re: Exporting Terrains out of TG2TP as hightmaps?
Post by: cyphyr on October 08, 2007, 10:22:40 AM
Should be doable, although it would require a work around, I don't think theres a direct way of doing it yet. Place your camera above the center of the area you want to export and set it to "orthographic" mode, set use Ortho Width or Height to your desired terrain size, say 1000, (remember the render will be the size specified in the render tab so change that to the same size say 1000 x1000). Now place the sun behind the planet to avoid and shadows (or just turn its intensity down to 0) and set your surface layers to an image map gradient in the z axis (might be x?). The gradient should be a 16 bit gray scale gradient (bottom black to top white) image scaled to the maximum and minimum height of your desired terrain (min height is say -200, max height is 1500, then scale your image to 1700 x 1700). Crank up th luminosity and render. Small stones wont show up but thats a matter of overall scale. I'm sure theres a way of doing this with functions but I'm not wise in their esoteric ways :)
Good luck
Richard
Title: Re: Exporting Terrains out of TG2TP as hightmaps?
Post by: RealUser on October 08, 2007, 11:16:27 AM
Hey cyphyr,
thank you for the explanation of the technique. Very appreciated!
Title: Re: Exporting Terrains out of TG2TP as hightmaps?
Post by: Oshyan on October 08, 2007, 02:36:45 PM
This workaround is not necessary. Plug your shader tree into the Shdaer input of a Heightfield Generate node, use the numbers next to "New Heightfield" in the settings of the node to control pixel resolution of the resulting file (top values) and coverage in meters (bottom values). Then click Generate. Right-click the node in the node network view and choose Save As, give it a name and be sure to put .ter on the end. Viola!

- Oshyan
Title: Re: Exporting Terrains out of TG2TP as hightmaps?
Post by: cyphyr on October 08, 2007, 02:48:29 PM
Hehe, knew there was a simpler solution. Cheers
Richard
Title: Re: Exporting Terrains out of TG2TP as hightmaps?
Post by: rcallicotte on October 09, 2007, 09:03:11 AM
Oshyan, when you mention 'plug your shader tree', which shader tree are you talking about?  Everything else makes sense.



Quote from: Oshyan on October 08, 2007, 02:36:45 PM
This workaround is not necessary. Plug your shader tree into the Shdaer input of a Heightfield Generate node, use the numbers next to "New Heightfield" in the settings of the node to control pixel resolution of the resulting file (top values) and coverage in meters (bottom values). Then click Generate. Right-click the node in the node network view and choose Save As, give it a name and be sure to put .ter on the end. Viola!

- Oshyan
Title: Re: Exporting Terrains out of TG2TP as hightmaps?
Post by: Volker Harun on October 09, 2007, 09:28:09 AM
He means any shader before the 'planet node'.
Title: Re: Exporting Terrains out of TG2TP as hightmaps?
Post by: rcallicotte on October 09, 2007, 10:05:46 AM
Oh, that's interesting, Volker, since there's a Shader Node in the Heightfield Generate.  Hmmm.  Okay.  So then, if what you are saying is correct, Volker, it's possible to create a terrain with everything in it and then save it to a heightfield.  This is great news.


Quote from: Volker Harun on October 09, 2007, 09:28:09 AM
He means any shader before the 'planet node'.
Title: Re: Exporting Terrains out of TG2TP as hightmaps?
Post by: RealUser on October 09, 2007, 12:59:48 PM
Oh, very cool and easy! Thanks folks!
Title: Re: Exporting Terrains out of TG2TP as hightmaps?
Post by: Oshyan on October 09, 2007, 01:12:53 PM
Technically any shader before the "planet node", yes, but most significant displacement should be done in the Terrain group, *before* the Compute Terrain node and the Shaders group. In that case you would plug all the terrain-definining shaders before the Compute Terrain into this input.

Keep in mind that this will not save color/texture info, only height, and it also doesn't handle overhangs. The pixel dimensions will control detail. 2000x2000 is a good average resolution I'd say, although it depends on what use you are putting it to.

- Oshyan
Title: Re: Exporting Terrains out of TG2TP as hightmaps?
Post by: Harvey Birdman on October 09, 2007, 01:41:28 PM
2000x2000 pixels for what size area? I mean this is a pretty cool feature, but I can't see how it'd be useful for including object geometry in the terrain - it all depends on the end use in mind, but I'd think the sample rate would be too coarse. If your sample rate is 1 pixel per half meter square, you aren't going to get terribly good reproduction of fake stones unless they're massive boulders. Conversely, if you make your sample rate high enough to accurately resolve medium size rocks, you're going to end up with 20,000 x 20,000 pixels per square kilometer of terrain.

Sorry as usual if I'm stating the obvious. It's just that I'd kind of chased this around myself.  ;)
Title: Re: Exporting Terrains out of TG2TP as hightmaps?
Post by: Volker Harun on October 09, 2007, 01:47:58 PM
I think the above is all technically. De facto I am using it to 'cut out' a specific area of a procedural terrain, as the heightfield is faster to render.
Displacements, fake stones and so on are added later on.
Title: Re: Exporting Terrains out of TG2TP as hightmaps?
Post by: Oshyan on October 09, 2007, 01:50:02 PM
Yes, of course you're right. It's just that generally I wouldn't recommend trying to capture something on the scale of "fake stones" in a heightfield. It's just not an efficient format for that level of detail. The right tool/format for the job and all that, you know?

- Oshyan
Title: Re: Exporting Terrains out of TG2TP as hightmaps?
Post by: rcallicotte on October 09, 2007, 03:05:29 PM
No.  What's a 'fake stone'?   :P

Quote from: Oshyan on October 09, 2007, 01:50:02 PM
Yes, of course you're right. It's just that generally I wouldn't recommend trying to capture something on the scale of "fake stones" in a heightfield. It's just not an efficient format for that level of detail. The right tool/format for the job and all that, you know?

- Oshyan
Title: Re: Exporting Terrains out of TG2TP as hightmaps?
Post by: Harvey Birdman on October 09, 2007, 04:44:09 PM
You know... right click - 'Create Shader/Displacement Shader/Fake stones shader'.
Title: Re: Exporting Terrains out of TG2TP as hightmaps?
Post by: rcallicotte on October 09, 2007, 05:06:47 PM
 ::)

Quote from: Harvey Birdman on October 09, 2007, 04:44:09 PM
You know... right click - 'Create Shader/Displacement Shader/Fake stones shader'.
Title: Re: Exporting Terrains out of TG2TP as hightmaps?
Post by: Harvey Birdman on October 09, 2007, 08:28:32 PM
Was that a 'd'Oh!' moment?

;D
Title: Re: Exporting Terrains out of TG2TP as hightmaps?
Post by: rcallicotte on October 10, 2007, 10:06:24 AM
I was just foolin' around.  Fake Stones is where my understanding came about terrains way back when...  I was here when this party started last December.  Woohoo.    ;D

Thought you knew, Harvey, that I was joking around.  Ha.   :'(
Title: Re: Exporting Terrains out of TG2TP as hightmaps?
Post by: Harvey Birdman on October 10, 2007, 10:18:21 AM
Sorry, man. A bit slow on the uptake, I guess. So it was my 'D'oh!' moment, then.

;D
Title: Re: Exporting Terrains out of TG2TP as hightmaps?
Post by: rcallicotte on October 10, 2007, 11:12:01 AM
Well, I don't know.  It could be argued that I'm slow.  Period.   8)