### Author Topic: Blue Node Playground  (Read 2171 times)

#### Dune

• Terragen Alpha Tester (Win)
• Posts: 13546
• Corkscrew Bird
##### Re: Blue Node Playground
« Reply #15 on: May 20, 2017, 06:23:50 AM »
Nice experiments, Klaus. But I wonder, are you just putting lines of random blues together or is there some knowledge behind this (that eludes me)? Positively meant! E.g. what does luminance to scalar do with get position (is there luminance in a position?)? And what does the degrees to radians do? I think the result would be the same with just the get position and the sinus.
I sometimes put blues together, but some of those I never really understand, like 'get final color'`, 'normalize vector'.... I was hoping to use them for something interesting, but always failed.
In case you still haven't seen enough of my work: www.ulco-art.nl

#### masonspappy

• Member
• Posts: 1762
• "I am my own worst-case scenario"
##### Re: Blue Node Playground
« Reply #16 on: May 20, 2017, 01:15:02 PM »
I like the implementation of this.  Most people in this group are extremely visually-oriented, so it never made much sense  to see blue nodes described primarily with plain text.

#### KlausK

• Member
• Posts: 360
• Land ho!
##### Re: Blue Node Playground
« Reply #17 on: May 22, 2017, 11:42:03 AM »
@ masonspuppy
well, i started this thread in the hope to build up some sort of illustrated blue node dictionary.
This is simply a reaction to the latest discussion about the Help files and Documentation for TG.
I intend to post my low level blue node examples here as I go along.

@ Dune
It is a bit of both, actually.
I know my way around Trigonometry quite well (thinking how many decades back I learned about it in school), I think.
So it is not random stacking most of the time.
I have some ideas about what I want to do, which blue node is available in TG for the task, read up upon the nodes in
question in the TG Wiki node reference and then try to verify if I understand correctly what the Wiki description states.
If the resulting output fits my expectation, I am on the right track (regarding the problem).
If not, read again and grab the old math books from the shelf or find another way. That`s about it.
It is the same learning experience you or anybody else is make using the "high level" prefab terrain nodes, I think.

Starting out with just a "Get Position" and going on from there gives me the fastest and "purest" output of a node
or function I use in the network. As I understand it these low level blue nodes are the ingredients making up the
high level shaders (with a lot more going on under the hood, I presume).
So understanding and recognizing the effect they have helps me understand the inner workings of the program a little better.
And it is fun to do. It`s like visual programing in Softimage ICE again.

On the other hand, I cannot for example explain mathematically correct and logically to you why the "Get Position"
is represented in TG the way it is. Reading the nodes description and the description of the "Render State" does not
make it all that clear to me. But what I can investigate is how this representation of the "Get Position" node can be
altered by following nodes in a certain context. I am presented with colour information in the first place - not the
numerical values of a position. Where there is colour information there must be luminance information embedded as well.
That is how I "jump" to conclusions. Looking at the result of the stacking I can then compare this to my conclusion / expectation.
Like this:

So, here is what the "Luminance to Scalar" node does to the "Get Position":

Looking up the Wiki Node Reference you`ll find that a Trigger function node like "Sin Scalar"
expects a Input value in radians rather than degrees if you are doing trigonometric calculations.
That is what the "Degrees to radians scalar" node is used for.

And this is directly from "Get Position" to "Sin Scalar". Very different result:

Take from it what you might find useful.
I am not doing tutorials on how to achieve this or that effect or terrain.
That is not what I am interested in. And for you my little experiments won`t be too helpful anyways since
you know your way around TG so well already. Looks like you can achive most of what you want even without
those little helpers...For me through better understanding those simple networks knowing what to do when
building specific terrains with those "high level" nodes is what I am aiming at.

And I am doing it just for fun. There is no greater purpose behind what I am doing.
I am not aiming for a end result so to speak. I am not looking for the perfect picture here.
cheers, Klaus

ps: sorry for another "speech".

« Last Edit: May 22, 2017, 11:54:25 AM by KlausK »
/ ASUS WS Mainboard / Dual XEON E5-2640v3 / 64GB RAM / NVIDIA GeForce GTX 780 / Win7 Ultimate

#### luvsmuzik

• Member
• Posts: 2334
##### Re: Blue Node Playground
« Reply #18 on: May 22, 2017, 12:46:24 PM »
It is about the fun of it for many of us, Klaus and Dune. I remember eons ago using another program where you could calculate your sky and stars with a simple input calculator, (number of stars, distance, size variation, etc). This resulted in a spherical shape with small spheres surrounding your scene, able to rotate on a target axis. From there you could change the star colors or vary brightness in your little animation. My point is this, thinking back to develop an object for my fountain quest, I thought okay...try to duplicate that in an object and the filter may pick up the brightness with the new burst function in rendering. So we do go back to our early days and try to combine with the new I think.
Ever grateful for all this discussion and examples. You never know what showing one little thing can make someone think about trying to do.

#### Dune

• Terragen Alpha Tester (Win)
• Posts: 13546
• Corkscrew Bird
##### Re: Blue Node Playground
« Reply #19 on: May 22, 2017, 01:38:27 PM »
Thanks for explaining, Klaus. I really appreciate your experimentation, and indeed, it has taught me a lot as well, though I can't fantom the more intricate blues. And I am too lazy too look up anything in the wiki.
Sometimes you figure out some line of nodes in your head, put it together and it doesn't work, mmm, then start working around it, trying different alternatives. And sometimes find interesting results (or get frustrated).
It's the fun indeed!
In case you still haven't seen enough of my work: www.ulco-art.nl

#### KlausK

• Member
• Posts: 360
• Land ho!
##### Re: Blue Node Playground
« Reply #20 on: July 06, 2017, 11:59:25 AM »
Hi, while putting together another Blue Node example I animated the Gradient Patch Size of the Compute Terrain for a change.
I was curious how that would look. A little disappointing I must say. I expected to see a rather organic shaping of the terrain but
this looks a little like two 2D pictures being aligned over time. Well, at least I know now
Cheers, Klaus
/ ASUS WS Mainboard / Dual XEON E5-2640v3 / 64GB RAM / NVIDIA GeForce GTX 780 / Win7 Ultimate

#### luvsmuzik

• Member
• Posts: 2334
##### Re: Blue Node Playground
« Reply #21 on: July 06, 2017, 02:41:54 PM »
Wonder if this could be useful using water shaders? Probably enormous render time, I suppose.
Anyway, great effort!

#### KlausK

• Member
• Posts: 360
• Land ho!
##### Re: Blue Node Playground
« Reply #22 on: July 06, 2017, 04:43:27 PM »
While I am at it...a little comparison of the Gradient Patch Size of the Compute Terrain node.
This is always the same terrain and pov. Pretty dramatic changes, right?!
There is a similar example in the Wiki to show the effect of varying sizes on a snow shader layer.
@luvsmuzik: worth a try with a water shader.
Cheers, Klaus
/ ASUS WS Mainboard / Dual XEON E5-2640v3 / 64GB RAM / NVIDIA GeForce GTX 780 / Win7 Ultimate

#### Dune

• Terragen Alpha Tester (Win)
• Posts: 13546
• Corkscrew Bird
##### Re: Blue Node Playground
« Reply #23 on: July 07, 2017, 06:48:16 AM »
Interesting experiment, Klaus.
For newbies; it's often very handy to vary the patch size for certain effects, like really big (50+) for smoother snow fields when using a displacement intersection in later surface shader, or very small for detailed lateral or recalculated normal displacements (which should come after that compute terrain).
In case you still haven't seen enough of my work: www.ulco-art.nl

#### KlausK

• Member
• Posts: 360
• Land ho!
##### Re: Blue Node Playground
« Reply #24 on: July 10, 2017, 01:40:10 AM »
@Dune: thanks and thanks for the additional info.
Cheers, Klaus
/ ASUS WS Mainboard / Dual XEON E5-2640v3 / 64GB RAM / NVIDIA GeForce GTX 780 / Win7 Ultimate

#### KlausK

• Member
• Posts: 360
• Land ho!
##### Re: Blue Node Playground
« Reply #25 on: July 10, 2017, 01:49:49 AM »
Time for another round.

Starting with the default scene I always unhook the "Terrain" nodes from the "Compute Terrain" node first. In goes the "Displacement shader" node.
Here I can connect to all the blue node functions I come up with.

In this example I take a "Perlin 3D scalar" node, feed a "Get position in geometry" into the input and try to find a interesting or useful pattern.
Constant scalars going into the "Scale" and "Seed" input of the "Perlin 3D scalar" node. The "CS Perlin Scale" node carries my initial scalar value
(which looked good to me together with the "Seed" node number).
Using the "Multiply Scalar" node with a "Constant Scalar" node as multiplier is like using a slider. This way I keep the initial value I liked so far and
only change the multiplier to change the scale of the pattern. Setting it to 1 resets to the initial value.
I tend to forget the values I change after a few minutes testing and trying... Now I have the pattern I want to go on with.

Then I use the "Length to scalar" node. The node calculates the length, or magnitude of the input vector and then outputs the length as a scalar (Wiki-text).
So, it takes the set of three scalars the vector consists of, and then uses a formula (explained in the Wiki Node Reference) to calculate a single scalar value.
The node views illustrate the steps from Perlin 3D Pattern over Length to scalar to the then clamped output. As you can see disabling the conversion node
(Length to scalar) and connecting the "Perlin 3D scalar" directly to the "Clamp scalar" Input yields a very different result.
Which lets me choose how I want to go on.

The "Divide scalar" and its "Input 2" could be replaced with a "Colour Adjust shader".
They work essentially the same. With the "Divide scalar" node you only need to control one value (CS Divide Input 2).
Faster and easier for the time being.
Feed this into the "Displacement shader"s "Function" input and adjust the value in the "Displacement multiplier" field.
Putting in a positive value will give you something like trenches, carvings, engravings or whatever these things are called;
using a negative value lets rise the ridges (or lowers the rest).
The brownish areas are the result of the "Fractal terrain" attached to the "Input node" of the "Displacement shader".

That`s it. Hope these easy setups are useful to someone (and hopefully I did not mess up the description  ).
Cheers, Klaus
« Last Edit: July 10, 2017, 09:40:49 AM by KlausK »
/ ASUS WS Mainboard / Dual XEON E5-2640v3 / 64GB RAM / NVIDIA GeForce GTX 780 / Win7 Ultimate

#### KlausK

• Member
• Posts: 360
• Land ho!
##### Re: Blue Node Playground
« Reply #26 on: July 10, 2017, 01:06:15 PM »
This is going a little bit further.
Using the "Sin scalar" to feed a "Fractal warp shader". The rings are the output of the "Sin scalar".
The "Constant scalar" connected to the "Divide scalar" is sort of a slider again and controls the "steepness" of the rings.
Meaning, how fast the ring rises: slower and softer, or faster and steeper.
Combined with the "Fractal warp shader" results in the masked out center of the node preview image.
Then I merge the output of the "Displacement shader" I already have, controlled by the original "Fractal terrain" node.
Play a bit with the "Merge mode" of the colour and especially the "Merge Displacement" tab - in this case it is set to
"Multiply (A * Input`s diffuse colour)", add the "Base colours", and this is what I get.
Cheers, Klaus
« Last Edit: July 10, 2017, 11:08:11 PM by KlausK »
/ ASUS WS Mainboard / Dual XEON E5-2640v3 / 64GB RAM / NVIDIA GeForce GTX 780 / Win7 Ultimate

#### Matt

• Planetside Staff
• Posts: 2978
• I'm the crazy one
##### Re: Blue Node Playground
« Reply #27 on: July 16, 2017, 01:34:00 PM »
Then I use the "Length to scalar" node. The node calculates the length, or magnitude of the input vector and then outputs the length as a scalar (Wiki-text).
So, it takes the set of three scalars the vector consists of, and then uses a formula (explained in the Wiki Node Reference) to calculate a single scalar value.
The node views illustrate the steps from Perlin 3D Pattern over Length to scalar to the then clamped output. As you can see disabling the conversion node
(Length to scalar) and connecting the "Perlin 3D scalar" directly to the "Clamp scalar" Input yields a very different result.
Which lets me choose how I want to go on.

Length to Scalar is designed for a vector input, but Perlin 3D Scalar outputs a scalar. If you plug a scalar into a function that expects a vector, Terragen automatically converts the scalar to a vector by copying the scalar into all 3 components of the vector, so if the scalar has value 't' then the vector will be (t,t,t). Now when Length to Scalar computes the magnitude of this vector it will be sqrt(t^2 + t^2 + t^2), which is equal to t * sqrt(3). In other words, using Length to Scalar on a scalar input is simply an inefficient way to multiply it by 1.732.

Matt
« Last Edit: July 16, 2017, 01:36:16 PM by Matt »
Just because milk is white doesn't mean that clouds are made of milk.

#### KlausK

• Member
• Posts: 360
• Land ho!
##### Re: Blue Node Playground
« Reply #28 on: July 16, 2017, 11:33:33 PM »
OK, thank you for the explanation, Matt. I changed the network accordingly.
Cheers, Klaus
/ ASUS WS Mainboard / Dual XEON E5-2640v3 / 64GB RAM / NVIDIA GeForce GTX 780 / Win7 Ultimate

#### KlausK

• Member
• Posts: 360
• Land ho!
##### Re: Blue Node Playground
« Reply #29 on: July 17, 2017, 12:08:13 AM »
Instead of painting a mask I generated it with blue nodes. "Mask Manipulator" in the network view.
This is fed into the "Fractal terrain" node which acts as a "Mix Controller" in the "Merge" node.
The pictures show the effect of the mask, using positive and negative values (+- 10) for the applied "White Colour".
This helps to control elevated or sunk in terrain respectively. Very nicely carved out structures, I think.
"Base colours" have the scale values manipulated differently.
Cheers, Klaus
/ ASUS WS Mainboard / Dual XEON E5-2640v3 / 64GB RAM / NVIDIA GeForce GTX 780 / Win7 Ultimate