Flatten Terrain for Given Radious Under Camera

Started by OldFlak, December 12, 2018, 07:40:33 AM

Previous topic - Next topic

OldFlak

Hi all :)

So I use TG for creating skyboxes for game engines. Most of the time the terrain can be just flat or not even there at all.

The skybox that I am working on at the moment requires hills\mountains in the distance which of course is easily done, but I would like to flatten the terrain for a given radius under the camera basically so that the terrain on the bottom tile of the skybox is flat and then the hills\mountains start from outside that radius.

Hope that makes sense.

Can anyone give me some clue as to how to achieve this, or point me to a post that may touch on it.

Thanks for any input :)

OldFlak....
Intel(R) Core(TM) i3-4160 @ 3,60GHz. 8GB Ram. NVidia GeForce GTX 750. Acer 24" Monitors x 2 @ 1920 x 1080. Windows 10 Pro 64-bit.

Dune

Use a distance shader, with the render camera attached and set your distances. Use as mask for the hills.

Hannes

I guess the default scene has already what you're after.

Oshyan

Yes, this is exactly how the default scene is setup. And there's an explanation of it here: http://planetside.co.uk/wiki/index.php?title=The_Default_Scene_Explained#Terrain

The basic concept is to use a mask for your terrain(s), either a Simple Shape Shader, or Dune's suggestion of a Distance Shader could also work (though is directly tied to a camera so may be a bit more difficult to work with easily).

Depending on how many displacement nodes you have in your Terrain network, you may want to use an alternative instead of masking every single one. Something like a Merge Shader with the Simple Shape Shader as mix controller and a constant color as Input A.

- Oshyan

OldFlak

Thanks for the feedback everyone.

Yes the default scene is where I am starting from, but the flattened part needs to extend farther out. Basically I would like the hills\mountains to start where the haze does or a little farther. (works better for my purposes in game engine)

And also at some stage (for other skyboxes) I will want more dramatic mountains so I am guessing if I change the height for distant mountains the terrain under the camera will also change from being flat.

Since I am working with 6 cameras to capture the environment, I figured some way of altering the terrain itself may be easier. Like, tell the terrain shader somehow where the camera is and flatten out for given distance under the camera - but hey total newbie to all this :)

But will now digest all the suggestions here and see what I can get working.

OldFlak....

Intel(R) Core(TM) i3-4160 @ 3,60GHz. 8GB Ram. NVidia GeForce GTX 750. Acer 24" Monitors x 2 @ 1920 x 1080. Windows 10 Pro 64-bit.

OldFlak

Thanks for the link Oshyan - very helpful :)

OldFlak....
Intel(R) Core(TM) i3-4160 @ 3,60GHz. 8GB Ram. NVidia GeForce GTX 750. Acer 24" Monitors x 2 @ 1920 x 1080. Windows 10 Pro 64-bit.

Oshyan

In that case you can just increase the size of the Simple Shape Shader (in the default scene) to extend it out. A Distance Shader might not be a bad idea instead, as Dune earlier suggested.

- Oshyan

RichTwo

I may not be providing the answer you are looking for, but Hetzen has created what I find to be an extremely useful clip:
https://planetside.co.uk/forums/index.php/topic,13311.msg131303.html#msg131303

Rather than completely flattening a terrain at one location as the Simple Shape (SS) does, it globally widens the spaces between elevations and leaves subtle low level variations that appear more "natural".   I've put it into my Default Scene in place of the SS.  Now I have no idea if it can be connected to a camera to project at a specific location, but it may be worth trying.
They're all wasted!