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

Partager le livre
  1. 484 pages
  2. English
  3. ePUB (adapté aux mobiles)
  4. Disponible sur iOS et 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

DĂ©tails du livre
Aperçu du livre
Table des matiĂšres
Citations

À propos de ce livre

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.

Foire aux questions

Comment puis-je résilier mon abonnement ?
Il vous suffit de vous rendre dans la section compte dans paramĂštres et de cliquer sur « RĂ©silier l’abonnement ». C’est aussi simple que cela ! Une fois que vous aurez rĂ©siliĂ© votre abonnement, il restera actif pour le reste de la pĂ©riode pour laquelle vous avez payĂ©. DĂ©couvrez-en plus ici.
Puis-je / comment puis-je télécharger des livres ?
Pour le moment, tous nos livres en format ePub adaptĂ©s aux mobiles peuvent ĂȘtre tĂ©lĂ©chargĂ©s via l’application. La plupart de nos PDF sont Ă©galement disponibles en tĂ©lĂ©chargement et les autres seront tĂ©lĂ©chargeables trĂšs prochainement. DĂ©couvrez-en plus ici.
Quelle est la différence entre les formules tarifaires ?
Les deux abonnements vous donnent un accĂšs complet Ă  la bibliothĂšque et Ă  toutes les fonctionnalitĂ©s de Perlego. Les seules diffĂ©rences sont les tarifs ainsi que la pĂ©riode d’abonnement : avec l’abonnement annuel, vous Ă©conomiserez environ 30 % par rapport Ă  12 mois d’abonnement mensuel.
Qu’est-ce que Perlego ?
Nous sommes un service d’abonnement Ă  des ouvrages universitaires en ligne, oĂč vous pouvez accĂ©der Ă  toute une bibliothĂšque pour un prix infĂ©rieur Ă  celui d’un seul livre par mois. Avec plus d’un million de livres sur plus de 1 000 sujets, nous avons ce qu’il vous faut ! DĂ©couvrez-en plus ici.
Prenez-vous en charge la synthÚse vocale ?
Recherchez le symbole Écouter sur votre prochain livre pour voir si vous pouvez l’écouter. L’outil Écouter lit le texte Ă  haute voix pour vous, en surlignant le passage qui est en cours de lecture. Vous pouvez le mettre sur pause, l’accĂ©lĂ©rer ou le ralentir. DĂ©couvrez-en plus ici.
Est-ce que Unity 2021 Shaders and Effects Cookbook est un PDF/ePUB en ligne ?
Oui, vous pouvez accĂ©der Ă  Unity 2021 Shaders and Effects Cookbook par John P. Doran en format PDF et/ou ePUB ainsi qu’à d’autres livres populaires dans Computer Science et Programming Games. Nous disposons de plus d’un million d’ouvrages Ă  dĂ©couvrir dans notre catalogue.

Informations

Année
2021
ISBN
9781839217692
Édition
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...

Table des matiĂšres