Sub topic 3
Controlling Placement and Scale with the Mapping Node
The Mapping node transforms texture coordinates before they reach a procedural texture. It can move, rotate, or scale a pattern without changing the mesh or the texture node itself.
This chapter assumes you can open Blender’s Shader Editor, create a material, and identify the Principled BSDF node. You should also understand the difference between UV coordinates and 3D coordinates.
How the Mapping node works
A procedural texture evaluates a value at each point on a surface. The texture coordinate tells the node which point it is evaluating. The Mapping node changes that coordinate first.
A typical chain is:
Texture Coordinate → Mapping → Noise Texture → Colour Ramp → Principled BSDFThe Mapping node has three main transformations:
- Location moves the pattern through space.
- Rotation turns the pattern around the coordinate axes.
- Scale changes the distance between repeating features.
For example, increasing Mapping Scale from 1 to 4 makes the coordinates four times larger before they reach the texture. A Noise Texture then produces smaller, more frequent features.
Choosing a coordinate space
The Texture Coordinate node provides several coordinate spaces. The choice affects whether the pattern follows the object, its UV layout, or the scene.
| Coordinate output | Best use | Common behavior |
|---|---|---|
| Generated | Quick object-bounded textures | Uses a normalized bounding box |
| Object | Consistent local 3D placement | Follows the object’s local space |
| UV | Precise 2D artwork and masks | Depends on the mesh’s UV map |
| Normal | Effects based on surface direction | Useful for directional shading |
Generated coordinates are convenient because they usually fill the object from 0 to 1. They can change when the object’s dimensions or bounding box change.
Object coordinates are useful for 3D materials such as stone, wood, or smoke-like patterns. They do not require a UV unwrap. However, two objects with different locations or rotations can show different parts of the same pattern.
Controlling pattern size
A procedural texture usually has its own Scale input. The Mapping node and the texture Scale input both affect feature size, but they do so at different points in the graph.
Use the Mapping node when you want to transform the complete coordinate field. This is useful when several textures must share the same scale or alignment. Use the Noise Texture’s Scale input when you want to adjust only that texture’s frequency.
For a rock material, you might use Mapping Scale (2, 2, 2) for the overall coordinate space, then set Noise Texture Scale to 5. This gives medium-sized noise while leaving room to reuse the transformed coordinates for another pattern.
Building the setup with Python
This script creates a material with Object coordinates, a Mapping node, and a Noise Texture connected to the Principled BSDF.
import bpy
material = bpy.data.materials.new("MappedNoise")
material.use_nodes = True
nodes = material.node_tree.nodes
links = material.node_tree.links
nodes.clear()
output = nodes.new("ShaderNodeOutputMaterial")
bsdf = nodes.new("ShaderNodeBsdfPrincipled")
coord = nodes.new("ShaderNodeTexCoord")
mapping = nodes.new("ShaderNodeMapping")
noise = nodes.new("ShaderNodeTexNoise")
mapping.inputs["Location"].default_value = (0.2, 0.0, 0.0)
mapping.inputs["Rotation"].default_value[2] = 0.5
mapping.inputs["Scale"].default_value = (2.0, 2.0, 2.0)
noise.inputs["Scale"].default_value = 4.0
links.new(coord.outputs["Object"], mapping.inputs["Vector"])
links.new(mapping.outputs["Vector"], noise.inputs["Vector"])
links.new(noise.outputs["Fac"], bsdf.inputs["Base Color"])
links.new(bsdf.outputs["BSDF"], output.inputs["Surface"])
bpy.context.object.data.materials.append(material)The rotation value in this Python example is in radians. The Shader Editor displays rotation in degrees, so a value of about 0.5 radians appears as approximately 28.6 degrees.
Exercise
A noise pattern is too large, but another texture using the same coordinates already has the correct size. Where should you adjust the scale?
Show answer
Adjust the Noise Texture’s Scale input. Changing the Mapping node would transform the shared coordinates and affect both textures.