# What happens when a vector is fed into a value slot of the add node?

I was wondering what happens when a vector is fed into a Math -> Add node. Notice that I'm asking about the Math -> Add node, not the Vector Math -> Add node.

My guess was that the node automatically works with the vector module, but I noticed that with different normal vectors the output is different.

Can somebody explain the behavior of the node in this case?

ðŸŸ£ Vector values convert to âš« scalar values by averaging all three components, therefore the following material should be white:

(both branches compare as equal)

âš  At very big values the $$Îµ = 0$$ starts to fail due to floating point inaccuracies:

(383 m cube)

Crantisz'es answer is incorrect, if it worked by converting ðŸŸ£ vector through ðŸŸ¡ color to âš« scalar, then this material wouldn't be black (I even increased Îµpsilon to 0.1):

ðŸŸ£ Vector is Converted to color (and vice-versa) by simply treating XYZ as RGB (I think it's fair to say it's reinterpretation, not conversion, the values in memory don't change), however, ðŸŸ£ vector and ðŸŸ¡ color convert differently to âš« scalars:

• ðŸŸ£ vector to âš« scalar: $$v = {1\over3} x + {1\over3} y + {1\over3} z = {x+y+z\over3}$$
• ðŸŸ¡ color to âš« scalar: $$v = 0.2126r + 0.7152g + 0.0722b =$$ luminance(rgb)

For completeness, âš« scalar converts both to ðŸŸ£ vector and ðŸŸ¡ color by triplicating (repeating) its value on all 3 components, which maintains luminance, and so is a reverse operation for both $$ðŸŸ£âž¡âš«$$ and ðŸŸ¡âž¡âš«.

## Geometry Nodes

In gnoodles the same rules apply, but additionally:

• âš« Float (Scalar) values convert to ðŸŒ¸ Boolean as True if they are positive ($$> 0$$)
• ðŸŸ£ Vectors convert to ðŸŒ¸ boolean as False if all the components are zero, otherwise to True. You can reason about it as the length of vector being used in the logic of scalar to Boolean conversion (the length is never negative but can be $$0$$).
• ðŸŸ¡ Color is first converted to âš« Float (using its luminance), and then converted to ðŸŒ¸ Boolean.
• âš« Float converts to ðŸŸ¢ integers by truncating, which is discarding the fractional part (rounding towards zero; flooring positive values and ceiling negative values).
• Thank you. I tried it out with many different vectors and, indeed, the Compare returns always true.
– FDC
Jun 22, 2022 at 9:27

Vector converts to color, and the color data is converted to its gray scale equivalent

From Blender Wiki:

Some socket types can be converted to other socket types either implicitly or explicitly. Implicit conversion can happen automatically without the need of a conversion node.

For example, color and float sockets can both be placed into one another. Once a socket conversion is made data may be lost and cannot be retrieved later down the node tree. Implicit socket conversion can sometimes change the data units as well. When plugging a Value input node into an angle socket will default to use radians regardless of the scene Units. This happens because the Value node has no unit while the angle input does.

Valid conversions:

Between color and vector â€“ in this case the using individual color channels to store the vector.

Between color and float â€“ the color data is converted to its gray scale equivalent.

Color/float/vector to Shader â€“ implicitly converts to color and gives the result of using an Emission node.

Explicit conversion requires the use of a conversion node for example the Shader To RGB node or the RGB to BW Node node. The Math Node node also contains some functions to convert between degrees and radians.

• This answer doesn't mention vector to scalar conversion, unless I understood correctly that you claim when converting ðŸŸ£ to âš«, since it's not listed in "valid conversions", the actual conversion becomes ðŸŸ£ âž¡ ðŸŸ¡ âž¡ âš« (which is incorrect as I argue in my answer) Jun 22, 2022 at 9:48