Alpine Displacement to Vertical

Started by Earendel, November 22, 2009, 09:12:03 AM

Previous topic - Next topic

Earendel

Hi, first post here.

I've got an Alpine shader is set as a child of a surface layer so it only makes mountains in the high areas (controlled by an image map). 

I'm trying to make the Alpine Fractal displace the terrain vertically instead of by the current normal but it doesn't seem to have that setting.  The higher areas of the terrain are already quite uneven so the lateral (bulging) distortion of a normal displacement is very noticeable and unrealistic. The redirect displacement shader only has absolute X, Y, and Z, which is no good for all parts of the planet.

Any ideas?

Henry Blewer

Welcome to the forum. I am not sure that I am following you, but I'll try to help. Essentially, you want the mountains to only grow where the image map masks them. Instead you are getting some sort of vertical eruption?
I would use a gradient mask with the brightest areas for the full alpha. This would make the sides of the mountains so they are not so perpendicular to the planet. (You can invert the mask, if the bright areas are to be the mountains, I have not used alpha channeling in Terragen 2)
Could you post a render of the landscape and the alpha mask? It would help us give better advice.
http://flickr.com/photos/njeneb/
Forget Tuesday; It's just Monday spelled with a T

Earendel

No, I think you've got the wrong idea.

The image map is a height map for large (continent) scale features. The Alpine shader is for mountain-sized detail in high areas.

The structure is:

> Flat planet
> Image Map Shader (contains macro height for the continent)
> Compute Terrain
> Surface Shader (minimum height to only affect high-altitude areas)
--> Child: Alpine Shader (adds specific mountains to high-altitude areas)


The problem is that when the alpine shader displaces the terrain, it does so by the terrain normal, but I want it to be vertical.

I'm rendering some example images now.

dandelO

Normally, I'd say just set the fractal shader as the 'displacement function' of a basic displacement shader and select 'vertical displacement'.
The trouble here is, the alpine shader doesn't output any colour data to give the displacement shader information to displace from. You could try making a top down, greyscale image render of the alpine shader on its own and instead of using the actual alpine shader as the displacement function, use the rendered aerial view image, planned across the ground, then use that as the function for the displacement shader.

I don't know how easily you couls set that into your scene but because there is no colour in an alpine shader you can't select to use it as a function to for a specific displacement strategy in another shader.

Earendel

#4
Hmmm... I think it's going to be easier to try and replicate the apline shader effect with a power fractal. Thanks anyway.
[attach=#3] [attach=#1]
[attach=#2]

Hetzen

#5
I think you would be better off using a PF to blend an Alpine before the compute Terrain. That PF inturn would be blended by your continent mask.

Here's how I would do it.

1/ Contenant mask slightly blurred, to give me smooth rises out of the see. Use this with a Displace node to raise.

2/ Then add a PF (power fractal) to mark out my mountain ranges as a mask. This being masked by your contenant image. Perlin ridges is a good noise flavour for this.

3/ Plug that into you Alpine fractal to form the ranges.

The trick here is to get the scales of the PF and the softness right, as well as spacing between black and white, so that the Alpine blends nicely into your contenant.

After that, you can duplicate the PF, invert it, then mask that by the contenant mask, to allow me to modulate the height of the flat part of the contenant tops, to simulate hills etc.

OR

You could apply a vertical displacement only with a new PF, so doing it the other way round to what you're currently trying.

A little trick that maybe helpfull, is to map out your masks in surface layers with no displacment, just so you can see what you're are doing quickly. eg, set the planet blue (water), contenant mask green, mountain mask grey, hills yellow, etc.

Earendel

Quote from: Hetzen on November 23, 2009, 12:39:19 PM2/ Then add a PF (power fractal) to mark out my mountain ranges as a mask. This being masked by your contenant image. Perlin ridges is a good noise flavour for this.

How would you mask that? Using a surface layer or a merge shader node, or some other way?

My continent mask is actually quite detailed (4096x4096). It uses a combination of painted satellite data & Wilbur erosion. I'm relying on the height map for medium-large scale geological features like mountain ridges and valleys, but not individual mountain peaks. I also need to keep relative heights and slopes so that when I introduce the rivers they always run downhill.

Since individual peaks are less import to me, I've just gone with a Power Fractal instead of Alpine. They're not the most amazing mountains I've ever seen, but they'll do for now...
[attach=#]

Anyway, I have some other questions.

Is there a way to copy / paste nodes?

Is there a way to displace a cloud layer (i.e. make the cloud layer rise with the terrain)?

What's the best way to get planet-wide seas? At the moment I'm a sphere that's a similar size to the planet, but the z-buffer goes mental when I look around so for navigation I turn it off and use a shader to make the underwater areas.

domdib

To copy/paste nodes: first, click on the node in the network; then, go up to the Edit menu.

Clouds following terrain: see this thread - http://forums.planetside.co.uk/index.php?topic=5254.0

I'm sure someone else can answer the ocean question.

jo

Hi,

Quote from: Earendel on November 23, 2009, 03:14:53 PM
What's the best way to get planet-wide seas? At the moment I'm a sphere that's a similar size to the planet, but the z-buffer goes mental when I look around so for navigation I turn it off and use a shader to make the underwater areas.

Do you mean the planet goes mental looking when you're zoomed a long way out so you can see the whole planet? In that case you can use the [ and ] keys to adjust the 3D Preview camera's near clipping plane which makes things look good again. See the Mouse and Key Settings dialog under the Help menu for a bit more info.

Regards,

Jo

Earendel

Quote from: jo on November 23, 2009, 08:23:51 PM
Hi,

Quote from: Earendel on November 23, 2009, 03:14:53 PM
What's the best way to get planet-wide seas? At the moment I'm a sphere that's a similar size to the planet, but the z-buffer goes mental when I look around so for navigation I turn it off and use a shader to make the underwater areas.

Do you mean the planet goes mental looking when you're zoomed a long way out so you can see the whole planet? In that case you can use the [ and ] keys to adjust the 3D Preview camera's near clipping plane which makes things look good again.

Yes, thanks, that made a big difference. Is a sphere what most people use?

Quote from: domdib on November 23, 2009, 04:30:49 PM
To copy/paste nodes: first, click on the node in the network; then, go up to the Edit menu.

Ok... none of the copy / paste / duplicate commands were working so I reinstalled Terragen 2. After reinstalling, all the commands from the drop-down menu started working, but some of the shortcuts don't. Specifically, cut, copy and paste don't do anything. The shortcut for duplicate does work, and that's really all I need.

I think it would be a good idea to add 'copy' as an option of the node>right-click menu, and 'paste' as an option of the node-view right-click menu. 

Also, if I go the the intern node network view, it's always empty. Is that because I'm using the free edition?

jo

Hi,

Quote from: Earendel on November 25, 2009, 12:33:22 PM
Yes, thanks, that made a big difference. Is a sphere what most people use?

I'm not sure what you mean. The terrain by default is a planet, which is spherical of course.

Quote
Ok... none of the copy / paste / duplicate commands were working so I reinstalled Terragen 2. After reinstalling, all the commands from the drop-down menu started working, but some of the shortcuts don't. Specifically, cut, copy and paste don't do anything. The shortcut for duplicate does work, and that's really all I need.

What language are you using for your OS?

Did you know you have to have the network focused before you can use the shortcuts? You need to click in it or tab to it first. When it's focused it has a ring around it.

If you are trying to paste into an internal network you may need to "fit" the network view to see the nodes after pasting. Make sure the network view is focused and then press the "f" key. The pasted nodes will come into view.

QuoteI think it would be a good idea to add 'copy' as an option of the node>right-click menu, and 'paste' as an option of the node-view right-click menu.

Yes, we may do that at some stage.

QuoteAlso, if I go the the intern node network view, it's always empty. Is that because I'm using the free edition?

No it's not, you can use internal networks in the free version. Not all nodes have anything inside them. With the default scene the only node that has anything in its internal network is the Background node.

Regards,

Jo

Insquall

#11
Quote from: Earendel on November 22, 2009, 10:13:43 AM
The structure is:

> Flat planet
> Image Map Shader (contains macro height for the continent)
> Compute Terrain
> Surface Shader (minimum height to only affect high-altitude areas)
--> Child: Alpine Shader (adds specific mountains to high-altitude areas)

A solution is to put the alpine shader before the compute terrain node, as the compute terrain node recalculates the normal of the surface. Without it, the surface normals will stay pointing up from the centre of the planet, and any displacements along the normal will be vertical.

I would suggest reading up on it here: (Something that should REALLY be in the documentation  :) )

http://forums.planetside.co.uk/index.php?topic=1249.msg12539#msg12539

I'm not sure what doing away with a compute terrain node altogether would do since I don't know exactly how it works.

As for the internal node network thing, only certain nodes (Sphere object for example) seem to posses an internal input bar at the bottom of the screen when you dive in them. Kind of a let down really as it seems that all of the other nodes' internal networks are useless. Somebody correct me if I am wrong about this.

jo

Hi,

Quote from: Insquall on November 25, 2009, 06:54:08 PM
As for the internal node network thing, only certain nodes (Sphere object for example) seem to posses an internal input bar at the bottom of the screen when you dive in them. Kind of a let down really as it seems that all of the other nodes' internal networks are useless. Somebody correct me if I am wrong about this.

You're wrong :-). That bar appears and disappears according to various inscrutable rules, or at least that's how it seems to me. However one reliable way to get it show is do this:

- In the default scene, select the Heightfield generate 01 node and cut it.
- Go to the internal network of Heightfield shader 01.
- Paste the generate node into the internal network.
- Click the Up Level button to go back to the top level.
- Context click on the Heightfield input of Heightfield shader 01.
- From the Assign heightfield menu item go to the Heightfield shader 01 item and then select the Heightfield generate 01 item. This makes a connection from the internal Heightfield generate 01 to the Heightfield input. In the next version you will see that input disappear.
- Now go to the internal network for Heightfield shader 01. You will see that Heightfield generate 01 is now connected to an internal Heightfield input on the bar.

The bar also isn't fundamental to using internal networks. You might want to use internal networks simply as a way to organise nodes and remove clutter from the top level view.

I should also mention quickly that the problem I mentioned in my previous post where you need to fit the view to see nodes pasted into internal networks is fixed in the next release. There are a number of other fixes and features which make it easier to work with internal networks.

Regards,

Jo

Insquall

#13
Thank you for the information, really interesting. I look forward to the next release.

It would be great if there was a node specifically designed for the encapsulation of other nodes that could have custom inputs, something like this could eventually lead to custom nodes (Have you ever used Houdini? lol).

Oshyan

Quote from: Insquall on November 25, 2009, 07:49:15 PM
Thank you for the information, really interesting. I look forward to the next release.

It would be great if there was a node specifically designed for the encapsulation of other nodes that could have custom inputs, something like this could eventually lead to custom nodes (Have you ever used Houdini? lol).

Yes, we have plans for a "macro" function to encapsulate nodes in the future. There's quite a lot of discussion about it on the forums if you search that term "macro".

- Oshyan