Planetside Software Forums

General => Image Sharing => Topic started by: KlausK on May 15, 2017, 08:44:03 PM

Title: Blue Node Playground
Post by: KlausK on May 15, 2017, 08:44:03 PM
Hello everyone

wouldn`t it be nice to have a thread where anybody can show random examples of his or her blue node functions.
Code snippets so to speak. Not too complicated and elaborated but more of a place to start and see some combinations of nodes in action.
Converting simple mathematical functions to blue nodes, or just start off with a "Get position" node and connect in trial and error.
This could help build up a library of simple building blocks to give everyone some ideas how to implement them in their terrains.

A place to get started in playful examination, perhaps. Join in if you like.
Title: Re: Blue Node Playground
Post by: KlausK on May 15, 2017, 08:56:44 PM
I`ll start off with this one:

extract the x value from the "Get position" two times, rotate it around y, convert to scalar and on one side of the tree
divide the scalar and, on the other side connect a sin function node and multiply it with a scalar value. Mix the results
and feed them into a "Displacement" node. This gives you the wavy forms of the "Mix scalar Preview" (125m scale).
You better mask this off - as I did in the surface layer - because else it covers the whole planet and gets very slow.
The "Fractal Warp shader" makes for the nice connection of the waves and the surrounding terrain / surface.
No "Compute Normals" involved.
cheers, Klaus
Title: Re: Blue Node Playground
Post by: cyphyr on May 15, 2017, 09:29:16 PM
nice  ;D
I guess you could replace one of the rotate nodes with a "z to scalar" and get a similar (but different) result.
Very limited travel lappy so can't test stuff too easily ...
Title: Re: Blue Node Playground
Post by: Dune on May 16, 2017, 01:31:54 AM
Cool idea, Klaus. I'll add if I think of something, but do have very little time now.
Title: Re: Blue Node Playground
Post by: archonforest on May 16, 2017, 02:44:26 AM
Great idea!
If someone also can explain what those nodes are doing would be even better. That would help to really understand what is going on under the hood!
Title: Re: Blue Node Playground
Post by: KlausK on May 16, 2017, 03:27:10 AM
Thank you, guys.

@cyphyr: Right. But that is for the re-builder to explore. Possibilities are endless as they say.
This is really only ment as a starting point (see attached new picture).

@Dune: That would be very good.

@archonforest: My intention was that if one rebuilds the shown functions on their own
(that is also a reason why I think these examples should only be small networks) you`ll
start to see the changes every blue node induces when you connected.
Those big and complicated examples one finds in the forum are often way too overwhelming to find
a way through for me. "Divide and conquer" should be the Mantra for this thread.
Small nets, easy to rebuild and try on your own. Sooner or later you`ll get the Blues  ;)

Look at the new picture I attached. That demonstrates my way of working with blue nodes especially.
I open the preview window of a node I try to use or a node later in the network to see a intermediate
result of the connected nodes. This way I get a good indication of what the current node really does.

Regarding your remark to have an explanation of what every node does the WIKI really is the place to go.
The networks here should help you better understand the reference text in the WIKI.
I think it would be too time consuming for the contributor to do that. It also takes out the fun of "hacking"
with blue nodes to a certain degree, I think.
Not everyone has the patience or time or wants to read through lengthy post (like this one eg)...
If you ask to much the thread never really takes off, don`t you think?

Anyway, I`ll try to stay on this and post on a more regular basis. Happy networking!
cheers, Klaus

ps: opening up too many of those previews yields in the little but kind of annoying message which can sometimes lead to a crash.
And yes, I reduced the thread count. So, SAFE OFTEN!
Title: Re: Blue Node Playground
Post by: luvsmuzik on May 16, 2017, 04:01:02 PM
The simple shape layer mask explanation is great here, as well as the "tree formation". We do experiment to see what happens with changing variables, and can use that node setup again elsewhere after trials, which is a great part of the fun! Thanks!
Title: Re: Blue Node Playground
Post by: cyphyr on May 17, 2017, 10:49:18 AM
Here is a small selection from my variable voronoi question in Terragen discussion.
Title: Re: Blue Node Playground
Post by: luvsmuzik on May 17, 2017, 12:40:56 PM
Those look like great results, Richard and Klaus.
I am wondering (as I noticed in a few clip files) possible to give original value in the name of the node...like constant scalar 3,  or constant scalar 50? This would help when trying these setups from these great examples....

I already found out that most of these are not huge values....and intended to delve into what I can find WIKI-wise.
Thanks in advance.
Title: Re: Blue Node Playground
Post by: KlausK on May 17, 2017, 01:05:09 PM
That is cool, Richard.

@luvsmuzik: I agree that it is helpful to include the value in the node name.
Even simpler, since this is not production stuff but a playground, I post the file, of course.
Simply forgot...
cheers, Klaus
Title: Re: Blue Node Playground
Post by: KlausK on May 17, 2017, 09:53:00 PM
Here`s a new one.
Masking with a animated "Get Altitude" node.
This could have been done with simple masks as well, I guess.
I wanted to try the "Get Altitude" node(s) because I do not quite understand how to use them.
Maybe I`ll stumble upon other ways to incorporate them in a node tree.
Other network with this node are very welcome.
cheers, Klaus

Title: Re: Blue Node Playground
Post by: luvsmuzik on May 18, 2017, 09:44:33 AM
That is so awesome!  :)
Title: Re: Blue Node Playground
Post by: KlausK on May 19, 2017, 01:26:38 PM
This one was about trying to find out what to do with the "Function / Trigger" nodes.
I will prepare the project file with some notes when I find the time.
Quite nice the structures I could get with these few nodes. Looks a little like man made
stuff broken by forces of nature or whatever to me. Anyways, could be a good start to
build on after the "Compute Terrain" node, I guess.
There is also some trickery with colour displacement involved.
cheers, Klaus

ps: once more I find that 5mb is not really much for a movie file  :-\
Title: Re: Blue Node Playground
Post by: KlausK on May 19, 2017, 01:27:30 PM
The Movie.
Title: Re: Blue Node Playground
Post by: Oshyan on May 19, 2017, 07:01:03 PM
We're not really intending to host anything except very small videos here. If you need to share larger files of video you can just upload to YouTube or Vimeo, and if you don't want it to be public, just set it to private/link only.

- Oshyan
Title: Re: Blue Node Playground
Post by: Dune on May 20, 2017, 02: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.
Title: Re: Blue Node Playground
Post by: masonspappy on May 20, 2017, 09:15:02 AM
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.
Please keep these images coming.
Title: Re: Blue Node Playground
Post by: KlausK on May 22, 2017, 07: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:
[attach=1]
So, here is what the "Luminance to Scalar" node does to the "Get Position":
[attach=2]

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.
This is converted to radians:
[attach=3]
And this is directly from "Get Position" to "Sin Scalar". Very different result:
[attach=4]

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".

Title: Re: Blue Node Playground
Post by: luvsmuzik on May 22, 2017, 08:46:24 AM
 :) 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.
Title: Re: Blue Node Playground
Post by: Dune on May 22, 2017, 09:38:27 AM
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!
Title: Re: Blue Node Playground
Post by: KlausK on July 06, 2017, 07: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
Title: Re: Blue Node Playground
Post by: luvsmuzik on July 06, 2017, 10:41:54 AM
Wonder if this could be useful using water shaders? Probably enormous render time, I suppose.
Anyway, great effort! :)
Title: Re: Blue Node Playground
Post by: KlausK on July 06, 2017, 12: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
Title: Re: Blue Node Playground
Post by: Dune on July 07, 2017, 02: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).
Title: Re: Blue Node Playground
Post by: KlausK on July 09, 2017, 09:40:10 PM
@Dune: thanks and thanks for the additional info.
Cheers, Klaus
Title: Re: Blue Node Playground
Post by: KlausK on July 09, 2017, 09:49:49 PM
Time for another round.

I was reading about clamped perlin noise in another thread and gave it a try.

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
Title: Re: Blue Node Playground
Post by: KlausK on July 10, 2017, 09:06:15 AM
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
Title: Re: Blue Node Playground
Post by: Matt on July 16, 2017, 09:34:00 AM
Quote from: KlausK on July 09, 2017, 09:49:49 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
Title: Re: Blue Node Playground
Post by: KlausK on July 16, 2017, 07:33:33 PM
OK, thank you for the explanation, Matt. I changed the network accordingly.
Cheers, Klaus
Title: Re: Blue Node Playground
Post by: KlausK on July 16, 2017, 08:08:13 PM
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
Title: Re: Blue Node Playground
Post by: bobbystahr on July 19, 2017, 09:02:31 AM
Cool thread and given a case of insanity I may try it, heh heh heh, cuz it'll make me nuts anyway...Interesting work Klaus...
Title: Re: Blue Node Playground
Post by: KlausK on July 17, 2019, 04:31:29 PM
Hi there,
I`ve been playing with the blue nodes again. So I thought I put my experiments in this old thread again to have it all
- especially the useful comments - in one place. Anyway...

Right now I am trying to understand what the "Get" nodes all do.
It is quite often not really clear to me how to use these nodes in the context of a scene. Let alone how to hook them up in a network,
how to use the data they provide and what kind of data they actually provide (like scalar, vector or whathaveyou).
It would be nice to have some rudimentary example networks for (in my case actually most) blue nodes.

First one I tried is the "Get Camera Position".

The Wiki says: "Provides the current position of the main camera in world space, independent of current shading context."
So what to do with this?
Since it is the main cameras position I thought that an animated camera would be the best way to visualize this.
The (at least my) default scene has a Simple Shape Shader connected to the Mask input of  the Fractal Terrain node.
The picture of the network shows how I fed the Get Camera Position to the Simple Shape Shader.
The Multiply by Constant Scalar helps to magnify the cameras position values to values big enough to be noticable (x 1000 in this case).

The animation file:
At the start of the movie the Camera is far away from the Simple Shape Shaders position.
What happens when you get closer and decrease the distance between Camera and Simple Shape Shader is what is shown in the animation.

Nice and smooth shape shifting.

CHeers, Klaus
Title: Re: Blue Node Playground
Post by: Dune on July 18, 2019, 02:11:02 AM
Interesting. The SSS is just (soft) white, so it seems and keeps that area as it is, with a gradient to the changing terrain. The altitude (green) of the camera position is what seems to change the terrain.... intriguing. So if you'd multiply the (changing) cam-pos with something like a pf, it can be very wild I suppose.
Thanks for sharing this, Klaus.
Title: Re: Blue Node Playground
Post by: DocCharly65 on July 18, 2019, 02:13:24 AM
In fact a very interesting and surreal effect. Looks cool in the video!
Title: Re: Blue Node Playground
Post by: KlausK on July 19, 2019, 07:51:14 AM
Thank you, guys.
I am trying to come up with something more interesting and useful...looks like it takes some time  ???
The tgd of for the video is here now also.

CHeers, Klaus
Title: Re: Blue Node Playground
Post by: Agura Nata on July 19, 2019, 01:09:58 PM
Very interesting!
Title: Re: Blue Node Playground
Post by: KlausK on July 23, 2019, 01:42:11 PM
Thank you, "the first seer".

CHeers, Klaus
Title: Re: Blue Node Playground
Post by: KlausK on July 23, 2019, 01:50:32 PM
Here is something that came out trying to layer and mix voronoi noise patterns.
Now I try to find a reliable way to soften the displaced edges without almost always changing the rest too much.
I uploaded a few more pictures because the camera distance makes a great difference to the overall look of the structures.

The first two pics differ a little bit in displacement values. Flipping between them makes this mor obvious.

CHeers, Klaus

Title: Re: Blue Node Playground
Post by: KlausK on July 23, 2019, 01:53:28 PM
...some more views.
CHeers, Klaus
Title: Re: Blue Node Playground
Post by: KlausK on July 23, 2019, 01:54:10 PM
...and the Network.
CHeers, Klaus
Title: Re: Blue Node Playground
Post by: Dune on July 24, 2019, 02:58:32 AM
Nice experiments, Klaus. I wonder why you have attached the seed input to the get node (seed needs just one number, afaik), and I think the log doesn't do anything (no input to 'log')... any particular reason, or is it just 'random' linking, seeing what it does?
Title: Re: Blue Node Playground
Post by: KlausK on July 24, 2019, 05:20:47 AM
Hi Dune,

it is mostly a mixture of checking my knowledge / understanding / assumption of a function node and trying to verify that.
"seeing what it does" is always a part of this "process".
Also part of that is not really having grasped how the data flows through the network.
I often have trouble rebuilding mathematical formula because i have the feeling that there are sometimes inputs or outputs missing.
But that could - of course - also being me just doing it wrong.
It would be very helpful to be able to visualize the data / numbers / values that a node network produces.
But I cannot for the life of me find out how the "Debug" nodes work...sigh.
Anyway:

Log Scalar:
my thinking was log versus linear. I was hoping to scale the noise less regularly.
But you are right: the missing input on the Log Scalar is a mistake.
The Constant Scalar has to be connected to the Log Scalar and to the Main Input of the Add node.
I must have disconnected it somehow.

The Get Position from Texture is first connected to the X to Scalar node - this goes into the Voronoi.
I wanted the narrower / squeezed and elongated voronoi cells. (hope, that`s understandable...)

Does that answer it?

The attached pics of the changing connections illustrate the differences are quite clearly.
Perhaps someone can use this as a starting point.

CHeers, Klaus

Title: Re: Blue Node Playground
Post by: Dune on July 24, 2019, 05:45:58 AM
Thanks Klaus, it does.

The voronoi cell is very hard edged, maybe you can use the smooth voronoi (color) instead and get interesting results....
Ther are some nice squares in the preview, so maybe those can be rotated and used on a lateral area.
Title: Re: Blue Node Playground
Post by: KlausK on July 24, 2019, 04:08:24 PM
Thanks for the suggestion. I`ll have a go at it sometime.
CHeers, Klaus