Chapter 5: Material System and Shaders
Chapter 5: Material System and Shaders
Learning Objectives
- Understand the material and shader node system
- Master PBR (Physically Based Rendering) material creation
- Learn texture mapping and UV unwrapping
- Master procedural material creation
- Understand lighting models and material interaction
Detailed Knowledge Points
5.1 Material System Basics
5.1.1 Material and Shader Concepts
Material = A collection of properties describing the surface of an object
Shader = An algorithm that calculates the interaction of light with a surface
Material properties include:
- Color
- Reflectance
- Roughness
- Metallic
- Transparency
- Emission
5.1.2 Blender Material Workflow
# Material creation process
1. Select the object
2. Switch to the Shading workspace
3. Click "New" to create a material
4. Edit the material using the node editor
5. View the effect in the 3D viewport (Material Preview/Rendered)
5.2 Shader Node System
5.2.1 Node Editor Interface
Node Editor Components:
βββββββββββββββββββββββββββββββββββββββ
β Toolbar Header Bar Menu Bar β
βββββββββββββββββββββββββββββββββββββββ€
β β
β Node Network Editing Area β
β β
βββββββββββββββββββββββββββββββββββββββ€
β Node Library Properties Panel β
βββββββββββββββββββββββββββββββββββββββ
Basic Node Operations:
# Add a node
Shift + A # Add node menu
# Connect nodes
Left-click drag # Connect output to input socket
# Node operations
X / Delete # Delete node
Ctrl + C/V # Copy/paste node
Tab # Edit node group
Ctrl + J # Join nodes
5.2.2 Core Shader Nodes
Principled BSDF:
This is the most important shader node, based on Disney's PBR standard:
Principled BSDF parameters:
βββ Base Color
βββ Metallic: (0=insulator, 1=metal)
βββ Roughness: (0=mirror, 1=completely rough)
βββ IOR: Index of Refraction
βββ Alpha: Transparency
βββ Subsurface: Subsurface scattering
βββ Specular: Specular reflection intensity
βββ Transmission: Transmission
βββ Emission: Emission
βββ Normal: Normal map input
Other Important Shaders:
Shader Type | Use | Features |
---|---|---|
Diffuse BSDF | Diffuse reflection | Ideal diffuse surface |
Glossy BSDF | Specular reflection | Metal and smooth surfaces |
Glass BSDF | Glass | Transparent refractive material |
Emission | Emission | Self-illuminating material |
Mix Shader | Mix shaders | Combine multiple materials |
5.3 PBR Material Creation
5.3.1 PBR Workflow
Physically Based Rendering (PBR) Principles:
- Energy conservation: Reflection + absorption + transmission = 1
- Fresnel effect: Viewing angle affects reflection intensity
- Microfacet theory: Surface roughness affects reflection
PBR Map Types:
PBR standard map set:
βββ Albedo/Diffuse: Base color map
βββ Normal: Normal map (surface details)
βββ Roughness: Roughness map
βββ Metallic: Metallic map
βββ AO: Ambient Occlusion map
βββ Height/Displacement: Height map
βββ Emission: Emission map
5.3.2 Common Material Type Creation
Metal Material:
# Gold material settings
Principled BSDF:
βββ Base Color: RGB(1.0, 0.766, 0.336)
βββ Metallic: 1.0
βββ Roughness: 0.1-0.3
βββ IOR: 0.47 (refractive index of gold)
βββ Specular: 1.0
# Stainless steel material
βββ Base Color: RGB(0.672, 0.672, 0.672)
βββ Metallic: 1.0
βββ Roughness: 0.2-0.5
βββ IOR: 2.9
Plastic Material:
# Smooth plastic
Principled BSDF:
βββ Base Color: Any color
βββ Metallic: 0.0
βββ Roughness: 0.1-0.3
βββ IOR: 1.45 (typical plastic refractive index)
βββ Specular: 0.5
Glass Material:
# Transparent glass
Principled BSDF:
βββ Base Color: RGB(1.0, 1.0, 1.0)
βββ Metallic: 0.0
βββ Roughness: 0.0
βββ IOR: 1.52 (glass refractive index)
βββ Transmission: 1.0
βββ Alpha: 0.0 (fully transparent)
5.4 Texture Mapping Basics
5.4.1 UV Coordinate System
UV Coordinate Concept:
U-axis: Horizontal direction (0-1)
V-axis: Vertical direction (0-1)
3D mesh β UV unwrap β 2D texture space
5.4.2 Texture Coordinate Node
Texture Coordinate Node Outputs:
Generated: Automatically generated coordinates
UV: UV map coordinates
Object: Object coordinates
Camera: Camera coordinates
Window: Window coordinates
Normal: Normal coordinates
Reflection: Reflection coordinates
Mapping Node:
Used to transform texture coordinates
Mapping parameters:
βββ Location: Position offset
βββ Rotation: Rotation angle
βββ Scale: Scale factor
βββ Vector Type:
βββ Texture
βββ Point
βββ Vector
βββ Normal
5.5 Procedural Material Creation
5.5.1 Noise Texture Node
Noise Texture:
Parameter settings:
βββ Scale: Noise scale
βββ Detail: Detail levels
βββ Roughness: Roughness
βββ Lacunarity: Lacunarity
βββ Distortion: Distortion
βββ Dimension: Dimension
Outputs:
βββ Fac: Grayscale value (0-1)
βββ Color: Color noise
Other Procedural Textures:
Texture Type | Use | Features |
---|---|---|
Wave Texture | Wave texture | Regular wave patterns |
Voronoi Texture | Voronoi polygons | Cell-like patterns |
Musgrave Texture | Fractal noise | Complex terrain textures |
Gradient Texture | Gradient texture | Linear/radial gradients |
Magic Texture | Magic texture | Psychedelic patterns |
Brick Texture | Brick texture | Brick wall patterns |
5.5.2 ColorRamp Node
ColorRamp is used to remap color values:
# ColorRamp application
Noise Texture β ColorRamp β Material parameter
Common techniques:
1. Control contrast (adjust color stop positions)
2. Create masks (black and white output)
3. Color layering (multiple color stops)
4. Smooth transitions (interpolation type)
5.6 Advanced Shading Techniques
5.6.1 Layered Materials
Use Mix Shader to blend multiple materials:
# Layered material example: Rusted metal
Metal layer (Principled BSDF - metal parameters)
β
Mix Shader
β
Rust layer (Principled BSDF - insulator parameters)
# Mix factor controlled by texture
Noise Texture β ColorRamp β Mix Shader.Fac
5.6.2 Subsurface Scattering
Simulates light scattering inside a material:
# Skin material
Principled BSDF:
βββ Subsurface: 0.1-0.5
βββ Subsurface Radius: RGB(1.0, 0.2, 0.1)
βββ Subsurface Color: Skin base color
βββ Base Color: Skin surface color
# Candle material
βββ Subsurface: 0.3
βββ Subsurface Color: Warm yellow
βββ Transmission: 0.9
5.6.3 Displacement Map
Use height information to change the geometry shape:
# Displacement setup process
1. Connect Displacement in the material output node
2. Image Texture β ColorRamp β Displacement
3. Add a Subdivision Surface modifier
4. Enable Adaptive Subdivision (experimental feature)
# Displacement strength control
Math node to adjust displacement strength:
Height Map β Math(Multiply) β Displacement
5.7 Material Optimization and Management
5.7.1 Material Library Management
# Save and reuse materials
1. After creating a material, click the "Fake User" button
2. File β Append/Link to import materials from other files
3. Use the Asset Browser to manage material libraries
4. Create material node groups for easy reuse
# Create node groups
1. Select the nodes to be grouped
2. Ctrl + G to create a node group
3. Tab to edit the node group
4. Add input/output nodes to define the interface
5.7.2 Render Optimization
# Material render optimization techniques
1. Use appropriate texture resolutions
- Distant objects: 512x512 or lower
- Close-up objects: 2048x2048 or higher
2. Avoid overly complex node networks
- Simplify with node groups
- Delete unused nodes
3. Enable GPU render acceleration
- Cycles: CUDA/OpenCL/OptiX
- Set sample counts reasonably
5.8 Practical Exercises
Exercise 1: Wood Material Creation
Exercise Goal
Master procedural material creation and node combination techniques
# Procedural wood material creation
# Step 1: Create base wood grain
1. Add a Wave Texture node
2. Type: Bands, Profile: Saw
3. Scale: 20, Distortion: 2
# Step 2: Add wood grain variation
4. Add a Noise Texture
5. Scale: 5, Detail: 10
6. Connect to the Wave Texture's Distortion
# Step 3: Color adjustment
7. Wave Texture β ColorRamp
8. Set two color stops: light wood and dark wood
9. ColorRamp β Principled BSDF Base Color
# Step 4: Surface details
10. Duplicate the noise texture for roughness
11. Adjust strength: Math node Γ 0.3
12. Connect to Roughness input
# Step 5: Normal details
13. Add another Noise Texture (smaller scale)
14. Connect to a Normal Map node
15. Normal Map β Principled BSDF Normal
Exercise 2: Car Paint Material
# Car metallic paint material
# Step 1: Base car paint
1. Principled BSDF settings:
- Base Color: Choose car color
- Metallic: 0.0 (car paint is an insulator)
- Roughness: 0.1 (smooth)
- IOR: 1.5
# Step 2: Metallic flake effect
2. Add a Noise Texture (Scale: 1000)
3. ColorRamp to adjust contrast
4. Math node to adjust strength Γ 0.1
5. Connect to Metallic input
# Step 3: Clear coat effect
6. Add a Mix Shader
7. First input: The car paint material above
8. Second input: Glossy BSDF (Roughness: 0.05)
9. Factor: 0.1 (10% clear coat)
# Step 4: Enhance environment reflection
10. Add a Layer Weight node
11. Fresnel output β Mix Shader Factor
12. Enhance edge reflection effect
Exercise 3: Complex Fabric Material
Important Notes
- Fabric materials require proper UV unwrapping
- Pay attention to the anisotropic reflection of fibers
- Use subsurface scattering to simulate light transmission
# Sweater fabric material
# Step 1: Base fabric color
1. Choose a suitable fabric base color
2. Principled BSDF Base Color
# Step 2: Fabric texture
3. Use a Brick Texture to simulate woven texture
4. Scale: 50, Mortar: 0.02
5. Set different light/dark shades for Color1/Color2
# Step 3: Surface fuzz effect
6. Add a Hair BSDF
7. Mix Shader to blend Principled and Hair
8. Factor controlled by texture (around 0.3)
# Step 4: Subsurface scattering
9. Enable Subsurface: 0.1
10. Subsurface Color: Slightly warmer than Base Color
# Step 5: Normal details
11. Use a Noise Texture to create subtle bumps
12. Normal Map strength: 0.5
13. Simulate fiber surface texture
5.9 Node Shortcuts and Tips
5.9.1 Node Editing Shortcuts
Operation | Shortcut | Description |
---|---|---|
Add Node | Shift + A | Open add menu |
Delete Node | X / Delete | Delete selected node |
Duplicate Node | Shift + D | Duplicate and move |
Cut Links | Ctrl + Right-click drag | Cut node connections |
Preview Node | Ctrl + Shift + Left-click | Preview node output |
Mute Node | M | Disable node |
Hide Node | H | Hide selected node |
Node Group | Ctrl + G | Create node group |
Enter Node Group | Tab | Edit node group |
Search Node | Ctrl + A | Smart add node |
5.9.2 Efficient Node Editing Tips
# Quick node connection
1. Node Wrangler add-on (built-in)
- Ctrl + Shift + T: Add texture setup nodes
- Ctrl + T: Add Mapping + Texture Coordinate
# Align nodes
2. After selecting multiple nodes:
- Shift + = : Align nodes
# Quick preview
3. Ctrl + Shift + Left-click: Temporarily output to material output
Convenient for quickly viewing intermediate node effects
# Search and add nodes
4. Shift + A then type the node name
e.g., "noise" to quickly find Noise Texture
5.10 Render Engine Differences
5.10.1 Cycles vs Eevee Material Differences
Cycles (Offline Renderer):
- Full support for all node types
- Physically accurate ray tracing
- Supports complex volume rendering
- High render quality but slower speed
Eevee (Real-time Renderer):
- Limited support for some nodes
- Real-time rendering based on rasterization
- Requires pre-processing (baking) for some effects
- Fast speed but compromised quality
Material Compatibility:
Feature | Cycles | Eevee | Notes |
---|---|---|---|
Principled BSDF | β | β | Fully supported |
Volume Scattering | β | Partial | Eevee requires enabling volume |
Displacement Map | β | β | Not supported in Eevee |
Subsurface Scattering | β | β | Both support |
IOR Refraction | β | Approximate | Eevee uses screen space |
Learning Suggestions
- Start with the Basics: First master the various parameters of the Principled BSDF
- Observe Reality: Observe the light and shadow changes of real materials
- Be Experimental: Try different node combinations
- Reference Learning: Study the material creation of excellent works
- Stay Organized: Use Frame and Reroute nodes to organize complex networks
By completing this chapter, you should be able to:
- Use the shader node system proficiently
- Create various types of PBR materials
- Understand procedural material creation methods
- Master material optimization and management techniques
Material creation is an important part of 3D art, requiring a combination of technical knowledge and artistic sense.