Unity 2021 Shaders and Effects Cookbook: Over 50 recipes to help you transform your game into a visually stunning masterpiece, 4th Edition
- Length: 446 pages
- Edition: 4
- Language: English
- Publisher: Packt Publishing
- Publication Date: 2021-11-09
- ISBN-10: 1839218622
- ISBN-13: 9781839218620
- Sales Rank: #1305348 (See Top 100 Books)
Overcome the challenges and complexities involved in creating your own shaders with high-level realism using practical solutions, best practices, and the latest features of Unity 2021
Key Features
- Discover practical recipes for mastering post-processing effects and advanced shading techniques
- Learn the secrets of creating AAA quality shaders without writing long algorithms
- Create visually stunning effects for your games using Unity’s VFX Graph
Book Description
Shaders enable you to create powerful visuals for their game projects. However, creating shaders for your games can be notoriously challenging with various factors like complex mathematics standing in the way of attaining the level of realism you crave for your shaders.
The Unity 2021 Shaders and Effects Cookbook helps you overcome that with a recipe-based approach to creating shaders using Unity. This fourth edition is updated and enhanced using Unity 2021 features and tools covering Unity’s new way of creating particle effects with the VFX Graph. You’ll learn how to use VFX Graph for advanced shader development. The book also features updated recipes for using Shader Graph to create 2D and 3D elements. You’ll cover everything you need to know about vectors, how they can be used to construct lighting, and how to use textures to create complex effects without the heavy math. You’ll also understand how to use the visual-based Shader Graph for creating shaders without any code.
By the end of this Unity book, you’ll have developed a set of shaders that you can use in your Unity 3D games and be able to accomplish new effects and address the performance needs for your Unity game development projects. So, let’s get started!
What you will learn
- Understand physically based rendering to fit the aesthetic of your game
- Create spectacular effects for your games by testing the limits of what shaders can do
- Explore advanced shader techniques for your games with AAA quality
- Use Shader Graph to create 2D and 3D elements for your games without writing code
- Master the math and algorithms behind the commonly used lighting models
- Get to grips with the post-processing stack to tweak the appearance of your game
Who This Book Is For
This book is for game developers who want to start creating their first shaders in Unity 2021 and take their game to a whole new level by adding professional post-processing effects. The book assumes intermediate-level knowledge of Unity.
Unity 2021 Shaders and Effects Cookbook Fourth Edition Contributors About the author About the reviewers Preface Who this book is for What this book covers To get the most out of this book Download the example code files Download the color images Conventions used Sections Getting ready How to do it… How it works… There's more… See also Get in touch Share Your Thoughts Chapter 1: Post Processing Stack Technical requirements Installing the Post Processing Stack Getting ready How to do it... Getting a filmic look using grain, vignetting, and depth of field Getting ready How to do it... How it works... Mimicking real life with bloom and anti-aliasing Getting ready How to do it... How it works... Setting the mood with color grading Getting ready How to do it... Creating a horror game look with fog Getting ready How to do it... How it works... Chapter 2: Creating Your First Shader Technical requirements Creating a basic Standard Shader Getting ready How to do it... How it works... There's more... Adding properties to a shader Getting ready How to do it... How it works... See also Using properties in a Surface Shader How to do it... How it works... There's more... See also Chapter 3: Working with Surface Shaders Technical requirements Implementing diffuse shading Getting ready How to do it... How it works... Accessing and modifying packed arrays How to do it... There's more... See also Creating a shader with normal mapping Getting ready How to do it... How it works... There's more... Creating a Holographic Shader Getting ready How to do it... How it works... There's more... See also Chapter 4: Working with Texture Mapping Technical requirements Adding a texture to a shader Getting ready How to do it... How it works... There's more... See also Scrolling textures by modifying UV values Getting ready How to do it... How it works... Creating a transparent material Getting ready How to do it... How it works... Packing and blending textures Getting ready How to do it... How it works... Creating a circle around your terrain Getting ready… How to do it... How it works... There's more… Chapter 5: Understanding Lighting Models Technical requirements Creating a custom diffuse lighting model Getting ready How to do it... How it works... Creating a toon shader Getting ready How to do it... How it works... There's more... Creating a Phong Specular type Getting ready How to do it... How it works... Creating a Blinn-Phong Specular type Getting ready How to do it... How it works... See also Creating an Anisotropic Specular type Getting ready How to do it... How it works... Chapter 6: Physically Based Rendering Technical requirements Understanding the metallic setup Getting ready How to do it... How it works... See also Adding transparency to PBR Getting ready How to do it... Semi-transparent materials Fading objects Solid geometries with holes See also Creating mirrors and reflective surfaces Getting ready How to do it... How it works... See also Baking lights into your scene Getting ready How to do it... Configuring the static geometry Configuring the light probes Baking the lights How it works... See also Chapter 7: Vertex Functions Technical requirements Accessing a vertex color in a Surface Shader Getting ready How to do it… How it works… There's more… Animating vertices in a Surface Shader Getting ready How to do it… How it works… Extruding your models Getting ready How to do it… How it works… There's more… Adding extrusion maps Implementing a snow shader Getting ready How to do it… How it works… Coloring the surface Altering the geometry See also Implementing a volumetric explosion Getting ready How to do it… How it works… There's more… See also Chapter 8: Fragment Shaders and Grab Passes Technical requirements Understanding Vertex and Fragment Shaders Getting ready How to do it… How it works… There's more… Input semantics Output semantics See also Using grab passes to draw behind objects Getting ready How to do it… How it works… There's more… Implementing a Glass Shader Getting ready How to do it… How it works… There's more… Implementing a Water Shader for 2D games Getting ready How to do it… How it works… Chapter 9: Mobile Shader Adjustment Technical requirements Techniques to make shaders more efficient Getting ready How to do it... How it works... Profiling your shaders Getting ready How to do it... How it works... There's more... Modifying our shaders for mobile Getting ready How to do it... How it works... Chapter 10: Screen Effects with Unity Render Textures Technical requirements Setting up a screen effects script system Getting ready How to do it... How it works... There's more... Using brightness, saturation, and contrast with screen effects Getting ready How to do it... How it works... Using basic Photoshop-like Blend Modes with screen effects Getting ready How to do it... How it works... There's more... Using the Overlay Blend Mode with screen effects How to do it... How it works... Chapter 11: Gameplay and Screen Effects Technical requirements Creating an old movie screen effect Getting ready How to do it... How it works... See also Creating a night-vision screen effect Getting ready How to do it... How it works... There's more... Chapter 12: Advanced Shading Techniques Technical requirements Using Unity's built-in CgInclude files Getting ready How to do it... How it works... There's more... Making your shader work in a modular way with CgInclude Getting ready How to do it... How it works... Implementing a Fur Shader Getting ready How to do it... How it works... There's more... Implementing Heatmaps with arrays Getting ready How to do it... How it works... Chapter 13: Shader Graph – 2D Technical requirement Creating a URP-based Shader Graph project How to do it... How it works... Implementing a simple Shader Graph Getting ready How to do it... How it works... Exposing properties to the Inspector via Shader Graph Getting ready How to do it... How it works... Creating a Sprite Outline Shader Getting ready How to do it... How it works... Chapter 14: Shader Graph – 3D Technical requirements Implementing a glowing highlight system Getting ready How to do it... How it works... Portal Shaders in Unity Getting ready How to do it... How it works... Creating custom Shader Graph functions Getting ready How to do it... How it works... Why subscribe? Other Books You May Enjoy Packt is searching for authors like you Share Your Thoughts
Donate to keep this site alive
How to download source code?
1. Go to: https://github.com/PacktPublishing
2. In the Find a repository… box, search the book title: Unity 2021 Shaders and Effects Cookbook: Over 50 recipes to help you transform your game into a visually stunning masterpiece, 4th Edition
, sometime you may not get the results, please search the main title.
3. Click the book title in the search results.
3. Click Code to download.
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.