0
$\begingroup$

When we look at vectors as colors, we see strange blues and pinks, what exactly does this mean? It seems to be different from normal maps, etc. so I am confused. There may be similar questions, but I could not find them. I would be grateful if you could provide a link if one exists.

$\endgroup$
2
  • $\begingroup$ does this answer your question? blender.stackexchange.com/questions/242857/… $\endgroup$ Apr 5, 2022 at 14:51
  • $\begingroup$ vectors can be anything. The type of data store in normal maps can call vector, the coordinates of vertex can call vector, ... $\endgroup$
    – X Y
    Apr 5, 2022 at 14:54

1 Answer 1

2
$\begingroup$

Vectors are not represented as colors; they're represented as collections of floating point numbers. Collections of floats like that can be interpreted as color data, if you tell Blender to do that. When you use a vector as the input for something expecting color, you're telling Blender to interpret the vector as a color.

A 3D vector is a triplet of x, y, z values. These can be in any range; a normalized 3D vector has components that exist in the -1,1 range. When these are read as colors, there's no special conversion that's done-- it reads x as red, y as green, z as blue. Generally, negative values will thus be clamped to 0 (but it depends on what you're doing with that color value, some shaders can or used to be able to accept negative color values.)

Traditionally, image formats could not accept colors outside of the 0,1 range (which can instead be interpreted as the 0,255 range, in the case of 8 bit per channel color.) Because of this, normal maps have traditionally remapped their normalized vectors, that could exist in the -1,1 range for each component, into the 0,1 range that can be held in, for example, a .bmp. The math for this is simple: you divide the component by 2, then you add 0.5. To convert back to a vector, you subtract 0.5, then multiply by 2.

In Blender's normal map node, and in its normal map bakes, this math is built-in.

So, the frequently found 0,0,1 vector will show up as deep blue when you interpret the vector data as color data. But if you have a normal map representing that vector, it will show up as 0.5,0.5,1 lilac.

$\endgroup$
1
  • $\begingroup$ thanks! i got it! $\endgroup$
    – mumei
    Apr 6, 2022 at 1:50

Not the answer you're looking for? Browse other questions tagged .