Local Space UVs


Search Knowledge Base by Keyword

You are here:

On this page:


Introduction

Local Space UV nodes provide rapid and seamless painting on planar surfaces such as walls, floors, etc. Their use can also be extended to planar effects on non-planar meshes, such as a character’s torso (along its YZ plane), etc. These should be your go-to nodes for creating holes in walls, excavating pits on floors, for graffiti on flat surfaces.

Compared to mesh-space painting, these do not require any special setup on your mesh and perform significantly faster. An advantage they have over world-space painting is better support for dynamic meshes; being local, local-space effects move along with the mesh, which is not true for world-space painting whose effects will need be manually relocated if a dynamic mesh moves.

Local Space painting occurs via location-based / planar mapping. The bounding box of your mesh is used to map the pixels of your mesh along any two axes from the lower extremity of the bounding box to its higher extremity. In other words, a pixel lying closest to a bounding box’s minima along the X axis will be assigned a value close to 0 (for U) while a pixel lying closest to its maxima will be assigned a value of 1. Thus, UVW is calculated in local space.

Because the mapping is planar, you will always lose control of one axis. You can only choose from UV, UW or VW, corresponding to the axes combinations of XY plane, XZ plane and YZ plane respectively. This is the main trade-off you make while choosing a local space node for your effect.

Now let’s take a look a closer look:


Don Local Space XY

This node facilitates painting along the local XY plane, making it ideal for floors and floor-like meshes (or effects).

Along with the regular RGBA information this node contains a special “XY masked alpha” which is used to prevent artifacts from accumulating along the omitted axis (Z in this case). The XY alpha mask is essential for things like painting graffiti because it ensures that your graffiti paint does not accumulate along the Z thickness of your mesh.

R – The red channel of this paint texture

G – The green channel of this paint texture

B – The blue channel of this paint texture

A – The alpha channel of this paint texture. This tells you which parts of the mesh have been painted and which parts haven’t. Gotcha: Because the default paint brush is an Alpha Composite brush, your alpha is inverted! This means the white parts have not been painted while the black parts have. Remember this while blending your effects.

XY Masked Alpha – Similar to the alpha channel, but additionally masks out any pixels that are orthogonal to our plane of interest. This is very important for preventing artifacts from building up along the thickness of your planar mesh.

RGBA – A float4 containing all the channels as a single output

For information on packing multiple effects into R/G/B channels see the Packing RGB channel masks article.


Don Local Space XZ

This node facilitates painting along the local XZ plane, making it ideal for walls and wall-like meshes (or effects). Some walls may be modeled along YZ (in which case you should use the Don Local Space YZ listed below).

Along with the regular RGBA information this node contains a special “XZ masked alpha” which is used to prevent artifacts from accumulating along the omitted axis (Y in this case). The XZ alpha mask is essential for things like painting graffiti on walls because it ensures that your graffiti paint does not accumulate along thickness of your wall.

R – The red channel of this paint texture

G – The green channel of this paint texture

B – The blue channel of this paint texture

A – The alpha channel of this paint texture. This tells you which parts of the mesh have been painted and which parts haven’t. Gotcha: Because the default paint brush is an Alpha Composite brush, your alpha is inverted! This means the white parts have not been painted while the black parts have. Remember this while blending your effects.

XZ Masked Alpha – Similar to the alpha channel, but additionally masks out any pixels that are orthogonal to our plane of interest. This is very important for preventing artifacts from building up along the thickness of your planar mesh.

RGBA – A float4 containing all the channels as a single output

 


Don Local Space YZ

This node facilitates painting along the local YZ plane, making it ideal for certain types of walls and wall-like meshes (or effects). Some walls may be modeled along XZ (in which case you should use the Don Local Space XZ node listed above).

Along with the regular RGBA information this node contains a special “YZ masked alpha” which is used to prevent artifacts from accumulating along the omitted axis (X in this case). The YZ alpha mask is essential for things like painting graffiti on walls because it ensures that your graffiti paint does not accumulate along thickness of your wall.

R – The red channel of this paint texture

G – The green channel of this paint texture

B – The blue channel of this paint texture

A – The alpha channel of this paint texture. This tells you which parts of the mesh have been painted and which parts haven’t. Gotcha: Because the default paint brush is an Alpha Composite brush, your alpha is inverted! This means the white parts have not been painted while the black parts have. Remember this while blending your effects.

YZ Masked Alpha – Similar to the alpha channel, but additionally masks out any pixels that are orthogonal to our plane of interest. This is very important for preventing artifacts from building up along the thickness of your planar mesh.

RGBA – A float4 containing all the channels as a single output