How to Use Geometry Node in Blender Shader Editor
The Geometry node in Blender's Shader Editor extracts geometric data directly from your 3D mesh and feeds it into your shader setup. This guide explains what the Geometry node outputs do and provides clear, practical examples for using them to create dynamic, procedural materials such as edge wear, directional snow, and two-sided textures.
Key Outputs of the Geometry Node
To add the node, open the Shader Editor, press
Shift + A, and navigate to Input >
Geometry.
The node provides several outputs based on the geometry being rendered:
- Position: Outputs the 3D X, Y, and Z coordinates of the surface in world space.
- Normal: Provides the direction the surface is facing, adjusted for smooth shading and bump maps.
- True Normal: Provides the actual geometric orientation of the face, ignoring smooth shading or normal maps.
- Tangent: Outputs the direction vector along the surface, typically aligned with UV maps.
- Incoming: The vector pointing from the camera to the surface point being shaded.
- Parametric: Surface coordinates relative to the face (primarily used for curves or specific surface mapping).
- Backfacing: Outputs
1.0if the polygon face is viewed from behind, and0.0if viewed from the front. - Pointiness: Calculates the curvature of the mesh surface. Sharper edges output higher values (brighter), while flat or concave areas output lower values (darker). Note: This output works best with dense geometry and is calculated at render time.
- Random Per Island: Outputs a unique random value
between
0.0and1.0for each disconnected piece of geometry within the same object.
How to Set Up Common Effects
1. Creating Procedural Edge Wear (Using Pointiness)
The Pointiness output detects the convex edges of a mesh, making it ideal for creating worn-down paint or metal highlights.
- Connect the Pointiness output of the
Geometry node to a ColorRamp node
(
Shift + A > Converter > ColorRamp). - Move the black and white flags closer together in the ColorRamp to increase the contrast on the edges.
- Plug the ColorRamp output into the Factor input of a Mix Shader node to mix a base material (e.g., painted wood) with an edge material (e.g., bare metal).
2. Adding Directional Snow or Dust (Using Normal)
You can isolate faces pointing straight up (along the global Z-axis) to apply effects like snow, dust, or moss.
- Connect the Normal output of the
Geometry node to a Separate XYZ node
(
Shift + A > Converter > Separate XYZ). - Take the Z output and plug it into a ColorRamp node.
- Adjust the ColorRamp handles to sharpen the gradient where the surface faces upward.
- Use this output as a mask in a Mix Color or Mix Shader node to place a snow/dust texture only on the top-facing parts of the model.
3. Creating Two-Sided Materials (Using Backfacing)
The Backfacing output allows single-plane meshes (like leaves, paper, or clothing) to display different textures on opposite sides.
- Set up two separate shaders (e.g., one Principled BSDF for the front of a leaf, and another for the back).
- Connect both shaders into a Mix Shader node.
- Plug the Backfacing output from the Geometry node into the Factor input of the Mix Shader.
- The front of the polygon will now render the first shader, while the back renders the second shader.
4. Randomizing Colors on Unmerged Meshes (Using Random Per Island)
If you have an object made of multiple pieces (such as a chain, a pile of bricks, or leaves on a tree), you can give each piece a distinct color automatically.
- Connect the Random Per Island output to a ColorRamp node.
- Set the ColorRamp interpolation to Constant or Linear and choose multiple colors.
- Plug the output of the ColorRamp into the Base Color of your Principled BSDF node.