CHAPTER 15
Beginner
Lighting, Effects, and Post Processing
Updated: May 16, 2026
35 min read
# CHAPTER 15
Lighting, Effects, and Post Processing
1. Introduction
Have you ever looked at a raw Unity scene and thought, *"Why does my game look like a cheap plastic toy, while professional games look cinematic?"* The secret is not just higher-resolution 3D models; the secret is Lighting and Post-Processing. The way light bounces off a wall, the slight glowing bloom of a neon sign, and the dust particles floating in the air are what transform a sterile digital box into a breathing world. In this chapter, we will master Lighting, Effects, and Post Processing. We will explore Real-time vs. Baked lighting, create magical sparks using the Particle System, and apply cinematic camera filters.2. Learning Objectives
By the end of this chapter, you will be able to:- Differentiate between Real-time Lighting and Baked Global Illumination (GI).
- Understand how to generate a Lightmap to optimize performance.
- Create dynamic visual effects using the Unity Particle System.
- Install and configure the Post-Processing Stack.
- Apply cinematic effects like Bloom, Color Grading, and Vignette.
3. Real-Time vs. Baked Lighting
There are two ways to light a 3D world:- 1. Real-time Lighting: The CPU calculates the shadows exactly 60 times a second. If an enemy walks under a light, their shadow moves perfectly. Pros: Dynamic. Cons: Incredibly expensive. Too many real-time lights will cripple your framerate.
- 2. Baked Lighting (Lightmaps): The computer spends 10 minutes calculating highly realistic light physics (like light bouncing off a red carpet to tint the ceiling pink). It then paints those shadows permanently onto the 3D textures. Pros: Photorealistic and zero performance cost during gameplay! Cons: Static objects only. A baked shadow cannot move.
4. How to Bake Lighting (Global Illumination)
- 1. Select your floor, walls, and static props.
- 2. In the Inspector, check the box in the top right that says Static (specifically, Lightmap Static).
- 3. Go to Window -> Rendering -> Lighting.
- 4. Scroll to the bottom and click Generate Lighting.
- 5. Wait. Unity is calculating billions of light rays. When it finishes, your scene will look incredibly realistic, complete with soft, bouncing ambient light (Global Illumination)!
5. The Particle System (VFX)
Explosions, magic spells, rain, and sparks are created using the Particle System.- Right-click Hierarchy -> Effects -> Particle System.
- A particle is essentially a 2D image (like a picture of smoke) that always faces the camera.
- The Particle System component has dozens of modules:
- Emission: How many particles spawn per second.
- Shape: Spawn them in a Cone (fireworks) or a huge Box (rain).
- Color over Lifetime: Make fire start bright yellow and fade out to gray smoke as it floats upward.
- Size over Lifetime: Make the smoke puff expand as it rises.
6. Post-Processing (The "AAA" Filter)
Post-Processing is like applying an Instagram filter to your game camera. It alters the pixels right before they hit the monitor.- 1. Open the Package Manager and install Post Processing.
-
2.
Add a
Post-process Volumecomponent to an empty GameObject. Check the Is Global box.
- 3. Click "New" to create a Profile.
-
4.
Add a
Post-process Layercomponent to your Main Camera so the camera can "see" the effects.
7. Essential Post-Processing Effects
Click "Add Effect" on your Volume to add cinematic polish:- Bloom: The magic "make it look AAA" button. Any object with a bright emissive material (like a lightsaber or lava) will bleed a soft, cinematic glow into the surrounding air.
- Color Grading: Adjust the Contrast and Saturation to make a horror game look bleak and blue, or a platformer look vibrant and saturated.
- Vignette: Darkens the corners of the screen to draw the player's eye to the center.
- Depth of Field: Blurs the background, focusing sharply on the character, mirroring a real-life DSLR camera lens.
8. Visual Learning: The Lighting Pipeline
txt
9. Best Practices
- Mix Lighting Modes: The industry standard is "Mixed Lighting." You bake the environment (the sun, the buildings) for maximum performance and realism, but you keep a single Real-time Directional Light active just to cast moving shadows for the player and enemies.
10. Common Mistakes
- Overusing Bloom: Beginners discover the Bloom effect and crank the intensity to 10. The game becomes a blinding, radioactive mess of glowing lights. Use Bloom subtly. It should emulate camera lens bleed, not obscure the gameplay.
11. Mini Project: Build a Campfire
Objective: Combine lighting, particles, and post-processing.- 1. Create a dark outdoor scene.
-
2.
Create a Particle System. Set the Shape to
Cone(angle 10). Set Start Color to Orange. EnableSize over Lifetimeto make them shrink. EnableColor over Lifetimeto fade alpha to 0. You now have fire!
- 3. Add a Point Light inside the fire. Set its color to warm orange and intensity to high.
- 4. Add a Post-Process Volume to the scene. Add the Bloom effect.
- 5. In the Fire Particle System's Renderer module, apply an HDR glowing material.
- 6. Look through the camera. The intense light of the fire will trigger the Bloom, creating a soft, cinematic, glowing campfire illuminating the dark wilderness!
12. Practice Exercises
- 1. What does it mean to "Bake" lighting, and why is it vastly superior for game performance?
- 2. Which Unity system is used to create massive amounts of moving 2D images, such as a rainstorm or a magic spell?
13. MCQs with Answers
Question 1
Before you click "Generate Lighting" to bake photorealistic shadows into your environment, what specific checkbox MUST be checked on the 3D objects (like walls and floors) in the Inspector?
Question 2
Which Post-Processing effect is responsible for making brightly lit objects (like neon signs or lasers) softly glow and bleed light into the surrounding pixels?
14. Interview Questions
- Q: Explain the concept of Global Illumination (GI). How does bouncing light calculations improve the realism of a 3D scene compared to simple direct lighting?
- Q: Contrast the performance costs of Real-Time lighting versus Baked Lighting. In a mobile game, which technique is strictly preferred for environments, and why?
- Q: A level designer complains that the scene looks "flat" and "plastic." Describe a workflow combining Post-Processing techniques to upgrade the scene to a modern, cinematic standard.