Unity 2021 Shaders and Effects Cookbook
eBook - ePub

Unity 2021 Shaders and Effects Cookbook

Over 50 recipes to help you transform your game into a visually stunning masterpiece, 4th Edition

John P. Doran

Buch teilen
  1. 484 Seiten
  2. English
  3. ePUB (handyfreundlich)
  4. Über iOS und Android verfügbar
eBook - ePub

Unity 2021 Shaders and Effects Cookbook

Over 50 recipes to help you transform your game into a visually stunning masterpiece, 4th Edition

John P. Doran

Angaben zum Buch
Buchvorschau
Inhaltsverzeichnis
Quellenangaben

Über dieses Buch

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

  • Use 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.

Häufig gestellte Fragen

Wie kann ich mein Abo kündigen?
Gehe einfach zum Kontobereich in den Einstellungen und klicke auf „Abo kündigen“ – ganz einfach. Nachdem du gekündigt hast, bleibt deine Mitgliedschaft für den verbleibenden Abozeitraum, den du bereits bezahlt hast, aktiv. Mehr Informationen hier.
(Wie) Kann ich Bücher herunterladen?
Derzeit stehen all unsere auf Mobilgeräte reagierenden ePub-Bücher zum Download über die App zur Verfügung. Die meisten unserer PDFs stehen ebenfalls zum Download bereit; wir arbeiten daran, auch die übrigen PDFs zum Download anzubieten, bei denen dies aktuell noch nicht möglich ist. Weitere Informationen hier.
Welcher Unterschied besteht bei den Preisen zwischen den Aboplänen?
Mit beiden Aboplänen erhältst du vollen Zugang zur Bibliothek und allen Funktionen von Perlego. Die einzigen Unterschiede bestehen im Preis und dem Abozeitraum: Mit dem Jahresabo sparst du auf 12 Monate gerechnet im Vergleich zum Monatsabo rund 30 %.
Was ist Perlego?
Wir sind ein Online-Abodienst für Lehrbücher, bei dem du für weniger als den Preis eines einzelnen Buches pro Monat Zugang zu einer ganzen Online-Bibliothek erhältst. Mit über 1 Million Büchern zu über 1.000 verschiedenen Themen haben wir bestimmt alles, was du brauchst! Weitere Informationen hier.
Unterstützt Perlego Text-zu-Sprache?
Achte auf das Symbol zum Vorlesen in deinem nächsten Buch, um zu sehen, ob du es dir auch anhören kannst. Bei diesem Tool wird dir Text laut vorgelesen, wobei der Text beim Vorlesen auch grafisch hervorgehoben wird. Du kannst das Vorlesen jederzeit anhalten, beschleunigen und verlangsamen. Weitere Informationen hier.
Ist Unity 2021 Shaders and Effects Cookbook als Online-PDF/ePub verfügbar?
Ja, du hast Zugang zu Unity 2021 Shaders and Effects Cookbook von John P. Doran im PDF- und/oder ePub-Format sowie zu anderen beliebten Büchern aus Computer Science & Programming Games. Aus unserem Katalog stehen dir über 1 Million Bücher zur Verfügung.

Information

Jahr
2021
ISBN
9781839217692

Chapter 1: Post Processing Stack

It's great to write your own shaders and effects and fine-tune your project so that it looks just the way that you want it to, and this is what we will be spending the majority of the book looking into. However, it's also good to point out that Unity already comes with some prebuilt ways to get some of the more common effects that users like to have; users can implement these effects by using the Post Processing Stack.
For those who just want to get something up and running, the Post Processing Stack can be an excellent way for you to tweak the appearance of your game without having to write any additional code. Using the Post Processing Stack can also be useful in showing you what shaders can do and how they can improve your game projects as, behind the scenes, the Post Processing Stack provides several shaders as well as scripts that are applied to the screen via the aptly named screen shader.
In this chapter, we will cover the following recipes:
  • Installing the Post Processing Stack
  • Getting a filmic look using grain, vignetting, and depth of field
  • Mimicking real life with bloom and anti-aliasing
  • Setting the mood with color grading
  • Creating a horror game look with fog

Technical requirements

You can find the code files for this chapter on GitHub at https://github.com/PacktPublishing/Unity-2021-Shaders-and-Effects-Cookbook-Fourth-Edition/tree/main/Shaders-and-Effects-Cookbook-2021/Assets/Chapter%2001.

Installing the Post Processing Stack

Before we can use the Post Processing Stack, we must get it from the Package Manager. A Unity package is a single file that contains various assets that can be used in Unity, similar to a ZIP file. Previously, Unity used the Asset Store to share these files with users, but with time, the Package Manager has been added to give users an easy way to get free content from Unity. We will be using the Package Manager again in Chapter 13, Shader Graph – 2D, but for now, we will be using it for the Post Processing package that it contains.

Getting ready

To get started with this recipe, you will need to have Unity running and have created a new project with the 3D template. This chapter also requires you to have an environment to work from. The code files provided with this book contain a .unitypackage file called Chapter1_StartingPoint.unitypackage in the Unity Packages folder. It contains a basic scene and content for creating the scene with Unity's Standard Assets.
Open the Chapter 1 | Starting Point scene inside the Asset | Chapter 01 | Scenes folder from the Project browser. If all goes well, you should see something like this from the Game tab:
Figure 1.1 – Starting point scene
Figure 1.1 – Starting point scene
This is a simple environment that will allow us to easily see how changes that have been made with post-processing effects can modify how things are drawn on the screen.
Note
If you are interested in learning how to create the environment we've used here, check out my previous book, Unity 5.x Game Development Blueprints, also available from Packt Publishing.

How to do it...

To get started, follow these steps:
  1. Open Package Manager by going to Window | Pa...

Inhaltsverzeichnis