Write in front
Thanks to all the friends who came in to see. Yes, I'm currently going to write a book about unity shader.
The purpose of the book is to have the following several:
Summarize my experience with unity Shader and give others a reference. I am very aware of the difficulties of learning shader, and I have seen many questions raised by people in the group. I think learning shader is still a regular thing to follow, but the problem is Chinese information is difficult to find, and we do not want to see English ... What good is this for me? Forced me to comb the knowledge, to grasp the details of the problem more clearly.
A second reason you know.
Questions about the positioning of the book:
For unity Shader Beginners, but to:
- Have a certain programming experience, or I said: In the script to write a function xxx, you ask me, what is the script? I:.......
- I hope you remember the basic mathematics of junior High school. At least you can count the numbers clearly. I understand that many people have already given the matrix these slightly more complicated math to the college teachers, so I will introduce them in a separate chapter.
- I hope you have a certain degree of patience. Why do you always feel that you do not understand, learn not to shader, you can reflect on yourself is not too impatient, want to see today tomorrow will. Give it up, it's impossible.
One of my goals in writing this book is to help beginners build a foundation that is unreliable without any superstructure.
I'm not writing a special effects encyclopedia, so if you want to see all kinds of cool and awesome effects, I'm sorry, there's hardly anything in this book. This has a lot to do with one book, and I'm sure a beginner can't be a "shader". I hope that anyone who has read this book can really understand what shader is, and not say, "Oh, shader, that's the right thing in unity that Create->shader get." About the special effects of the problem, if I have full experience and qualifications in the future, may actually write a book, hahaha
Writing a book is a very difficult thing, I hope I can do it well.
Overall structure
I have divided this book into five chapters:
Basic article: This is a very important chapter, mainly for beginners to popularize basic theoretical knowledge, as well as the necessary mathematical basis. I understand that many people do not understand some of the material on the Internet, I try to speak as popular as possible.
Shader Elementary: Start with the simplest shader, and explain the basic lighting models, textures, and transparency effects in shader. At the same time, it will introduce some shader debug techniques, shader common error messages.
Shader Intermediate: This is the advanced chapter, will explain more complex lighting, high-level texture, and how to use shader to achieve a series of advanced content such as animation;
Shader Advanced: It covers some of the advanced uses of shader, such as the use of buffers, the implementation of screen effects, non-photorealistic rendering, and also introduces some optimization techniques;
Extension: Will cover some of the mechanisms behind Unity Surface shader, and will also briefly analyze some of the new features in the Unity 5.0+ release. Finally, I hope to introduce you to the experience and resources of learning shader.
Currently the catalogue has been initially finalized and the catalogue is recorded here, but I will keep updating it.
If you have any comments and suggestions on the contents and content of the book, you can leave a comment below. If you don't have a CSDN account, you can also send me an email to tell me: lelefeng1992 # gmail DOT com. I will make certain changes to the catalogue and content based on your comments.
Directory
* Preface
* What does the book say?
* What you need to know before you read this book
* Who is suitable to read this book
* Who is not fit to read this book for the time being
* Convention
* Reader Feedback
* Source of the book
The 1th part of the basic article
1th Chapter Welcome to the world of shader
- 1.1 Programmer's Three great romance: why learn Shader
- 1.2 This is not a programmer's fight.
- 1.3 The world is so big
2nd Chapter Rendering Line
- 2.1 Reviews
- 2.1.1 Why do you need to know the rendering pipeline
- 2.1.1 What is an assembly line
- 2.1.2 What is a rendering pipeline
- 2.1.3 Application Phase
- 2.1.4 Geometry phase
- 2.1.5 Rasterization Phase
- 2.2 GPU Pipelining
- 2.2.1 Overview
- 2.2.2 Vertex Shader
- 2.2.3 Clipping
- 2.2.4 Screen Mapping
- 2.2.5 Triangle Setup
- 2.2.6 Triangle Traversal
- 2.2.7 Fragment Shader
- 2.2.8 per-fragment Operations
- 2.2.9 Summary
- 2.3 Big talk version of the rendering pipeline
- 2.4 Some places that are easy to confuse
- 2.4.1 What is Opengl/directx
- 2.4.2 What is HLSL, GLSL, CG
- 2.4.3 What is draw call
- 2.4.4 what is a fixed rendering pipeline (Fixed-function Pipeline)
- 2.5 So, do you understand what a shader is?
- Extended Reading
-
3rd Unity Shader Basics
- 3.1 Unity Shader Overview
- 3.1.1 Pair of good brothers: material and unity Shader
- 3.1.2 Materials in Unity
- 3.1.3 Unity shader
- 3.2 Unity Shader Basics: Shaderlab
- 3.2.1 What is Shaderlab
- 3.2.2 Shaderlab Basic Syntax
- 3.3 Unity Shader form
- 3.3.1 Abandoned corner: Fixed Function Shaders
- 3.3.2 Smartest Kids: vertex/fragment Shader
- 3.3.2 Unity's darling: Surface Shader
- 3.3.4 and Vertex/fragment Shader relationship
- 3.3.5 Select which uni Ty Shader form
- 3.4 Unity Shader structure
- 4.4.1 give our Shader a name: Shader
- 4. 4.2 Materials and Unity Shader Bridge: Properties
- 4.4.3 Heavyweight member: Subshaders
- 3.5 Unity Shader! = True "Sha Der "
4th. The mathematical basis required for learning shader
- 4.1 Shader in math, not as scary as you think.
- 4.2 Using mathematics to represent the world: points and vectors
- 4.3 matrix
- 4.3.1 left-multiply/right-multiply and row-first/column-first
- 4.4 panning, rotating, and zooming
- 4.5 Magic of the matrix: vertex transformations
- 4.5.1 Model Space
- 4.5.2 World Space
- 4.5.3 Observation Space
- 4.5.4 Transformation of different spaces
Part 2nd Shader Junior Chapter
-
The 5th chapter begins Unity Shader Learning Tour
- 5.1 software used in this book
- 5.2 One of the simplest vertex/fragment Shader
- 5.2.1 Shader's ultimate purpose
- 5.2.2 where the model data comes from
- 5.2.3 vertex and fragment shader how to communicate
- 5.2.4 Properties and uniform Variable
- 5.3 matrix Transformations in Unity
- 5.3.1 calculation in the model coordinate system
- 5.3.2 calculated in world coordinate system
- 5.3.3 calculating the built-in variables, macros, and functions of the
- 5.4 Shaderlab in the perspective coordinate system
- 5.4.1 variables, macros, and functions for transformations
- 5.4 .2 variables, macros, and functions for illumination
- 5.4.3 Other variables
- 5.5 Programmer's troubles: Debug
- 5.5.1 Using false color images
- 5.5.2 Using Software
- 5.5.3 Troubleshooting: Common error Messages
- 5.5 shader Optimization
- 5.5.1 Avoid unnecessary calculations
- 5.5.2 Create temporary variables only when really needed
- 5.5.3 float, half, or fixe D
- 5.5.4 Caution with branch statements
- 5.6 Shader Neat Way: Standardize your code
- 5.7 Shader platform differences: Be careful dx11!
The 6th Chapter Basic Illumination Model
- 6.1 What is a light model
- 6.1.1 How we see the world
- 6.1.2 BRDF Empirical Model
- 6.2 A light source in unity
- 6.2.1 Parallel Light
- 6.2.2 Point Light source
- The Lightmode of Rendermode and shader of 6.2.3 light source
- 6.3 Diffuse reflection Illumination model
- 6.3.1 theory: Lambert Illumination model
- 6.3.2 theory: half Lambert illumination model
- 6.3.3 Practice: Vertex-wise illumination
- 6.3.4 Practice: pixel-wise illumination
- 6.4 Specular Light Model
- 6.4.1 Theory: Phong Illumination model
- 6.4.2 Theory: Blinnphong Illumination model
- 6.4.3 Theory: vertex-wise illumination
- 6.4.4 theory: pixel-wise illumination
- 6.5 Edge Illumination Model
- 6.5.1 theory
- 6.5.2 Practice
7th Chapter Basic Textures
- 7.1 Using single-sheet textures
- 7.2 Using multiple textures: texture blending
- 7.3 Using normal textures
- 7.3.1 model space or tangent space
- 7.3.2 Practice
- 7.4 Using a gradient texture
- 7.5 Using matte textures
- 7.6 Textures are more than colors
8th Chapter Transparency Effect
- 8.1 Why rendering queues are important
- 8.2 Alpha Test
- 8.3 Alpha Blending
3rd Part Shader Intermediate article
Part 4th Shader Advanced Chapter
The 11th chapter is the rendering method based on image processing
- 11.1 Gamma correction
- 11.2 Anti-aliasing
- 11.3 Brightness, saturation, and contrast
- 11.4 Implementing Photoshop-like blending modes
- 11.5 Implementing the gradient overlay effect
- 11.6 to achieve a vignette effect
12th. Using depth and normal buffers
- 12.1 How to get buffers
- 12.2 Practice: Depth of field effect
- 12.3 Practice: Edge Detection
13th Non-photorealistic rendering
- 13.1 Cartoon Rendering
- 13.2 Contour Rendering
- 13.3 hand-painted style rendering
14th. Using noise in shader
- 14.1 What is Noise (Noise)
- 14.2 Perlin Noise
- 14.3 Worley Noise
- 14.4 Practice
The 15th chapter of mobile Platform optimization
- 15.1 The difference between a mobile platform and a desktop
- 15.2 identify factors that affect performance
- 15.2.1 CPU
- Treatment of 15.2.2 Vertex
- Treatment of 15.2.3 Fragment
- 15.2.4 Bandwidth
- 15.2.5 Unity's performance analysis tool: Profiler
- 15.3 Optimizing geometry
- 15.4 using LOD Technology
- 15.5 Using occlusion culling technology
- 15.6 Controlling Drawing Order
- 15.7 always alert for transparent objects
- 15.8 reduce real-time illumination
- 15.8.1 using Lightmaps
- 15.8.2 using God Rays
- 15.9 Reduced Draw Calls
- 15.9.1 Static Batch Processing
- 15.9.2 Dynamic Batch Processing
- 15.9.3 How to choose
- 15.10 Reducing texture size
- 15.11 Using Zoom
The 5th part of the extended chapter
16th Chapter Surface Shader Quest
- 16.1 Basic assembly line
- 16.2 Unity behind what was done
The 17th chapter is based on physical rendering--physically Based Shading
- 17.1 theory
- 17.2 Unity's Standard Shader
18th. What did Unity 5.0 update
- 18.1 scenes "brighter"
- 18.2 Surface shader Easier "error"
- 18.3 ownership: Control of non-uniform scale grid
- 18.4 Fixed function gradually exits the stage
Is there anything more in the 19th chapter?
- 19.1 If you want to learn more about shader,
- 19.2 or that sentence: the world is so big
Reference documents
- Index
"My book" Unity Shader Book-catalogue (in real-time update)