2
$\begingroup$

Lately I found out that apparently there is a W axis in UV-space, which acts just like the Z axis in e.g. global space. Is that true? And if it is the case are there any applications of the W axis when it comes to uses of the UV-space?

Apart from that why is the UV space called UV space then called UV space and not UVW-space? Blender also uses the X and Y hotkeys as axis locking instead of U and V so shouldn't it really be called XY-space?

$\endgroup$
3
  • $\begingroup$ I don't think W axis exists. Didn't you confused by the quaternions? docs.blender.org/manual/en/latest/advanced/appendices/… $\endgroup$
    – FFeller
    May 18 at 16:07
  • $\begingroup$ No I am not talking about quaternions. $\endgroup$ May 18 at 16:10
  • $\begingroup$ W is also used in the Noise Texture for example, if you choose the 4D mode, but it's not an axis per se, it's just used to change the noise shape through time $\endgroup$
    – moonboots
    May 18 at 16:11

2 Answers 2

3
$\begingroup$

'W' doesn't mean anything in a universal sense; it's just "Not X, Y, Z, U, or V."

When we're dealing with XYZ coords, like position, there's also a hidden fourth coordinate that is used, which is referred to as 'W'; this coordinate is useful for the transformations needed to put a vertex into perspective space, and especially for getting perspective-correct interpolation of vertex data. The object-space value of this coordinate is 1 for all vertices. There's no reason to expose this coordinate to users, because there is nothing they'd want to do with it.

As with W, XYZ doesn't mean anything in particular. They're symbols, and their meaning is context dependent. We regularly use X to mean position along the width axis in object space, or world space, or time in the graph editor, or U in the UV editor.

UV is usually used to refer to a position along the horizontal and vertical axes of an image. These might be more easily considered X or Y positions. Why do we call it UV and not XY? Because we were already using X and Y to designate other information. U and V, like W, just mean, "Not X Y Z or W." (Because W, in the use described above, actually predated UV. We picked 'W' because it was the last letter not already in use, and then we picked 'UV' because they were the next two letters not already in use.)

You can have 2D texture coords or 3D texture coords or 15D texture coords if you want, but Blender supports only 2D texture coords. It is not necessary to have a 3rd coordinate to support typical use; in almost all actual shaders, if you read the code, UV will be a 2D value. Internally, your graphics card will need to do some careful manipulations of these values, including the W component calculated from the transformations of vertices, but there is no special W component for the UV.

When we rotate UV in the UV editor, we're doing an operation where it's not really clear what to call the third orthogonal axis. We can call that W if we want, we can call it Z, it doesn't matter unless we have to describe it to someone and there are conflicting uses of those letters in the conversation, at which point we should probably make up a new name for it. Saying that we are rotating it in 'W' would probably be even more confusing than saying we were rotating it in 'Z'; neither is literally true, the only thing that is literally true is that we're rotating it in an axis orthogonal to the two we see on the screen.

Texture coordinates with more than 2 dimensions are sometimes useful. For example, many of Blender's procedural textures can use 3 or 4 "spatial" dimensions-- and really, what constitutes a spatial dimension is arbitrary at that point, we could plug a 5th texture coordinate into some other socket. Texture coordinates with more than 2 dimensions can be emulated in Blender via the use of multiple UV channels. As a real-life example of this, we can make pseudo-generated coordinates by creating a frontal projection from view (bounds) and a profile projection from view (bounds) in different channels, and combining our X + Y from our frontal with our X from the profile into 3D coords. This is occasionally useful, not merely a stupid UV trick (we can get "rest pose position" coordinates this way, without worrying about how future modifiers are going to change our generated coords.)

When we use texture coordinates with more than 2 dimensions, it's not clear what we should call them. We could call them UVW coordinates. 'W' follows 'V' just like 'V' follows 'U'. Of course, that just raises the question, what if we use 4D coords? Any choice of name for these coordinates is arbitrary-- but a rose by any other name would smell as sweet.

$\endgroup$
0
3
$\begingroup$

Some applications do call it UVW space (like 3DS Max), though in Blender that terminology is not frequently used.

When talking about the common case of unwrapping meshes with the purpose of creating a UV layout and using image based textures the W axis is indeed redundant and often omitted because it has little use.

The W axis gains relevance when one talks about procedural textures (like Noise, Musgrave or Waves, among others) that by default expand infinitely in three-dimensional space, or volumetric textures.

These are often but not exclusively used with automatic texture coordinates like Generated or Object, which allow the texture to cover an arbitrary shape seamlessly regardless of crevices or discontinuities, and can also be used in volumetric materials defining density or color throughout all its thickness.

For those situations, the texture space is for all intents and purposes a 3D space, much like a 3D scene of the local coordinates of a geometry which can be manipulated like any one would a mesh.

In these cases the W coordinate is very much real and useful, and is actually present in Blender, though the nodes you can manipulate them with always call it XYZ, like the Separate XYZ node, making it less obvious. In other software it is some time referred to as W coordinate.

Sadly in Blender it is not easy to combine unwrapped UV coordinates with a W axis, but it can be achieved with some node trickery, using the U and V component from the UV layout and combining it with the W coordinate of one of the generated coordinates using a Combine XYZ node.

$\endgroup$
4
  • $\begingroup$ When the vectors in tangent space get converted to global space would the z axis then point in the direction of the shading vector? $\endgroup$ May 18 at 16:14
  • $\begingroup$ As far as I know W axis for generated coordinates always points in local Z axis of the object, unless manipulated not to $\endgroup$ May 18 at 16:26
  • $\begingroup$ I miswrote. I was actually asking about the Z axis of the UV space. $\endgroup$ May 18 at 16:42
  • 1
    $\begingroup$ W should be the Normal vector with respect to uv-space, if I'm thinking properly $\endgroup$ May 18 at 16:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.