文件名称:Unity5.X Shaders and Effect CookBook(Unity5.X着色器和屏幕特效教程)全新英文版
文件大小:4.56MB
文件格式:PDF
更新时间:2020-10-02 08:02:03
shaders
Preface v Chapter 1: Creating Your First Shader 1 Introduction 1 Creating a basic Standard Shader 2 Migrating Legacy Shaders from Unity 4 to Unity 5 7 Adding properties to a shader 10 Using properties in a Surface Shader 14 Chapter 2: Surface Shaders and Texture Mapping 21 Introduction 22 Diffuse shading 23 Using packed arrays 25 Adding a texture to a shader 28 Scrolling textures by modifying UV values 32 Normal mapping 35 Creating a transparent material 40 Creating a Holographic Shader 43 Packing and blending textures 46 Creating a circle around your terrain 51 Chapter 3: Understanding Lighting Models 55 Introduction 55 Creating a custom diffuse lighting model 56 Creating a Toon Shader 60 Creating a Phong Specular type 63 Creating a BlinnPhong Specular type 68 Creating an Anisotropic Specular type 72 ii Table of Contents Chapter 4: Physically Based Rendering in Unity 5 79 Introduction 80 Understanding the metallic setup 81 Adding transparency to PBR 83 Creating mirrors and reflective surfaces 87 Baking lights in your scene 90 Chapter 5: Vertex Functions 95 Introduction 95 Accessing a vertex color in a Surface Shader 96 Animating vertices in a Surface Shader 100 Extruding your models 104 Implementing a snow shader 107 Implementing a volumetric explosion 111 Chapter 6: Fragment Shaders and Grab Passes 117 Introduction 117 Understanding Vertex and Fragment Shaders 118 Using grab pass 122 Implementing a Glass Shader 125 Implementing a Water Shader for 2D games 127 Chapter 7: Mobile Shader Adjustment 133 Introduction 134 What is a cheap shader? 134 Profiling your shaders 140 Modifying our shaders for mobile 146 Chapter 8: Screen Effects with Unity Render Textures 151 Introduction 151 Setting up the screen effects script system 152 Using brightness, saturation, and contrast with screen effects 161 Using basic Photoshop-like Blend modes with screen effects 167 Using the Overlay Blend mode with screen effects 173 Chapter 9: Gameplay and Screen Effects 177 Introduction 177 Creating an old movie screen effect 178 Creating a night vision screen effect 189 iii Table of Contents Chapter 10: Advanced Shading Techniques 199 Introduction 199 Using CgInclude files that are built into Unity 200 Making your shader world modular with CgInclude 203 Implementing a Fur Shader 207 Implementing heatmaps with arrays 212 Index 217