Sub topic 3
Controlling placement and scale with the Mapping node
This chapter assumes you can move around the Shader Editor and wire a Principled BSDF. It also assumes you know that UV coordinates are 2D and that Generated and Object coordinates are 3D. The previous chapter covered choosing a coordinate space. This one covers what you do to those coordinates before a texture reads them.
What the Mapping node does
A procedural texture has no pixels. It is a function: you give it a position in space, and it returns a value. The Noise Texture node reads that position from its Vector input. If nothing is connected, it uses Generated coordinates.
The Mapping node sits between the coordinate source and the texture. It takes a vector, applies a translation, a rotation, and a scale, and passes the changed vector on. The texture never knows this happened. It only sees different positions, so the pattern appears moved, turned, or resized.
The node has four inputs:
- Vector: the incoming coordinates, usually from a Texture Coordinate node.
- Location: an XYZ offset.
- Rotation: XYZ Euler angles. The interface shows degrees.
- Scale: an XYZ multiplier.
The node has one output, Vector, which you connect to the Vector input of Noise, Voronoi, or any other texture.
The four Mapping types
The Type dropdown at the top of the node changes how the three transforms are applied. The default is Point.
| Type | What it does | Typical use |
|---|---|---|
| Point | Scales, then rotates, then translates the coordinates. | Most procedural work. |
| Texture | Applies the inverse of those transforms, so the texture itself appears to be scaled, rotated, and moved. | Image-like control, where bigger Scale means bigger features. |
| Vector | Scales and rotates only. Location is ignored. | Directions and offsets, not positions. |
| Normal | Like Vector, but the result is renormalised to length 1. | Transforming normal vectors. |
The difference between Point and Texture is the one that causes confusion. Take Scale = 2 on all axes:
- Point multiplies the coordinates by 2. The texture is sampled twice as densely, so features get smaller.
- Texture divides the coordinates by 2. Features get larger.
Neither is wrong. Point matches how the maths is written. Texture matches how most people think about "scale this texture up". Pick one per project and stay with it, because mixing them in one scene makes numbers hard to compare.
Order of operations in Point mode
In Point mode the transforms run in a fixed order: scale first, then rotation, then location. Two consequences follow.
- Rotation turns the already-scaled coordinates. A non-uniform scale of (1, 1, 5) followed by a 45° rotation about Z does not tilt the stretched axis. It stretches along Z and then rotates the whole field around Z. If you want streaks along a tilted direction, rotate about X or Y.
- Rotation happens around the origin of the coordinate space. With Object coordinates, the origin is the object's origin, so the pattern spins in place. With Generated coordinates, the origin is a corner of the bounding box, so the pattern swings around that corner.
Scale you can predict
The Noise and Voronoi nodes have their own Scale input. It multiplies the coordinates too. In Point mode the two scales multiply each other:
effective frequency = Mapping Scale × Noise Scale
A Noise Scale of 6 with a Mapping Scale of 2 behaves like a Noise Scale of 12. In Texture mode, the same values give 6 ÷ 2 = 3.
A practical habit is to leave the texture's own Scale at a fixed value and do all sizing in the Mapping node. Then every texture in the material responds to the same control, and you can drive several textures from one Mapping node so their patterns stay in step.
Non-uniform scale: stretching on purpose
Setting different values on each axis stretches the pattern. This is how you get streaks, grain, and brushed metal from a plain Noise Texture.
In Point mode, a Scale of (1, 1, 10) compresses the pattern along Z. Features become thin in Z and long in X and Y. A Scale of (30, 1, 1) gives thin vertical bands that repeat along X.
The same effect appears by accident, and then it is a bug. The usual causes are:
- Non-uniform object scale. Object coordinates are the object's local coordinates, so they ignore the object's scale. If you scale a cube to 1 × 1 × 4 in Object Mode, the mesh is stretched but the coordinates are not. The pattern stretches with it. Press Ctrl+A and choose Scale to bake the scale into the mesh. The local coordinates then match the real dimensions.
- Generated coordinates on a long object. Generated coordinates run from 0 to 1 across the bounding box on every axis. A long, thin plank has 0 to 1 squeezed or stretched along its length, so noise looks stretched. Switch to Object coordinates for uniform scale.
- Stretched UV islands. UV coordinates follow the unwrap. A distorted island gives a distorted pattern.
Working with UV coordinates
UV input is a 2D coordinate with Z fixed at 0. Mapping still works, with two cautions:
- Only rotation about Z has a visible effect on a flat UV layout. Rotating about X or Y tilts the plane out of the Z = 0 slice the texture is reading.
- A 3D Noise Texture reading UV data samples one flat slice of a 3D field. Changing Location Z moves to a different slice. This gives you a free way to get a new random-looking variant of the same pattern.
Building it in Python
This script builds a streak pattern. It uses Object coordinates, a Point mapping with a strong Z scale, and a small tilt about X. Note that the Python API takes rotation in radians, even though the interface shows degrees.
import math
import bpy
mat = bpy.data.materials.new("StretchedNoise")
mat.use_nodes = True
nodes = mat.node_tree.nodes
links = mat.node_tree.links
bsdf = nodes["Principled BSDF"]
coord = nodes.new("ShaderNodeTexCoord")
mapping = nodes.new("ShaderNodeMapping")
mapping.vector_type = 'POINT'
mapping.inputs["Location"].default_value = (0.0, 0.0, 0.0)
mapping.inputs["Rotation"].default_value = (math.radians(10), 0.0, 0.0)
mapping.inputs["Scale"].default_value = (1.0, 1.0, 10.0)
noise = nodes.new("ShaderNodeTexNoise")
noise.inputs["Scale"].default_value = 5.0
noise.inputs["Detail"].default_value = 4.0
ramp = nodes.new("ShaderNodeValToRGB")
ramp.color_ramp.elements[0].position = 0.4
ramp.color_ramp.elements[1].position = 0.6
links.new(coord.outputs["Object"], mapping.inputs["Vector"])
links.new(mapping.outputs["Vector"], noise.inputs["Vector"])
links.new(noise.outputs["Fac"], ramp.inputs["Fac"])
links.new(ramp.outputs["Color"], bsdf.inputs["Base Color"])The effective frequency here is 5 along X and Y, and 50 along Z. To show the Texture type, this variant replaces the mapping setup. The same numbers now make the features larger instead of smaller.
import bpy
mat = bpy.data.materials.new("TextureTypeMapping")
mat.use_nodes = True
nodes = mat.node_tree.nodes
links = mat.node_tree.links
bsdf = nodes["Principled BSDF"]
coord = nodes.new("ShaderNodeTexCoord")
mapping = nodes.new("ShaderNodeMapping")
mapping.vector_type = 'TEXTURE'
mapping.inputs["Scale"].default_value = (2.0, 2.0, 2.0)
noise = nodes.new("ShaderNodeTexNoise")
noise.inputs["Scale"].default_value = 6.0
links.new(coord.outputs["Object"], mapping.inputs["Vector"])
links.new(mapping.outputs["Vector"], noise.inputs["Vector"])
links.new(noise.outputs["Color"], bsdf.inputs["Base Color"])
# Texture type divides coordinates by Scale, so the effective
# noise frequency is 6 / 2 = 3, not 6 * 2 = 12.Troubleshooting checklist
Work through these in order when a pattern looks wrong:
- Is the Mapping node actually in the chain? Its Vector output must go to the texture's Vector input. A Mapping node connected to nothing has no effect.
- Is the order right? Mapping goes between the coordinate source and the texture, not after the texture. Its output is a vector, not a colour or a factor.
- Which Type is selected? If scaling goes the opposite way from what you expect, the type is probably Texture when you assumed Point, or the other way round.
- Are two scales stacked? Compare the Mapping Scale with the texture's own Scale.
- Is the pattern stretched? Check the object scale, then the coordinate space, then the UVs.
- Is the pattern rotating around the wrong point? Switch from Generated to Object coordinates, or add a Location offset to move the pivot.
- Are the angles huge in a script? Passing 45 instead of
math.radians(45)rotates by about 2578°, which looks like a random pattern.
Using Location for variation
Location shifts the sampled region. A texture is the same everywhere in space, so moving the Location by a few units shows a different part of it. This has two common uses:
- Seeds. Duplicate a material and change Location to get a distinct but similar look, for example for several rocks.
- Animation. Keyframe or drive Location Z on a 2D-looking pattern to make it evolve, such as flowing noise for water or clouds.
Exercise
A Mapping node in Point mode has Scale (3, 3, 3), and the Noise Texture it feeds has Scale 4. What is the effective frequency? If you change the Mapping type to Texture with the same numbers, what is it?
Show answer
In Point mode the scales multiply, so the frequency is 3 × 4 = 12. In Texture mode the Mapping Scale divides the coordinates, so the frequency is 4 ÷ 3, about 1.33. The Point result has much finer features than the Texture result.
Exercise
You apply a noise-based wood-grain material to a plank that was scaled to (1, 1, 6) in Object Mode. The grain looks stretched along the plank's length even though the Mapping Scale is (1, 1, 1) and you use Object coordinates. What is the cause, and what two fixes would work?
Show answer
Object coordinates are local, so they ignore the object's scale. The mesh is stretched by 6 along Z, but the texture is sampled in unstretched local space, so the pattern stretches with the mesh. One fix is to apply the object's scale with Ctrl+A, then Scale, so the local coordinates match the real size. The other is to compensate in the Mapping node, for example with a Scale of (1, 1, 6) in Point mode, which makes features 6 times denser along Z and cancels the stretch.