# Planetside Software Forums

## Function Nodes In Practice => Function Nodes by Category - UNDER CONSTRUCTION => Add Functions => Topic started by: Hetzen on September 30, 2019, 08:43:45 am

Post by: Hetzen on September 30, 2019, 08:43:45 am
Add Multiplied Scalar will multiple the Main Input with Input 2 and add that result with the Main Input.

Notice this node only looks at Scalar information and ignores any displacement. If the input values are positive, this node will essentially masks Input 2 and add that to the Main Input as you can see in following example. If Input 2 is disconnected, the Main Input passes through to the Output. If the Main Input is disconnected, nothing passes through. This node is a compact way of using an Add Scalar and Multiply Scalar connected in the below example, and can be useful in combining different scales of noise. Title: Re: Add Multiplied Scalar explained
Post by: WAS on October 14, 2019, 01:37:15 pm
I would like you to expand on this, and clarify some information, please. :) No input is masked. It's multiplied by "black" or 0. The data is still there, especially when worked with unclamped scalars. It's been essentially floored to 0. Additionally, negative unclamped values will be multiplied, as well as values above 1.
Title: Re: Add Multiplied Scalar explained
Post by: Hetzen on October 14, 2019, 06:26:44 pm
Thanks Jordan, well spotted. I've corrected the first post to say positive values re-masking.
Title: Re: Add Multiplied Scalar explained
Post by: WAS on October 15, 2019, 01:56:37 pm
Well is information being masked or is it multiplied? Sure it can be used as a mask.

What about the scalar data you are trying to represent? Its chief use is displacement maps (otherwise might as well use Colour functions).

So what about what's actually going on?

What's happening to the data in formula that's representative of mathematics? For example, what about when two locations in both maps contain a value of 0.5 where another has 1, or where both have a value of 1 (or above) and add multiplied? What is the scalar value which would be displacement amplitude?

This post is sorta very basic and just visual, and doesn't correctly cover the function.
Title: Re: Add Multiplied Scalar explained
Post by: WAS on October 15, 2019, 01:59:07 pm
These are all mainly mathematical functions, and I think that's the main focal area that should be being explained. What's happening with these functions under the hood. Visual results are important, but not that important to what's being done inside, or what the result actually translates too in data.
Title: Re: Add Multiplied Scalar explained
Post by: Hetzen on October 15, 2019, 05:16:37 pm
Add Multiplied Scalar as in the last image of the first post is a compact way of connecting an Add Scalar with a Multiply Scalar together in the way that's shown. That's all that is going on.

So if you have a value of 0.5 in the Main Input and 1 in Input 2, the maths is:

0.5 x 1 + 0.5 = 1

If the Main Input is -1 and Input 2 is 1:

-1 x 1 + -1 = -2

or with Main Input is -0.5 and Input 2 is 2:

-0.5 x 2 + -0.5 = -1.5

and so on.

If you add vectors or colour into the inputs, there is a conversion that happens to those three component data streams to make a scalar value with one component. I've tried to cover that in Add Scalar and you can find further information in the the wiki here (https://planetside.co.uk/wiki/index.php?title=Node_Input_Type_Conversion).

Masking (which may have been a descriptive error on my part in the initial post) is essentially multiplying one scalar value with another to hopefully produce an alpha mask of a range of 0 to 1. Black to white.
As you mentioned, you can put in other values which fall out of this range of 0 to 1 depending on the input values.
Title: Re: Add Multiplied Scalar explained
Post by: Oshyan on October 16, 2019, 04:14:44 pm
Posts about the goals and process around the "Functions Nodes in Practice" forum area as a whole have been split into their own discussion.
https://planetside.co.uk/forums/index.php/topic,27174.0.html

Please keep the individual node discussion threads focused on the node in question.

- Oshyan
Title: Re: Add Multiplied Scalar explained
Post by: Tangled-Universe on December 13, 2019, 04:39:40 am
(Oshyan please feel free to move this elsewhere as this starts on-topic and progresses into slightly off-topic)

Hi Jon,

I don't mean to nitpick, but if I read "add multiplied scalar" it means to me I'm adding 2 multiplied values to an existing value.
The existing value is input 1 or say 'A'.
The value to multiply and add (notice the swapped notation) is input 2 or say 'B'.
That would be notated like A+(AxB).