Comparing Edge Split, Autosmooth And Manual Shading Techniques In Blender

What is Shading in Blender?

Shading refers to the process of depicting depth, texture, and form on 3D models in Blender. Proper shading helps make models look more realistic and visually appealing. There are several common shading methods used in Blender:

  • Flat shading – Sets the normal of each face of a model to face directly outwards, creating a faceted look.
  • Smooth shading – Averages the normals of adjacent faces, creating soft gradients between faces.
  • Autosmooth – Smooths shading between faces forming an angle below a specified threshold.
  • Edge split – Splits hard edges on models so connected faces can maintain different shading.

Edge Split

Edge split is a shading method that splits sharp edges on models while keeping smooth shaded faces connected. This allows adjacent faces to retain different normals and shading. Typically edge split is used on models with both hard surface and curved areas.

Edge split is most useful when you want sharp edges to depict boundaries, details, or hard surface borders on an otherwise smooth model. For example, you may use edge split on a smooth human model to get crisp edges around muscular definition or clothing folds.

Edge Split Settings

There are two main settings for controlling edge split:

  • Split Angle – The angle below which edges will be split. Any edge forming an angle greater than this will remain sharp.
  • Sharp Edges – The set of edges to explicitly mark as sharp, forcing them to split.

Example Edge Split Usage

Here is an example using edge split when modeling a pipe with smooth curves but a hard edge along a trim piece:

# Select the edges along the trim border
edges = get_sharp_edges(pipe) 

# Mark edges as sharp
for edge in edges:
  edge.use_edge_sharp = True

# Set angle to split any edge 60 degrees or less  
pipe.data.auto_smooth_angle = 60 * (pi/180)  

# Enable edge split and autosmooth 
pipe.data.use_auto_smooth = True

Auto Smooth

Auto smooth is a shading method that averages the normals of adjacent faces below a specified angle threshold. This creates soft shading between faces at shallow angles, while retaining a hard edge between faces meeting at sharper angles.

Auto smooth helps avoid the abrupt shading transitions of flat shading and provides a smoother continuous look. It is useful when you want mostly smooth shading but need to preserve distinct edges between surface planes.

Auto Smooth Angle Threshold

The key setting for auto smooth is the angle threshold below which face normals will be averaged. Typically values between 30-80 degrees are used. Smaller angles produce smoother transitions while wider angles preserve more distinct creases.

Auto Smooth Usage

A simple example enabling auto smooth with a 60 degree threshold would be:

import bpy
import math

# Access mesh data 
obj = bpy.context.object
mesh = obj.data

# Set auto smooth angle threshold
angle = 60 * math.pi/180
mesh.auto_smooth_angle = angle

# Enable auto smooth 
mesh.use_auto_smooth = True

Manual Shading

In some cases, custom manual editing of normals and shading is required for advanced effects. Typically this is needed when the automatic shading methods cannot produce the desired result.

Manual Editing Techniques

Some common manual techniques include:

  • Assigning custom face/vertex normals to precisely control shading.
  • Using mesh splitting and smoothing to alter geometry between faces.
  • Weight painting to blend between multiple materials with custom shading.
  • Using shadeless materials and custom lighting to override default shading.

Manual Shading Usage

Here is a simple manual shading example to flatten normals on a curved surface:

import bpy
import mathutils

# Get mesh and enter edit mode
obj = bpy.context.object
mesh = obj.data 

bpy.ops.object.mode_set(mode='EDIT')

# Select faces to shade flat 
faces = [1, 3, 8, 9]
bpy.ops.mesh.select_all(action='DESELECT')
bpy.ops.object.mode_set(mode='OBJECT')
for f in faces:
  mesh.polygons[f].select = True
bpy.ops.object.mode_set(mode='EDIT')

# Set normals of selected faces to global Z 
normal = mathutils.Vector((0.0, 0.0, 1.0))
bpy.ops.mesh.normals_make_consistent(inside=False)
bpy.ops.object.mode_set(mode='OBJECT')
for f in faces:
  mesh.polygons[f].normal = normal
  
bpy.ops.object.mode_set(mode='EDIT') 

Comparing the Techniques

Each shading method has pros and cons making them suitable for different use cases:

  • Edge Split – Precise control over sharp edges, but can increase geometry.
  • Auto Smooth – Softer look with less controls. Fast to enable.
  • Manual Shading – Maximum control but complex workflow.

Recommended Usage

  • Use edge split for hard surface and product models with crisp edges and borders.
  • Auto smooth works well for organic models that need soft blending.
  • Utilize manual shading only when artistic needs supersede automatic tools.

Quick Tips

  • Edge split angles below 30 degrees are usually not necessary.
  • Always visualize normals when troubleshooting shading issues.
  • Try auto smooth first before attempting manual shading.

Additional Resources

For more on shading techniques, consult these Blender resources:

Leave a Reply

Your email address will not be published. Required fields are marked *