How to Scale Displacements

Started by PabloMack, October 06, 2018, 08:43:42 AM

Previous topic - Next topic

PabloMack

I am trying to develop a basic method for making strata. I am starting with the "Default Scene" and making incremental changes. It doesn't seem that the "Strata and outcrops shader" gives me the level of detailed control (for each individual stratum) I want so I have inserted a "Distribution shader v4" between the "Base Colours" node and the "Planet" node. Then I feed another "Base Colors" node into its "Child Layer" input and then a "Dsplacement shader" into its input. Finally, I am reusing the "Fractal terrain" by feeding its output into the "Displacement shader" input. I made the base colors for the planet a rusty red and the base colors for the layer greenish. I get an interestng displacement when I drive the "Displacement Shader's" input.

Here is my node network: [attach=3]

Here is a render with the effect off: [attach=1]

Here is a render with the effect on: [attach=2]

The effect is interesting but it has too much magnitude. So now I am faced with the mysteries of what are in those simple-looking lines between nodes. I have tried using a "Multiply scalar", "Multiply vector" and "Multiply color" to scale the "Fractal terrain" signal but nothing I've tried works. This is the problem that got me to propose a "Node Guide" but it really is the connections between nodes that I need to understand and they don't seem to be documented very well (what is in them and how to use them). How do I scale this signal so that I can control the magnitude I see in the second render?

WAS

I'd imagine you'd actually need to create those strata lines, not hope for them. For example voronoi diff scalar can create the hard lines necessary stretched on X and Z

Oshyan

I don't think the issue here is misunderstanding what "happens in those lines" - they are literally just taking data output from one node and inputting it to the next. I think the problem here is misunderstanding how the nodes themselves work, what data they're generating or outputting. Your node network makes very little sense to me as-arranged. I'll grant we need more documentation on some of this stuff, but I actually don't understand fundamentally how you're trying to approach this, so I'm not sure how to tell you how to make *this* method work.

That being said I think a simpler and probably easier approach would be to just use a bunch of Surface Layers with altitude masking, adjusting the altitude and fuzzy zone ranges as-desired so that they are in the sequence you want, however many layers/altitude ranges you desire, and either overlapping or not (or some mix of the two), and then simply feed in whatever displacement you want for each layer into the Child Layer input of the Surface Layer. You can either leave color enabled in the Surface Layer, to make each layer a different color, or at least differentiate their colors, or you can add additional shaders to the Child Input chain to add more complex coloration to each layer.

I've attached a very quickly generated example. Note that the strata-like appearance of the middle gray-blue layer is achieved simply by stretching the noise function along one axis. Just thought I'd throw that in there as an idea/example. The main control of positioning between strata layers is in the Surface Layer for each one (named for which layer of strata they are), and then the "Strata Displacement" shaders attached to them provide the actual shape/displacement.

I attached the displacement-providing nodes (Power Fractal nodes) to the Child input rather than Displacement input because I wanted to use the more advanced Displacement controls in the Power Fractal node (e.g. Roughness, Spike Limit), but you could also just attach them to the Displacement input of the Surface Layer, for example so that you could handle color and displacement separately by using other Child nodes. If you do that, though, just keep in mind that the Surface Layer is then taking *color* input and interpreting it as Displacement, so if your Power Fractals aren't outputting color (which I disabled in my example scene), then you won't get displacement in that configuration.

- Oshyan

bobbystahr

Thanks for that .tgd Oshyan, having a play with it now as I hit a totally blank inspiration spot and this woke up the little grey cells.
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

bobbystahr

Here's a small test render of where this example leads with a bit of tweaking...thanks again for sharing this Oshyan.
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

WAS

Quote from: bobbystahr on October 07, 2018, 06:51:07 PM
Here's a small test render of where this example leads with a bit of tweaking...thanks again for sharing this Oshyan.

Nice tweaks Bobby, also nice cloud setup.

bobbystahr

Quote from: WASasquatch on October 07, 2018, 07:57:38 PM
Quote from: bobbystahr on October 07, 2018, 06:51:07 PM
Here's a small test render of where this example leads with a bit of tweaking...thanks again for sharing this Oshyan.

Nice tweaks Bobby, also nice cloud setup.

That's one I got from Bob(chornor) before he passed away and I tweak it often
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

Tangled-Universe

If the 'Fractal terrain 01' does not generate colour then the multiply colour will generate zero.
As far as I know a dot product expects a vector as input, but perhaps it also accepts colour, but it's unclear whether there's colour present in that data-connection. I suppose there is, otherwise you would have not done that, but on the other hand...I see things happening in the screenshot which make me unsure of that statement.

Then you multiply the vector but it has no input, so there's nothing happening there.
In that case TG passes on the data unmodified, but this may only apply if the main input (left port) has input and the right one does not.

Then, the result of this function is used as a function for displacement, that's by principle fine. It's just a huge question what's going in there.

However, you connected your 'Fractal terrain 01' output into the displacement shader and what happens in this case is that the displacement from the terrain fractal is fed into this connection as well.
So in this side-chain of your network the displacement of the terrain fractal is present and perhaps extra displacement if the blue node network actually does something.

Lastly, you add some base colours (no problem) and feed the whole thing to the distribution shader.
What happens is that by doing this you ADD the 'fractal terrain 01' displacement + result of the blue node network to the already existing terrain, causing the large increased displacement.
The result you're seeing is entirely dependent on
1) whatever is going on that blue node network part
2) the altitude/slope restrictions in your distribution shader, since there's no active masking occuring according to the network.

PabloMack

Thanks to all. I'll have to look at all of this again once I get some time.