- Unity 2018 Shaders and Effects Cookbook
- John P. Doran Alan Zucconi
- 199字
- 2021-06-18 19:04:16
Introduction
Surface Shaders were introduced in Chapter 2, Creating Your First Shader, as the main type of shader that's used in Unity. This chapter will show you in detail what these actually are and how they work. Generally speaking, there are two essential steps in every Surface Shader. First, you have to specify certain physical properties of the material that you want to describe, such as its diffuse color, smoothness, and transparency. These properties are initialized in a function called the surface function and are stored in a structure called the SurfaceOutput. Secondly, the SurfaceOutput is passed to a lighting model. This is a special function that will also take information about the nearby lights in the scene. Both of these parameters are then used to calculate the final color for each pixel of your model. The lighting function is where the real calculations of a shader take place as it's the piece of code that determines how light should behave when it touches a material.
The following diagram loosely summarizes how a Surface Shader works. Custom lighting models will be explored in Chapter 4, Understanding Lighting Models, while Chapter 6, Vertex Functions, will focus on vertex modifiers:

- 程序員面試筆試寶典(第3版)
- 自然語言處理實戰:預訓練模型應用及其產品化
- Monkey Game Development:Beginner's Guide
- Maven Build Customization
- Learning Laravel 4 Application Development
- The HTML and CSS Workshop
- Clojure Reactive Programming
- 領域驅動設計:軟件核心復雜性應對之道(修訂版)
- 深入實踐Kotlin元編程
- BeagleBone Robotic Projects(Second Edition)
- Java編程從入門到精通
- 大學計算機基礎
- Mastering PowerCLI
- 你好!Python
- 情境微課開發(第2版)