Scalar to what?

Hi folks, maybe everyone knows this one but I certainly don’t get it. What exactly does Scalar mean?? (I’m talking about the render tree here) Theres colour to scalar, scalar to vector? can someone please, in simple terms (im no einstein) explain what it means, thanks.

A scalar value is nothing more than a value that ranges from 0 to 1 (it’s in the docs). It applies to parameters that require this kind of values.

Also, from what I understand, it’s only a single channel. For example, if you take a color node, you have 4 channels, RGBA, each one with its own value. But when it’s converted to scalar it becomes one channel with a unique value.

So you can see scalar parameter as a range from one value to another.

On the other hand, a vector value defines the position of a point in a plane (2D, or UV) or space (3D, or UVW). A vector value is obtained by the calculation of several variables. So when you convert a scalar value to vector, the coordinate is obtained by performing some kind of calculation between the scalar variables.

For example, it could take the starting value (0), the end value (1), and the actual value between those values (i.e. 0.25) to generate a new value that will define the bump of a texture.

Of course I could be wrong, if so please correct me.

Hope this helps
Salutations - Cheers
Bernard Lebel

Thanks Atyss, I kinda understand, but just to make it more practical, could you describe a scene where scalar to vector would come in useful?
An explanation of how and why it is used would really make it easier to understand. Thanks.

@@A scalar value is nothing more than a value that ranges from 0 to 1 (it’s in the docs). It applies to parameters that require this kind of values.

Not quite. here are all the mental ray data types as seen in the rendertree (as defined by mental images):

  1. Boolean: A variable that can have only two possible values. Usually represents true/false or on/off. The meaning of the two values is arbitrary and for you to decide.

  2. Integer: Any whole number. Examples: 1, 2, 3, 457876, 0, -765, etc… Integers do not have fractional components (eg: no decimal point)

  3. Scalar: A superset of an integer and is any real number that represents size/magnitude of something (consult a physics book for a more precise definition). However in software it’s usually defined as any value that contains a decimal point. Examples: 3.14159, -99999.343238783, 1.0, -58.63, 2.718, 0.00000000000067, etc…

  4. Vector: The combination of 3 scalars where each scalar represents a size/magnitude in a particular direction. In XSI vectors are represented as X, Y, and Z, but in the real world, a vector can be the combination of 3 scalars representing any 3 distinct directions (eg: north/south/east, or up/down/left, etc…). Vectors are primarily used to define the orientation or position of something, but have other purposes as well.

One important quality about vectors is that they can be perceived as a point or a line depending on it’s use. Example: the vector (3,4,5) can be a point which is 3 units away from the origin in X, 4 units from the origin in Y, and 5 units from the origin in Z. But it can also be thought of as a line that starts at (0,0,0) and ends at (3,4,5). Also, if thought of as a line, it’s important to note that vectors are independent of world position - that is, the vector can exist anywhere in space as the only iron clad qualities it has are size (length) and direction (which way it’s pointing). Where it’s located has no effect on size or direction. I’ll leave the math and other advanced topics for another day.

  1. Matrix: A combination of numbers that form a matrix (grid). In 3D softwares, matrices are usually a combination of vectors that represent the XYZ axis of an object along with any position, rotation or scaling offsets. Matrix dimensions are very arbitrary and vary upon use. Again, I’ll leave the discussion for another day.

  2. Color: A combination of 4 scalars that describe the Red, Green, Blue, and Alpha components of a color (RGBA). Very similar to a vector in math terms.

  3. Texture: A value that is the combination of both a color and a vector. The vector portion describes location or offset of the color within the source. Used mostly to extract information from a bitmap image (such as a particular pixel’s color).

Hope this helps,

Matt


Matt Lind
Animator / Technical Director
Softimage certified instructor:
Softimage|3D
Softimage|XSI
speye_21@hotmail.com

Well I can’t really generalize this, because it really depends on the scene. Honestly I don’t think it’s very relevant to master such concepts (I don’t) if don’t want to program, just understanding them suffices.

Why? Because when you put nodes in the Render Tree that are of different nature, XSI automatically put conversion nodes between them. It’s really up to you to experiment. I encourage you to start with Bumpmap Generator and Space_Generator nodes.

Just remember that a vector is a value used to represent spatial coordinates and a scalar is a value that represent, well, a single value.

Hope this helps
Salutations - Cheers
Bernard Lebel

Thanks for clarifying things, Matt.

In fact, I was not so far from the truth! Just a bit uninformed…

Bernard

Thanks Atyss and thanks matt, you have opened my mind

After playing around with the bump map generator logic has finally caught up with me. Thanks for clearing that up.