Functions Academy

Started by archonforest, August 08, 2019, 12:15:50 pm

Previous topic - Next topic

archonforest

The first one is ADD-ADD COLOR. I read the Wiki description 3 times and got nothing out of it.  :-\

Why we need this? When we would use it? Examples pls.
Dell T5500 with Dual Hexa Xeon CPU 3Ghz, 32Gb ram
Amiga 1200 8Mb ram, 8Gb ssd

cyphyr

Is this helpful ...ADD_COLOUR.JPG
www.richardfraser.co.uk
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 3900X @3.79Ghz, 64Gb (TG4 benchmark 6:20)
i7 5930K @3.5Ghz, 32Gb (TG4 benchmark 13.44)

archonforest

I think it is a great start! Thanks for your initiative.
Can u show how to put this into the TG default scene. I tried but nothing showed up. LOL.
Dell T5500 with Dual Hexa Xeon CPU 3Ghz, 32Gb ram
Amiga 1200 8Mb ram, 8Gb ssd

cyphyr

You could connect the output of the Add colour 01 node to the colour input of a surface layer if you wanted to.

The thing is that the image above illustrates what the node dose but in-fact that is not very helpful.
It add colour to whatever is coming in on the left hand input.
So what?
Well actually you have to think a bit deeper about it.
Where can you get some colour from and why would you want to do this in the first place.

See what happens if you replace the constant colour node with a power fractal with some colours selected in its colour slots.
See if you get the same or similar results as when using a merge node set to ADD.
(by the way ADD, MULTIPLY, DIVIDE and SUBTRACT are doing the same thing as they do in Photoshop and gimp or any image editing software that has layers)

Often (but not by any means exclusively) blue node networks are used to set up masks through which power fractals or images are filtered.

The point I'm trying to make here is that it is very difficult to helpfully say what a node does or is for in any meaningful way but you can figure out a bunch of stuff by experimentation.
www.richardfraser.co.uk
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 3900X @3.79Ghz, 64Gb (TG4 benchmark 6:20)
i7 5930K @3.5Ghz, 32Gb (TG4 benchmark 13.44)

archonforest

Thanks cyphyr, I got it. What u show here is enough. I do not want to go very complicated here just to show users the basic stuff so they can think with it and use it in their network. Thank you for your help!!

I think we nailed the first node people. I would like to get into the next one which I think work in a similar way like ADD COLOR.

ADD-ADD SCALAR: Per Wiki A scalar is a single number. 1, 200.45, -45, -0.2 are all examples of scalar values.

Okay can anyone elaborate on how to use this and what it can do? If you can do a screenshot that would be great. Of course if this node can be used a million way just mention some. 

 
Dell T5500 with Dual Hexa Xeon CPU 3Ghz, 32Gb ram
Amiga 1200 8Mb ram, 8Gb ssd

WAS

Quote from: cyphyr on August 08, 2019, 02:49:07 pmYou could connect the output of the Add colour 01 node to the colour input of a surface layer if you wanted to.

The thing is that the image above illustrates what the node dose but in-fact that is not very helpful.
It add colour to whatever is coming in on the left hand input.
So what?
Well actually you have to think a bit deeper about it.
Where can you get some colour from and why would you want to do this in the first place.

See what happens if you replace the constant colour node with a power fractal with some colours selected in its colour slots.
See if you get the same or similar results as when using a merge node set to ADD.
(by the way ADD, MULTIPLY, DIVIDE and SUBTRACT are doing the same thing as they do in Photoshop and gimp or any image editing software that has layers)

Often (but not by any means exclusively) blue node networks are used to set up masks through which power fractals or images are filtered.

The point I'm trying to make here is that it is very difficult to helpfully say what a node does or is for in any meaningful way but you can figure out a bunch of stuff by experimentation.


I entirely disagree. They are basic functions, that take either colour, scalar, or vector input. What you do with them is besides the point of what they do themselves.

Blue nodes may be often used for masks but that most certainly is not really the intended use. They are raw operators and functions which you can build whole mathematic formulas from such as Hetzen's Manhattan Voronoi noise. That's where a lot of the misconceptions of blue nodes come about because the concept is pretty advanced algebra, etc.
Check out my Terragen Discord: https://discord.gg/Vy5FRTE

N-drju

I don't think explaining functions in a single post is a good idea - everything will eventually get buried in between hundreds or replies...
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

archonforest

Quote from: N-drju on August 08, 2019, 04:36:04 pmI don't think explaining functions in a single post is a good idea - everything will eventually get buried in between hundreds or replies...

I think it is way better than we have now which is nothing.  Otherwise I intended to collect the data up per node.
Dell T5500 with Dual Hexa Xeon CPU 3Ghz, 32Gb ram
Amiga 1200 8Mb ram, 8Gb ssd

Dune

Well, I'll add a little. First of all I use add color/scalar and multiply or multiply inverse a lot for masks. Very handy and (in my believe, but I may be wrong) faster as a single simple blue node than using a merge shader, where the computation might have to read more while only add color is used. Don't know about that.
But it's also interesting to realize that say a multiply color/scalar or add color/scalar gives interesting effects when using negative colors (or scalars for that matter, I often mix them up). Negative*negative=positive.
So e.g. when doing a cliff with whites for lateral outcrops, masked/multiplied by a white to black PF or whatever to get them only at specific places, you can blue node add a PF with -1 and -2 for high and low color to the inverse of that mask, and variably dent the remaining rock (off the outcrops) inwards. If using -1 and -1.1 it'll be less variable, that's how it works. And the sizes speak for themselves.
And it's easy to just go experimenting on the flat surface with those blue nodes and some pf's or simple shapes and add the last color output into a displacement shader, and see what moves up. Get to know the principle. 

N-drju

Quote from: Dune on August 09, 2019, 01:53:37 amSo e.g. when doing a cliff with whites for lateral outcrops, masked/multiplied by a white to black PF or whatever to get them only at specific places, you can blue node add a PF with -1 and -2 for high and low color to the inverse of that mask, and variably dent the remaining rock (off the outcrops) inwards. If using -1 and -1.1 it'll be less variable, that's how it works. And the sizes speak for themselves.

Example, pretty please? ;)

Quote from: archonforest on August 08, 2019, 08:44:00 pm
Quote from: N-drju on August 08, 2019, 04:36:04 pmI don't think explaining functions in a single post is a good idea - everything will eventually get buried in between hundreds or replies...

I think it is way better than we have now which is nothing.  Otherwise I intended to collect the data up per node.

It will actually get worse the more items land in here. I'm sure you know that there is no way of benchmarking posts on this forum. With that being said - how am I supposed to find "get position in geometry" node in ten years or so...?

The better idea, would be to create a webpage or a separate forum to cover these topics. Then, we could create a post per each node instead of all of them clustered up together...

Also, I'm afraid we didn't "nail" anything. The example that cyphyr gave (no offense) does not convince me at all - almost identical transformations can be done by just merging regular PFs or modifying a PF internal values, why would I need a function to play with color then?!

Just because we've listed one example of the "ADD COLOUR" usage, does not mean that the subject is closed! WAS is the only one who actually "nailed" anything:

Quote from: WASasquatch on August 08, 2019, 04:18:16 pm
Quote from: cyphyr on August 08, 2019, 02:49:07 pmWhat you do with them is besides the point of what they do themselves.

::)
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

WAS

Quote from: Dune on August 09, 2019, 01:53:37 amWell, I'll add a little. First of all I use add color/scalar and multiply or multiply inverse a lot for masks. Very handy and (in my believe, but I may be wrong) faster as a single simple blue node than using a merge shader, where the computation might have to read more while only add color is used. Don't know about that.
But it's also interesting to realize that say a multiply color/scalar or add color/scalar gives interesting effects when using negative colors (or scalars for that matter, I often mix them up). Negative*negative=positive.
So e.g. when doing a cliff with whites for lateral outcrops, masked/multiplied by a white to black PF or whatever to get them only at specific places, you can blue node add a PF with -1 and -2 for high and low color to the inverse of that mask, and variably dent the remaining rock (off the outcrops) inwards. If using -1 and -1.1 it'll be less variable, that's how it works. And the sizes speak for themselves.
And it's easy to just go experimenting on the flat surface with those blue nodes and some pf's or simple shapes and add the last color output into a displacement shader, and see what moves up. Get to know the principle. 

I'm currently rebuilding a new planetoid crater shader that covers larger and small craters, outputting RGB, where R is displacement map, B is crater floors map, and C is ejecta map. It didn't take long to see that all the merge shaders were slower than add/mix scalars. Though I may have missed some check marks for displacement making it redundantly slow but I do try to turn that off for just color/scalar input. Also just seemed easier to manage than merges
Check out my Terragen Discord: https://discord.gg/Vy5FRTE

Dune


cyphyr

Quote from: WASasquatch on August 08, 2019, 04:18:16 pmI entirely disagree. They are basic functions, that take either colour, scalar, or vector input. What you do with them is besides the point of what they do themselves.

Blue nodes may be often used for masks but that most certainly is not really the intended use. They are raw operators and functions which you can build whole mathematic formulas from such as Hetzen's Manhattan Voronoi noise. That's where a lot of the misconceptions of blue nodes come about because the concept is pretty advanced algebra, etc.

Well I'll entirely disagree back at ya!
"What you do with them is besides the point of what they do themselves."
No, actually the exact opposite.
The point is what I can achieve using a node. In isolation the nodes don't "do" much at all. They have to be plugged into a scene before they become useful.

It may be useful from a purely intellectual exercise perspective to know what each note does independently but that is without context. We are artists (for the most part) and the nodes are our brushes and in most cases we have a visual goal in mind when we fire up Terragen, a sunset, rolling hills, an alien planet, whatever.

Quote from: N-drjuAlso, I'm afraid we didn't "nail" anything. The example that cyphyr gave (no offense) does not convince me at all - almost identical transformations can be done by just merging regular PFs or modifying a PF internal values, why would I need a function to play with color then?!

No offence taken.
The point of my example was that simply knowing what an ADD COLOUR node is doing is not very helpful without context. However knowing that you can achieve the same result with a merge node actually IS helpful. That is the beginning of a META understanding of how the nodes work. We have learnt that the ADD COLOUR node is part of the internal make-up of the merge node. (So is the MULTIPLY_COLOUR, MIX_COLOUR, SUBTRACT_COLOUR, DIVIDE_COLOUR and the scalar equivalents).

"why would I need a function to play with color then?" Because you could create a lighter weight scene than using the more complex (albeit more user-friendly)red nodes.
www.richardfraser.co.uk
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 3900X @3.79Ghz, 64Gb (TG4 benchmark 6:20)
i7 5930K @3.5Ghz, 32Gb (TG4 benchmark 13.44)

cyphyr

Quote from: WASasquatch on August 09, 2019, 03:15:10 am...
 It didn't take long to see that all the merge shaders were slower than add/mix scalars. Though I may have missed some check marks for displacement making it redundantly slow but I do try to turn that off for just color/scalar input. Also just seemed easier to manage than merges
You have just proven my point nicely.
knowing what the node is doing IN CONTEXT is far more helpful than knowing what it is doing in isolation :)
www.richardfraser.co.uk
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 3900X @3.79Ghz, 64Gb (TG4 benchmark 6:20)
i7 5930K @3.5Ghz, 32Gb (TG4 benchmark 13.44)

Matt

I think it's a good idea to have a separate topic for each node or node family. Add Colour, Add Scalar and Add Vector are part of the "Add" family of function nodes.

I can see some logic to the Multiply nodes being part of the same topic, but as more and more nodes are discussed we will need some criteria to separate them.

So I'd recommend one topic for Add Scalar/Colour/Vector, another topic for Multiply, another for Trigonometry functions, and so on.

If it helps, we can create a new forum section to provide a home for these. And since this topic has already started to become a discussion about more than just Add nodes, we could split this topic so that the Add nodes can be discussed on their own.

Just because milk is white doesn't mean that clouds are made of milk.