Download Physically Based Shader Development for Unity 2017: Develop Custom Lighting Systems PDF

TitlePhysically Based Shader Development for Unity 2017: Develop Custom Lighting Systems
File Size7.9 MB
Total Pages242
Table of Contents
                            Contents
About the Author
Acknowledgments
Introduction
Part I: Introduction to Shaders In Unity
	Chapter 1: How Shader Development Works
		What Is a Shader?
			Shaders as Light Simulations
			Rendering as Perspective Drawing
			Rendering Process
			Shaders as Code Running on GPUs
			Shader Execution
			Different Types of Shaders
			Coordinate Systems
			Types of Light
				Point Light
				Directional Light
				Area Light
		The Rendering Equation
			The Behavior of Light
				Bounced Light
			Renderer Types
				Forward
				Deferred
				Forward+ (Tiled Forward Shading)
				Future Renderers
			Shader Visual Graphs
		Summary
		Next
	Chapter 2: Your First Unity Shader
		Introduction to Unity
			Set Up
			Unity UI
			Make Your First Scene
			Shader Editing
				Path and Name of the Shader
				Properties
				Sub-Shaders
				Tags
				Passes
				CGPROGRAM (and ENDCG)
				Pragma Statements
				Includes
				Output and Input Structures
				Variable Declaration
				Vertex Function and Fragment Function
		Shader Editing
			From White to Red
			Adding Properties
		Summary
		Next
	Chapter 3: The Graphics Pipeline
		Why Learn the Basics of Graphics APIs
		A General Structure of the Graphics Pipeline
		The Rasterizer
		The Structure of an Unlit Shader
		Vertex Data Structure
		Vertex Function
		Fragment Data Structure
		Fragment Function
		Adding Vertex Colors Support
			Appdata Additions
			v2f Additions
			Assign the Color in the Vertex Function
			Use the Color in the Fragment Function
			Final Result
		Summary
		Next
	Chapter 4: Transforming Coordinate Spaces
		Coordinate Spaces Who’s Who
			Object Space
			World Space
			Transformation Between Spaces
			Camera Space
			Clip Space
			Normalized Device Coordinates
			Screen Space
		Underneath Built-In Functions
		Where to Find the Shader “Standard Library” Code
		Summary
		Next
	Chapter 5: Your First Unity Lighting Shader
		Lighting Shaders
			What Is an Approximation
			Diffuse Approximation
			Specular Approximation
			Diffuse and Specular Combined
		Calculating Basic Lighting
			Diffuse
		Your First Lighting Unity Shader
			Implementing a Diffuse Term
			Adding a Texture Property
			Adding an Ambient Value
		Summary
		Next
	Chapter 6: Specular Implementation
		Calculating Basic Lighting (Part II)
			Specular
			Your First Lighting Unity Shader (Part II)
				Implementing a Specular
		Supporting More Than One Light
		Summary
		Next
	Chapter 7: Surface Shaders
		What Is a Surface Shader?
			The Default Surface Shader
			Pragmas
			New Data Structures
			The Surface Function
			What’s a Lighting Model?
			Data Flow of a Surface Shader
		Editing a Surface Shader
			Add a Second Albedo Map
			Add a Normal Map
			Making Sure Shadows Work
			Use Different Built-In Lighting Models
		Writing a Custom Lighting Model
			Lighting Model Function Signatures
			The SurfaceOutput Data Structure
			The Surface Function
			Properties Block
			The Custom Lighting Function
		Summary
		Next
Part II: Physically Based Shading
	Chapter 8: What Is Physically Based Shading?
		Light Is an Electromagnetic Wave
		Microfacet Theory Overview
		Refraction and Other Beasts
		Fresnel Reflectance
		How to Measure Light
			Solid Angle
			Power
			Irradiance
			Radiance
		How to Represent a Material
			Bidirectional Reflectance Distribution Function (BRDF)
				Positivity
				Reciprocity
				Energy Conservation
			Microfacet Theory
				Fresnel
				Normal Distribution Function
				Geometry Function
		The Rendering Equation (Part II)
		Hacks Real-Time Rendering Needs
		HDR and Tone Mapping
		Linear Color Space
		Why Is Physically Based Shading Useful?
		Summary
		Next
	Chapter 9: Making a Shader Physically Based
		Analyzing Phong
			Checking for Positivity
			Checking for Reciprocity
			Checking for Energy Conservation
		The Modified Phong
		Summary
		Next
	Chapter 10: Post-Processing Effects
		How Post-Processing Effects Work
		Why Post-Processing Effects Are Useful
		Setting Up a Post Effect
			HDR and Linear Setup
			Script Setup
		Conversion to Linear
		RenderTextures Brief Overview
		A Simple Tone Mapper
		Post-Processing Stack v1
		Post-Processing Stack v2
		Summary
		Next
	Chapter 11: BRDFs Who’s Who
		BRDF Explorer
		BRDF Parameterizations
		Reading BRDF Explorer’s Output
			Phong
			MERL Database
			Comparing BRDFs
			An Incomplete List of BRDFs Used in Real-Time Rendering
				Ashikhmin Shirley
				Cook Torrance
				Oren Nayar
				Ward
				Disney
		Summary
		Next
	Chapter 12: Implementing a BRDF
		Which BRDF to Implement?
		Finding References
			CookTorrance
			Disney
		Starting from the Paper
			CookTorrance (or Microfacet) BRDF
			Disney BRDF
		Implementation
			Properties
			Custom Light Function Implementation
			Utility Functions
			CookTorrance Implementation
				Modified GGX Distribution Term
				Schlick Fresnel Term
				Modified Schlick Geometry Term
				Putting the CookTorrance Together
			Disney Diffuse
			Another Implementation of the Disney Diffuse
			Putting It All Together
		Summary
		Next
	Chapter 13: Hooking Into the Standard Shader
		Reverse-Engineering the Standard Shader
			Shader Keywords
			Standard Shader Structure
			Chasing Down Shader Keywords
			Implementing the Standard Shader Substitute
				Implementing the BRDF
				Making the BRDF Shader
				Making a GUI for the BRDF Shader
		Summary
		Next
	Chapter 14: Implementing Advanced Techniques
		Where to Find Techniques
		Implementing Translucency
			Properties
			Implementation
		Real-Time Reflections
			What Is a Cubemap
			What Are Reflection Probes
			Evaluating a Cubemap
			Cubemap Processing Programs
		Summary
		Next
Part III: Shader Development Advice
	Chapter 15: Making Shaders Artists Will Use
		The UX of the Disney BRDF
		Typical Problem #1: Too Many Settings
		Typical Problem #2: The Effect of a Setting Is Unclear
		Typical Problem #3: Settings Dependencies
		Typical Problem #4: Unclear Compacting of Textures
		Typical Problem #5: Strange Ranges
		Positive Example: Disney BRDF in Blender
		Summary
		Next
	Chapter 16: Complexity and Ubershaders
		What Is an Ubershader?
		The Standard Shader
		What Causes Complexity in Shaders?
		Ubershader Gotchas
		Ubershader Advantages
		Summary
		Next
	Chapter 17: When Shading Goes Wrong
		Common Tricks
		Debugging Tools
		Looking at the Generated Shader Code
		Performance Profiling
		Summary
		Next
	Chapter 18: Keeping Up with the Industry
		Conferences
		Books
		Online Communities
		Web Sites
		Social Media
		Conclusion
Index
                        

Similer Documents