Loading...

Post Processing


In this blog I will be discussing what I have learnt about post effects and how I have used them in my assessment.

To quickly describe post processing it is like adding a filter over your game which changes the way the game looks. Think Instagram or Lightroom Presets
Post processing requires you to import the Post Processing stack first

Post Processing Stack – Asset Store

And then you build Post Processing Profiles
These post processing profiles are basically a preset which you can apply to the look of your game.
These can include colour adjustments, motion blur, vignetting, and most other effects you may have encountered in both image and video editing.

 

If you would like to take a deeper look into what all of the post processing settings do and how they can help you create more realistic and appealing games check out this video:

This is a script I used within my game “The Battle For Treasure Island” where on the players death I switched post processing profiles in code to create a death look.

When the player is marked as dead the profile is switched and the game goes from a colorful looking game to a gloomy black and white scene whilst the you lose screen appears.

There is the code from that script:

 

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.PostProcessing;

//Handles Post Processing Stack and Profiles
public class PostProcessHandler : MonoBehaviour
{
    // Game Manager game object
    public GameObject _gameManager;
    //Post processing profile for normal game play
    public PostProcessingProfile _normalProfile;
    //Post processing profile for death / game over
    public PostProcessingProfile _deathProfile;

    // Use this for initialization
    void Start()
    {
        //Finds and attaches the Game Manager
        _gameManager = GameObject.Find("GameManager");
    }

    // Update is called once per frame
    void Update ()
    {
        //Handles checking if the player is alive
        CheckPlayerAlive();
    }

    //Is the player alive?
    void CheckPlayerAlive()
    {
        //Is the player alive?
        if (_gameManager.GetComponent()._playerAlive)
        {
            //Yes - use normal profile
            GetComponent().profile = _normalProfile;
        }
        else
        {
            //No - activate death profile
            GetComponent().profile = _deathProfile;
        }
    }
}