Applying an image map displacement / heightmap

Started by Eudaimonium, June 04, 2016, 02:09:10 PM

Previous topic - Next topic

Eudaimonium

Hello,

I'm trying to apply a projected heightmap to my planet, and then have some of the procedural/fractal stuff add in the details. Basically, inserting a heightmap under the starting planet's shaders, if you will.

I'm having a bit of problem getting my image map shader to actually do anything - I am loading a .PNG image and it shows up correctly in all previews. I have tried to just simply plug the Image Map shader directly into Computer Terrain node just to see what would happen - nothing.

It shows no signs of actually working. If I plug the default fractal output into the "Input node" of the Image map shader, that just passes through and outputs the normal fractal (default terrain) as if it's plugged in directly into Compute Terrain. Plugging the image map shader simply results in flat planet without any features.

Here's my setup:

[attach=1]

On the top you can see the camera used to project the heightmap into the terrain. The clump of cameras are just the skybox rendering setup (I'd like to position some nice mountain ranges around them via heightmap).

What am I doing wrong?

Eudaimonium

I figured it out, in order to see any details applied to compute terrain, the Displacement Amplitude under Image Map Shader node has to be set to something ridiculous, aprox. 500.000 in order to see any small planet-scale changes, and about 10-50k for distant mountain ranges or such if you wish to have them visible from ground.

Which is weird because default slider next to the option only goes between 0 and 1. Just type the number manually:

[attach=1]

Anyhow yeah now I can finally decorate my planet (which I use for skybox rendering) with mountains and other features.

[attach=2]




Eudaimonium

Aaand with that I am now stuck again.

The projected mountains onto the terrain apparently do not take any of it's advanced fractal distortions and warps.

You can clearly see here, mountains on the left are via projected heightmap, and on the right and bottom is the default planet's generated terrain. It's clear it's in apparently much higher detail and realism.

[attachimg=1]

Here is my node setup so far:

[attachimg=2]

As you can see I even tried mimicking the Terrain fractal + Fractal warp shaders after the Image Map displacement shader node, but no matter what I do to those two shaders, they apparently also do nothing.

How can I make my projected mountains "blend in" the existing terrain, or better yet - how to actually run my own displacement and warping and coloring shaders and then "merge" them into the existing terrain? This is basically what I'm after for entire day today and I'm not having much luck :(

Thank you in advance for any help!

Dune

My way of doing this would be to use Y projection (without the camera) of a greyscale 16-bit image map of certain size, and displace that in a surface shader, masked by a square simple shape the same size as the terrain, with a little overlap (smooth edge), add the procedural terrain with an inverted mask. Then apply all extra smaller displacements and colors. I hope this helps.

Eudaimonium

Quote from: Dune on June 05, 2016, 02:18:57 AM
My way of doing this would be to use Y projection (without the camera) of a greyscale 16-bit image map of certain size, and displace that in a surface shader, masked by a square simple shape the same size as the terrain, with a little overlap (smooth edge), add the procedural terrain with an inverted mask. Then apply all extra smaller displacements and colors. I hope this helps.

Thank you, but can I ask you to elaborate a bit on how exactly would I do those steps?

I'm still stumbling around a bit the Terragen's node system, it's kind of non-intuitive for me (I come from Unreal's node material editor and Unity's node animation system and such and this is quite different), I'm having trouble understanding the node input and output nodes, the "Type" of input or output isn't well explained nor documented. What does "Input" node of any fractal displacement shader do? What is the output of displacement shader? And such.

Thank you in advance!

Dune

Basically it's this and very simple. Instead of a square, you can make the simple shade a circle, or make an outside mask.

An input just passes on the information from earlier nodes into that node, the output passes on the changes made in that node to nodes further down the line, simply said. The wiki will tell you all about these underlying principles.

I hope this helps you on your way.

Eudaimonium

I think I'm slowly started to get it. I have made some progress.

Here's my projected heightmap onto a planet, and then using the fractal displacement + warp over it all to give it more natural, if a bit rough a coarse look:
[attachimg=1]

This is a render from "within" the projected landscape, all terrain geometry has the same convincing high level of detail:
[attachimg=2]

One thing I am unclear on, it seems that using the Mask + checking Invert Mask, and not using the mask at all gives exact same results:
[attachimg=3]

Anyhow, this is the majority of my hurdles done, thank you very much for your information.

Now I need to find out some good terrain coloring advice. I recall seeing a few materials on basically assigning colors according to heigh, or inclination or such. If you have any links to send me on my way, it'd be great, if not I'll probably find them on my own - you've been a great help, thank you!

Dune

Looking at your setup I'd say the fractal terrain is imposed onto your image map terrain as well as the whole planet. If you need to have the exact contours of the image map, that would be no good, but for a natural blend and not too heavy displacements in the image map, it would work.
Regarding colors; you can use any combination of power fractals for colors (watch out for too hevay displacement in these PF's; uncheck if you don't need it), the first can be 2 colors, every one below needs to have one color. You can also use the merge shader, or a stack of surface layers, which has the benefit of setting it to less coverage for better blending. The add these lines as child to a surface shader, and set slope and altitude restrictions. That's one way, there are many ways! Changing the PF's noise, and its particulars can give interesting results, just play with the values and don't just use the sliders, but type in numbers, even negatives, good fun!