- Unity 5.x Shaders and Effects Cookbook
- Alan Zucconi Kenneth Lammers
- 195字
- 2021-07-16 12:59:36
Introduction
Surface Shaders have been introduced in Chapter 1, Creating Your First Shader, as the main type of shader used in Unity. This chapter will show 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 surface function and stored in a structure called surface output. Secondly, the surface output is passed to a lighting model. This is a special function that will also take information about the nearby lights in the scene. Both 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 3, Understanding Lighting Models, while Chapter 5, Vertex Functions, will focus on vertex modifiers:

- Learning Neo4j
- Vue.js設(shè)計(jì)與實(shí)現(xiàn)
- 軟件界面交互設(shè)計(jì)基礎(chǔ)
- C#程序設(shè)計(jì)(慕課版)
- Unity 5 for Android Essentials
- HTML5秘籍(第2版)
- Hands-On GUI Programming with C++ and Qt5
- Red Hat Enterprise Linux Troubleshooting Guide
- Vue.js光速入門及企業(yè)項(xiàng)目開發(fā)實(shí)戰(zhàn)
- Java Web開發(fā)教程:基于Struts2+Hibernate+Spring
- Wearable:Tech Projects with the Raspberry Pi Zero
- Building Clouds with Windows Azure Pack
- GO語言編程從入門到實(shí)踐
- 狼書(卷2):Node.js Web應(yīng)用開發(fā)
- Real-time Analytics with Storm and Cassandra