ENGLISH

Unity 2021 Shaders and Effects Cookbook: Over 50 recipes to help you transform your game into a visually stunning masterpiece, 4th Edition

Book information

Publisher
Packt Publishing
Year
2021
ISBN
1839218622, 9781839218620
Language
english
Format
PDF
Filesize
21 MB (22272415 bytes)
Edition
4
Pages
484\485
Time added
2021-10-19 18:31:42

Description

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 FeaturesDiscover practical recipes for mastering post-processing effects and advanced shading techniquesLearn the secrets of creating AAA quality shaders without writing long algorithmsCreate visually stunning effects for your games using Unity's VFX GraphBook Description Shaders enable you to create powerful visuals for your game projects. However, creating shaders for your games can be notoriously challenging with various factors such as 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 of your Unity game development projects. So, let's get started! What you will learnUse physically based rendering to fit the aesthetic of your gameCreate spectacular effects for your games by testing the limits of what shaders can doExplore advanced shader techniques for your games with AAA qualityUse Shader Graph to create 2D and 3D elements for your games without writing codeMaster the math and algorithms behind the commonly used lighting modelsGet to grips with the Post-Processing Stack to tweak the appearance of your gameWho 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. Table of ContentsPost Processing StackCreating Your First ShaderWorking with Surface ShadersWorking with Texture MappingUnderstanding Lighting ModelsPhysically Based RenderingVertex FunctionsFragment Shaders and Grab PassesMobile Shader Adjustment Screen Effects with Unity Render TexturesGameplay and Screen EffectsAdvanced Shading TechniquesShader Graph – 2DShader Graph – 3D Cover Title Page Copyright and credits Contributors About the reviewers Table of Contents Preface 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... 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... 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… Implementing a snow shader Getting ready How to do it… How it works… 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… 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... Other Books You May Enjoy Index

Similar books