Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Hands-On Unity  Game Development - Fourth Edition

You're reading from  Hands-On Unity Game Development - Fourth Edition

Product type Book
Published in Jan 2024
Publisher Packt
ISBN-13 9781835085714
Pages 742 pages
Edition 4th Edition
Languages
Authors (2):
Nicolas Alejandro Borromeo Nicolas Alejandro Borromeo
Profile icon Nicolas Alejandro Borromeo
Juan Gabriel Gomila Salas Juan Gabriel Gomila Salas
Profile icon Juan Gabriel Gomila Salas
View More author details

Table of Contents (28) Chapters

Preface 1. Section 1: Getting Started with Unity
2. Embark on Your Unity Journey 3. Crafting Scenes and Game Elements 4. From Blueprint to Reality: Building with Terrain and ProBuilder 5. Seamless Integration: Importing and Integrating Assets 6. Section 2: Mastering Programming and Gameplay Mechanics
7. Unleashing the Power of C# and Visual Scripting 8. Dynamic Motion: Implementing Movement and Spawning 9. Collisions and Health: Detecting Collisions Accurately 10. Victory or Defeat: Win and Lose Conditions 11. Starting Your AI Journey: Building Intelligent Enemies for Your Game 12. Section 3: Elevating Visuals, Effects, and Audio
13. Material Alchemy: Using URP and Shader Graph for Stunning Visuals 14. Captivating Visual Effects: Harnessing Particle Systems and Visual Effect Graph 15. Enlightening Worlds: Illuminating Scenes with the Universal Render Pipeline 16. Immersive Realism: Achieving Fullscreen Effects with Post-Processing 17. Harmonious Soundscapes: Integrating Audio and Music 18. Section 4: Designing User Interfaces, Animations and Advanced Concepts
19. Interface Brilliance: Designing User-Friendly UI 20. Next-Gen UI: Creating Dynamic Interfaces with UI Toolkit 21. Animated Realities: Creating Animations with Animator, Cinemachine, and Timeline 22. Performance Wizardry: Optimizing Your Game with Profiler Tools 23. From Prototype to Executable: Generating and Debugging Your Game 24. AR/VR 25. Massive Worlds: Introduction to DOTS 26. Other Books You May Enjoy
27. Index

Material Alchemy: Using URP and Shader Graph for Stunning Visuals

Welcome to the first chapter of Section 3, Elevating Visuals, Effects, and Audio Here, we will dive deep into the different graphics and audio systems of Unity to dramatically improve the look and feel of the game. Let’s begin our journey into the world of shaders, the artists behind the scenes in every Unity game, and learn how to craft our own from scratch. We will start by discussing what a shader is and how to create our own to achieve several custom effects that couldn’t be accomplished using the default Unity shaders. We will be creating a simple water animation effect using Shader Graph, a visual shader editor included in the Universal Render Pipeline (URP), the preferred option for creators to launch their games on a wide variety of devices, including web and mobile. Also known as URP, this is one of the different rendering pipelines available in Unity, which provides rendering features oriented...

Introducing shaders and URP

Remember the glowing orb material we created in Section 1, Getting Started with Unity? Let’s explore how its shader property manipulates light to create that glow effect. In this first section, we will be exploring the concept of a shader as a way to program the video card to achieve custom visual effects. We will also be discussing how URP works with those shaders, and the default shaders it provides.

In this section, we will cover the following concepts related to shaders:

  • Shader pipeline
  • Render pipeline and URP
  • URP built-in shaders

Let’s start by discussing how a shader modifies the shader pipeline to achieve effects.

Shader pipeline

Whenever a video card renders a 3D model, it needs different information to process, such as a mesh, textures, the transformation of the object (position, rotation, and scale), and lights that affect the object. With that data, the video card must output the pixels...

Creating shaders with Shader Graph

Now that we know how shaders work and the existing shaders in URP, we have a basic notion of when it is necessary to create a custom shader and when it is not necessary. In case you really need to create one, this section will cover the basics of effects creation with Shader Graph, a tool to create effects using a visual node-based editor. This is an easy tool to use when you are not used to coding.

In this section, we will discuss the following concepts of Shader Graph:

  • Creating our first Shader Graph
  • Using textures
  • Combining textures
  • Applying transparency
  • Creating vertex effects

Let’s start by seeing how we can create and use a Shader Graph.

Creating our first Shader Graph

Shader Graph is a tool that allows us to create custom effects using a node-based system. An effect in Shader Graph can look like in the following screenshot:

Figure 10.15: Shader Graph with nodes to create...

Summary

In this chapter, we discussed how a shader works in the GPU and how to create our first simple shader to achieve a nice water effect. Working with shaders is a complex and interesting job, and in a team, there is usually one or more people in charge of creating all of these effects, in a position called technical artist; so, as you can see, this topic can expand to a whole career. Remember, the intention of this book is to give you a small taste of all the possible roles you can take in the industry, so if you really liked this role, I suggest you start reading shader-exclusive books. You have a long but super interesting road in front of you.

Enough shaders for now! In the next chapter, we will look at how to improve our graphics and create visual effects with particle systems!

Learn more on Discord

Read this book alongside other users, Unity game development experts, and the author himself. Ask questions, provide solutions to other readers, chat with the...

lock icon The rest of the chapter is locked
You have been reading a chapter from
Hands-On Unity Game Development - Fourth Edition
Published in: Jan 2024 Publisher: Packt ISBN-13: 9781835085714
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at AU $19.99/month. Cancel anytime}