- 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:

- PHP基礎案例教程
- Podman實戰
- 程序設計基礎教程:C語言
- Creating Stunning Dashboards with QlikView
- 打開Go語言之門:入門、實戰與進階
- Learning JavaScript Data Structures and Algorithms(Second Edition)
- 分布式數據庫原理、架構與實踐
- 玩轉.NET Micro Framework移植:基于STM32F10x處理器
- 軟件測試(慕課版)
- Ubuntu Server Cookbook
- Java Web應用開發
- Neo4j權威指南 (圖數據庫技術叢書)
- Java基礎案例教程(第2版)
- 計算機視覺實戰:基于TensorFlow 2
- HTML 5與CSS 3權威指南(第4版·下冊)