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

Condividi libro
  1. 484 pagine
  2. English
  3. ePUB (disponibile sull'app)
  4. Disponibile su iOS e Android
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

Dettagli del libro
Anteprima del libro
Indice dei contenuti
Citazioni

Informazioni sul libro

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.

Domande frequenti

Come faccio ad annullare l'abbonamento?
È semplicissimo: basta accedere alla sezione Account nelle Impostazioni e cliccare su "Annulla abbonamento". Dopo la cancellazione, l'abbonamento rimarrà attivo per il periodo rimanente già pagato. Per maggiori informazioni, clicca qui
È possibile scaricare libri? Se sì, come?
Al momento è possibile scaricare tramite l'app tutti i nostri libri ePub mobile-friendly. Anche la maggior parte dei nostri PDF è scaricabile e stiamo lavorando per rendere disponibile quanto prima il download di tutti gli altri file. Per maggiori informazioni, clicca qui
Che differenza c'è tra i piani?
Entrambi i piani ti danno accesso illimitato alla libreria e a tutte le funzionalità di Perlego. Le uniche differenze sono il prezzo e il periodo di abbonamento: con il piano annuale risparmierai circa il 30% rispetto a 12 rate con quello mensile.
Cos'è Perlego?
Perlego è un servizio di abbonamento a testi accademici, che ti permette di accedere a un'intera libreria online a un prezzo inferiore rispetto a quello che pagheresti per acquistare un singolo libro al mese. Con oltre 1 milione di testi suddivisi in più di 1.000 categorie, troverai sicuramente ciò che fa per te! Per maggiori informazioni, clicca qui.
Perlego supporta la sintesi vocale?
Cerca l'icona Sintesi vocale nel prossimo libro che leggerai per verificare se è possibile riprodurre l'audio. Questo strumento permette di leggere il testo a voce alta, evidenziandolo man mano che la lettura procede. Puoi aumentare o diminuire la velocità della sintesi vocale, oppure sospendere la riproduzione. Per maggiori informazioni, clicca qui.
Unity 2021 Shaders and Effects Cookbook è disponibile online in formato PDF/ePub?
Sì, puoi accedere a Unity 2021 Shaders and Effects Cookbook di John P. Doran in formato PDF e/o ePub, così come ad altri libri molto apprezzati nelle sezioni relative a Computer Science e Programming Games. Scopri oltre 1 milione di libri disponibili nel nostro catalogo.

Informazioni

Anno
2021
ISBN
9781839217692
Edizione
4

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

Indice dei contenuti