Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Unity 2021 Game Development

You're reading from   Hands-On Unity 2021 Game Development Create, customize, and optimize your own professional games from scratch with Unity 2021

Arrow left icon
Product type Paperback
Published in Aug 2021
Publisher Packt
ISBN-13 9781801071482
Length 710 pages
Edition 2nd Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Nicolas Alejandro Borromeo Nicolas Alejandro Borromeo
Author Profile Icon Nicolas Alejandro Borromeo
Nicolas Alejandro Borromeo
Arrow right icon
View More author details
Toc

Table of Contents (29) Chapters Close

Preface 1. Section 1 – Our First Level
2. Chapter 1: Designing a Game from Scratch FREE CHAPTER 3. Chapter 2: Setting Up Unity 4. Chapter 3: Working with Scenes and Game Objects 5. Chapter 4: Grayboxing with Terrain and ProBuilder 6. Chapter 5: Importing and Integrating Assets 7. Section 2 – Improving Graphics and Sound
8. Chapter 6: Materials and Effects with URP and Shader Graph 9. Chapter 7: Visual Effects with Particle Systems and Visual Effect Graph 10. Chapter 8: Lighting Using the Universal Render Pipeline 11. Chapter 9: Fullscreen Effects with Postprocessing 12. Chapter 10: Sound and Music Integration 13. Chapter 11: User Interface Design 14. Chapter 12: Creating a UI with the UI Toolkit 15. Chapter 13: Creating Animations with Animator, Cinemachine, and Timeline 16. Section 3 – Scripting Level Interactivity with C#
17. Chapter 14: Introduction to C# and Visual Scripting 18. Chapter 15: Implementing Movement and Spawning 19. Chapter 16: Physics Collisions and Health System 20. Chapter 17: Win and Lose Condition 21. Chapter 18: Scripting the UI, Sounds, and Graphics 22. Chapter 19: Implementing Game AI for Building Enemies 23. Chapter 20: Scene Performance Optimization 24. Section 4 – Releasing Your Game
25. Chapter 21: Building the Project 26. Chapter 22: Finishing Touches 27. Chapter 23: Augmented Reality in Unity 28. Other Books You May Enjoy

Optimizing lighting

We mentioned previously that not calculating lighting is good for performance, but what about not calculating lights, but still having them? Yes, it sounds too good to be true, but it is actually possible (and, of course, tricky). We can use a technique called static lighting or baking, which allows us to calculate lighting once and use the cached result.

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

  • Understanding static lighting
  • Baking lightmaps
  • Applying static lighting to dynamic objects

Understanding static lighting

The idea is pretty simple: just do the lighting calculations once, save the results, and then use those instead of calculating lighting all the time. You may be wondering why this isn't the default technique to use. This is because it has some limitations, with the big one being dynamic objects. Precalculating shadows means that they can't change once they've been calculated...

lock icon The rest of the chapter is locked
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 €18.99/month. Cancel anytime