Muutke küpsiste eelistusi

Building Quality Shaders for Unity®: Using Shader Graphs and HLSL Shaders 1st ed. [Pehme köide]

  • Formaat: Paperback / softback, 734 pages, kõrgus x laius: 254x178 mm, kaal: 1414 g, 251 Illustrations, color; 21 Illustrations, black and white; XX, 734 p. 272 illus., 251 illus. in color., 1 Paperback / softback
  • Ilmumisaeg: 18-Oct-2022
  • Kirjastus: APress
  • ISBN-10: 1484286510
  • ISBN-13: 9781484286517
  • Pehme köide
  • Hind: 57,96 €*
  • * hind on lõplik, st. muud allahindlused enam ei rakendu
  • Tavahind: 68,19 €
  • Säästad 15%
  • Raamatu kohalejõudmiseks kirjastusest kulub orienteeruvalt 2-4 nädalat
  • Kogus:
  • Lisa ostukorvi
  • Tasuta tarne
  • Tellimisaeg 2-4 nädalat
  • Lisa soovinimekirja
  • Formaat: Paperback / softback, 734 pages, kõrgus x laius: 254x178 mm, kaal: 1414 g, 251 Illustrations, color; 21 Illustrations, black and white; XX, 734 p. 272 illus., 251 illus. in color., 1 Paperback / softback
  • Ilmumisaeg: 18-Oct-2022
  • Kirjastus: APress
  • ISBN-10: 1484286510
  • ISBN-13: 9781484286517
Understand what shaders are and what they’re used for: Shaders are often seen as mystical and difficult to develop, even by skilled programmers, artists, and developers from other game design disciplines. This book dispels that idea by building up your shader knowledge in stages, starting with fundamental shader mathematics and how shader development mindset differs from other types of art and programming, and slowly delves into topics such as vertex and fragment shaders, lighting, depth-based effects, texture mapping, and Shader Graph.

This book presents each of these topics with a comprehensive breakdown, the required theory, and some practical applications for the techniques learned during each chapter. The HLSL (High Level Shading Language) code and Shader Graphs will be provided for each relevant section, as well as plenty of screenshots.

By the end of this book, you will have a good understanding of the shader development pipeline and you will be fully equipped to start making your own aesthetic and performant shader effects for your own games!

You Will Learn To
• Use shaders across Unity’s rendering pipelines
• Write shaders and modify their behavior with C# scripting
• Use Shader Graph for codeless development
• Understand the important math behind shaders, particularly space transformations
• Profile the performance of shaders to identify optimization targets

Who Is This Book For

This book is intended for beginners to shader development, or readers who may want to make the jump from shader code to Shader Graph. It will also include a section on shader examples for those who already know the fundamentals of shaders and are looking for specific use cases.


Beginning to Intermediate
About the Author xiii
About the Technical Reviewer xv
Acknowledgments xvii
Introduction xix
Chapter 1 Introduction to Shaders in Unity
1(8)
Rendering
1(5)
Game Data
4(1)
The Vertex Shader
4(1)
The Fragment Shader
5(1)
Unity's Render Pipelines
6(2)
Shader Graph
7(1)
Summary
8(1)
Chapter 2 Math for Shader Development
9(38)
Vectors
9(10)
Position and Direction Vectors
10(1)
Vector Addition and Subtraction
11(1)
Scalar Multiplication
12(2)
Vector Magnitude
14(1)
Vector Normalization
15(1)
Basis Vectors and Linear Combinations
16(1)
Dot Product
16(2)
Cross Product
18(1)
Matrices
19(8)
Matrix Addition and Subtraction
20(1)
Scalar Multiplication
21(1)
Square, Diagonal, and Identity Matrices
21(1)
Matrix Transpose
22(1)
Matrix Determinant
23(2)
Matrix Multiplication
25(1)
Matrix Inverse
26(1)
Matrix Transformations
27(8)
Scaling Matrices
28(1)
Rotation Matrices
29(3)
Translation Matrices
32(1)
Homogeneous Coordinates
33(2)
Space Transformations
35(10)
Object-to-World Space Transformation
36(2)
World-to-View Space Transformation
38(1)
View-to-Clip Space Transformation
38(6)
Perspective Divide
44(1)
Summary
45(2)
Chapter 3 Your Very First Shader
47(34)
Project Setup
47(6)
Creating a Project
49(1)
Setting Up the Scene
50(3)
Writing a Shader in Unity
53(17)
Writing ShaderLab Code
54(3)
Adding a SubShader
57(3)
Adding a Pass
60(10)
The SRP Batcher and Constant Buffers
70(1)
Common Shader Syntax
71(9)
Scalar Types
71(1)
Vector Types
72(3)
Matrix Types
75(2)
Included Variables
77(3)
Summary
80(1)
Chapter 4 Shader Graph
81(28)
Shader Graph Overview
82(1)
Creating a Basic Shader in Shader Graph
83(12)
Scene Setup
83(2)
The Shader Graph Interface
85(3)
Adding Properties
88(4)
Building the Graph
92(3)
Shader Graph Features
95(11)
Adding Blocks to the Master Stack
95(1)
Redirect Node
96(1)
Preview Node
97(1)
Color Mode
98(1)
Shader Path
98(1)
Node Groups
98(1)
Sticky Notes
99(1)
Node Snapping
100(1)
Sub Graphs
101(2)
Custom Function Node
103(3)
Summary
106(3)
Chapter 5 Textures and UV Coordinates
109(32)
Basic Texturing
110(19)
Texture Support in HLSL
110(12)
Texture Support in Shader Graph
122(7)
Mipmaps and Level of Detail
129(3)
Level of Detail
130(2)
Sampling Options
132(3)
Wrap Mode
133(1)
Filter Mode
134(1)
Sampler States
135(4)
Sampler States in HLSL
136(1)
Sampler States in Shader Graph
137(2)
Summary
139(2)
Chapter 6 Advanced Texturing
141(52)
Base Shader in HLSL
141(4)
Modifying Texture Coordinates
145(28)
UV Rotation
145(4)
Flipbook Mapping
149(6)
Polar Coordinate Mapping
155(5)
Triplanar Mapping
160(8)
UV Shear
168(5)
Texture3D
173(6)
Importing 3D Textures from 2D Textures
174(5)
Cubemaps
179(12)
Importing Cubemaps from 2D Textures
180(2)
Using Cubemaps in HLSL
182(7)
Using Cubemaps in Shader Graph
189(2)
Summary
191(2)
Chapter 7 The Depth Buffer
193(80)
How Rendering Opaque Objects Works
193(5)
How the Depth Buffer Works
195(1)
Render Queues
196(2)
Depth Testing and Writing
198(8)
The Z Test Keyword
198(2)
The Z Write Keyword
200(1)
Depth Settings with Shader Graph
201(2)
Early Depth Testing
203(1)
Z-Fighting
204(2)
Shader Effects Using Depth
206(27)
Silhouette
206(13)
Writing to the Depth Texture Using a Depth-Only Pass
219(5)
Scene Intersections
224(9)
The Stencil Buffer
233(11)
Stencil Testing in HLSL
234(10)
URP Renderer Features
244(4)
Render Objects
246(2)
X-Ray Effect Using Depth
248(16)
X-Ray Effect with HLSL
248(10)
X-Ray Effect with URP Render Objects (No Code)
258(6)
Impossible Room Effect Using Stencils
264(7)
Impossible Room Effect with HLSL
265(3)
Impossible Room Effect with Render Objects
268(3)
Summary
271(2)
Chapter 8 Transparency and Alpha
273(48)
How Rendering Transparent Objects Works
273(16)
How Alpha Blending Works
274(15)
Alpha Clipping
289(30)
Alpha Cutout in HLSL
291(4)
Alpha Cutout in Shader Graph
295(4)
Dithered Transparency with Alpha Clip
299(8)
Dissolve Effect with Alpha Clip
307(12)
Summary
319(2)
Chapter 9 More Shader Fundamentals
321(36)
Interacting with C# Code
321(11)
Cycling Colors with the HelloWorld Shader
321(4)
World-Space Dissolve
325(7)
Controlling Shaders with Animations
332(1)
Shader Keywords
333(9)
Shader Keywords in HLSL
334(4)
Shader Keywords in Shader Graph
338(3)
Modifying Keywords Using C# Scripting
341(1)
Use Pass in ShaderLab
342(2)
Grab Pass in ShaderLab
344(11)
Sepia Tone Effect Using GrabPass in the Built-in Pipeline
345(4)
Sepia Tone Effect Using Camera Opaque Texture in URP
349(4)
Sepia Tone Effect Using the Scene Color Node in Shader Graph
353(2)
Summary
355(2)
Chapter 10 Lighting and Shadows
357(94)
Lighting Models
357(53)
Ambient Light
357(2)
Diffuse Light
359(1)
Specular Light
360(3)
Fresnel Light
363(2)
Blinn-Phong Reflection Model
365(45)
Physically Based Rendering
410(33)
Smoothness
411(2)
Metallic Mode
413(1)
Specular Mode
413(1)
Normal Mapping
414(1)
Ambient Occlusion
415(1)
Emission
416(1)
PBR in the Built-in Pipeline
417(9)
PBR in URP
426(12)
PBR in Shader Graph
438(5)
Shadow Casting
443(6)
Shadow Casting in the Built-in Pipeline
444(2)
Shadow Casting in URP
446(2)
Shadow Casting in Shader Graph
448(1)
Summary
449(2)
Chapter 11 Image Effects and Post-Processing
451(66)
Render Textures
451(3)
Post-Processing Effects
454(2)
Grayscale Image Effect
456(32)
Post-Processing in the Built-in Pipeline
457(6)
Post-Processing in URP
463(14)
Post-Processing in HDRP
477(11)
Gaussian Blur Image Effect
488(27)
Gaussian Blur in the Built-in Pipeline
491(6)
Gaussian Blur in URP
497(9)
Gaussian Blur in HDRP
506(9)
Summary
515(2)
Chapter 12 Advanced Shaders
517(66)
Tessellation Shaders
517(30)
Water Wave Effect with Tessellation
520(17)
Level of Detail Using Tessellation
537(10)
Geometry Shaders
547(10)
Visualizing Normals with Geometry Shaders
547(10)
Compute Shaders
557(24)
Grass Mesh Instancing
558(23)
Summary
581(2)
Chapter 13 Profiling and Optimization
583(26)
Profiling Shaders
583(4)
FPS or Milliseconds?
586(1)
The Frame Debugger
587(5)
Identifying Problems with the Frame Debugger
589(3)
Common Pitfalls and How to Fix Them
592(14)
Overdraw
592(2)
Expensive Fragment Shaders
594(12)
Summary
606(3)
Chapter 14 Shader Recipes for Your Games
609(110)
World-Space Scan Post-Process
609(38)
World-Space Scan in the Built-in Pipeline
611(10)
World-Space Scan in URP
621(13)
World-Space Scan in HDRP
634(13)
Cel-Shaded Lighting
647(15)
Cel-Shaded Lighting in HLSL
648(8)
Cel-Shaded Lighting in Shader Graph
656(6)
Interactive Snow Layers
662(27)
Interactive Snow C# Scripting
664(12)
Interactive Snow Compute Shader
676(3)
Interactive Snow Mesh Shader
679(10)
Holograms
689(10)
Holograms in HLSL
690(7)
Holograms in Shader Graph
697(2)
Sprite Effects
699(17)
Sprite Pixelation
700(8)
Sprite Ripples
708(8)
Summary
716(3)
Index 719
Daniel Ilett is an ambitious and motivated PhD student at the University of Warwick. He is a passionate game developer, specialising in shaders and technical art. He publishes a range of educational and tutorial content, including videos and written work, aimed at beginners and intermediate developers. He also does freelance work on shaders and visual effects for games.