Reader small image

You're reading from  Unreal Engine 4 Shaders and Effects Cookbook

Product typeBook
Published inMay 2019
Reading LevelBeginner
PublisherPackt
ISBN-139781789538540
Edition1st Edition
Languages
Tools
Right arrow
Authors (2):
Brais Brenlla Ramos
Brais Brenlla Ramos
author image
Brais Brenlla Ramos

Brais Brenlla Ramos is a passionate Architect, 3D artist, Unreal Engine 4 developer and first-time author based between A Corua and his place of work in London, UK. His passion for all things 3D-related dates back to when he was playing games as a child, experiences that fuelled his later studies in architecture and computer animation. His entrance into the professional 3D world happened at the same time as his studies were finishing, with initial projects undertaken in the field of architectural visualization for different studios. Since then, he's worked on many different 3D modeling and app development projects, first as a team member, and later as the Unreal Engine 4 lead developer at a company called AccuCities, based in London.
Read more about Brais Brenlla Ramos

John P. Doran
John P. Doran
author image
John P. Doran

John P. Doran is a passionate and seasoned Technical Game Designer, Software Engineer, and Author who is based in Incheon, South Korea. His passion for game development began at an early age. He later graduated from DigiPen Institute of Technology with a Bachelor of Science in Game Design. For over a decade, John has gained extensive hands-on expertise in game development working in various roles ranging from game designer to lead UI programmer working in teams consisting of just himself to over 70 people in student, mod, and professional game projects including working at LucasArts on Star Wars: 1313. Additionally, John has worked in game development education teaching in Singapore, South Korea, and the United States. To date, he has authored over 10 books pertaining to game development. John is currently a Technical Game Design Instructor at George Mason University Korea. Prior to his present ventures, he was an award-winning videographer.
Read more about John P. Doran

View More author details
Right arrow

Chapter 2. Post-Processing Effects

Welcome to the chapter on post-processing effects! Here are some of the things that we are going to be doing in the next few pages:

  • Using a Post Process Volume
  • Changing the mood of a scene through color grading
  • Setting up a cinematic shot using depth of field
  • Applying cinematic effects to our games
  • Mimicking a real-life camera using Bloom and Lens Flares
  • A horror movie pulsating effect with post process materials
  • Adjusting anti aliasing and other rendering features

Introduction


As you probably already know, Unreal combines many different pipelines in order to create whatever it is you are after—a video game, an app, an architectural walk-through. From animation to rendering, there are many different fields of study that we could be looking at. However much we would like to do so, the topics are just too wide to be tackled here. But even though we are not going to be looking at all of them, there is one important aspect that we need to pay attention to. It is one that directly affects the material and the rendering pipeline—we are talking, of course, about post-processing effects.

At their core, post-processing effects are a rendering pass that happens after our materials have been constructed but before the whole scene is outputted to the screen. They are like a layer that we can insert between what we have created and what the user experiences, so they are very powerful tools that enable us to modify and correct what we have previously done. Throughout...

Using a post-process volume


In order to access the different post process effects that Unreal has in store for us, we will need to place a specific actor in our level. This actor receives the name Post Process Volume, a container in the shape of a box that specifies its area of influence.

Thankfully for us, every setting that we are going to be tweaking in this chapter can be modified using the previous actor. Having all of the post process effects grouped in one place makes our lives easier—so, let's start looking at all of the different options that we can play with!

Getting ready

I've prepared a scene for you to use as you traverse through the different recipes of this chapter—it is a very simple one, but it should help demonstrate the different post process effects that we are going to be using in the next pages. You can locate the file by navigating to the following directory inside the Unreal project we are providing: Content/UE4ShadersAndEffects/Maps/Chapter02.

The name of the scene is...

Changing the mood of a scene through color grading


After we've taken some time to familiarize ourselves with the post process volume actor, it is now time to start looking at how to use the different functionalities we can find within it.

The first section that we will be covering is also the first one we can find if we look at the details panel for the actor and that is the Color Grading tab.

The reason these options exist in Unreal is similar to why they exist elsewhere, like in movies or videos. The end goal is to provide artists with a series of tools that they can use to alter the look of the final image. Similar techniques have been prominent in motion pictures, for example, where the captured footage is adjusted to satisfy a particular need be that the establishing of a stylized look or the ensuring of color continuity. What we are going to be doing in the following pages is exactly that tweaking of the default camera values to modify the look of our scene.

Getting ready

In this recipe...

Setting up a cinematic shot using depth of field 


In this short recipe, we are going to take a break from the post process volume actor to focus instead on the Cinematic Camera one. That doesn't mean we are leaving behind the world of post processing effects, far from it, in fact. The beauty of this recipe resides partially in learning that the previously used post process volume has a companion in the shape of this handy camera. Both of them have access to some of the post processing functionalities that Unreal offers, and learning when to use each one can be quite useful.

The other part that we want to cover as well is the setup of a proper camera, pretty much as we would do if we were working with a real one. This is especially useful as some of the most used visual effects we can introduce directly relate to this actor, so it makes sense to master it before moving forward. 

Getting ready

You should really see this coming by now! Yes, we have a scene already set up for you, and you can find...

Applying cinematic effects to our games


We took some time aside in the previous recipe to learn about the other type of actors that have access to the post processing effects in UE4 – the cameras. In particular, we focused our attention on the cine camera actor, a specific type that has the potential to use certain cinematic effects. Taking it from there, we will continue to look at some other cinematic techniques available to us while still using that same camera actor. We'll take a look at Grain, Vignetting, Chromatic Aberration, and more. 

The reason we continue to use a camera and not the post process volume is because some of the effects we are about to include come from the world of cinematography. While they definitely can be used on the volume as well, it does make sense at this stage to continue to use the camera if only to just replicate how things would also be happening in real life. After all, Unreal bases much of its capabilities in the realm of reality, and these are another...

Mimicking a real-life camera using Bloom and Lens Flares


The post processing effects that we are going to covering in this recipe are going to deal with lights. Daily life has probably taught every one of us about the different consequences that light introduces in our vision: as in what happens when we look at a very bright spot or how our eyes adapt to sudden changes in lighting. If you have also dealt with a camera in the past, the chances are you've also seen how certain camera effects can start to show if we have a light source in our sights. This is what we are going to be covering in the following pages: namely, two of them known as Bloom and Lens Flares. Replicating those effects in Unreal is easy and can add a bit of flavor to your scenes, as long as they are use in a subtle way. Let's take a look at them!

Getting ready

The scene we are going to be using in order to introduce the previous camera effects can be found in the following folder: Content / UE4ShadersAndEffects / Maps /...

A horror movie pulsating effect with post process materials


Welcome back to another recipe on post processing effects! I'm quite excited about this one, as we are about to start creating our own personal effects instead of using the ones we already have available through the engine. To do so, we'll take advantage of a particular type of shaders called the Post Process Materials that, to be honest, are quite self explanatory. They are the ones to be used when we need to adjust the scene as a whole. They are applied inside the post process volume, and not on a particular 3D model. Because of that, the way we create them is somewhat different to that of a standard material, so we'll be taking a look at how they are structured. This recipe will be the foundation which will let us create more complex effects later on, so let's jump right in!

Getting ready

We are going to start this recipe by loading a specific level, one which might feel familiar. Dive into the following folder and select the specified...

Adjusting anti aliasing and other rendering features


Welcome to the last recipe of this chapter! So far, we've had the opportunity to play around with most of the settings that both the post process volume and the cine camera actor have to offer. We don't want to say goodbye to this topic though without looking at some of the final technical adjustments we can perform on our scenes at a global scale. That being the case, we will focus our attention now on several important values such as the following:

  • Supersampling
  • Screen Space Reflections
  • Ambient Occlusion
  • Motion Blur
  • Anti Aliasing

All of the previous topics are often viewed more from a technical point of view rather than an artistic one. They can have a great impact on the visual quality and feel of the scene, and we don't want to downplay the part that they have on that regard. However, more often than not, they are values that we have to adjust keeping in mind the performance that we are after. It's not so much a question of whether we want...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Unreal Engine 4 Shaders and Effects Cookbook
Published in: May 2019Publisher: PacktISBN-13: 9781789538540
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.
undefined
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 $15.99/month. Cancel anytime

Authors (2)

author image
Brais Brenlla Ramos

Brais Brenlla Ramos is a passionate Architect, 3D artist, Unreal Engine 4 developer and first-time author based between A Corua and his place of work in London, UK. His passion for all things 3D-related dates back to when he was playing games as a child, experiences that fuelled his later studies in architecture and computer animation. His entrance into the professional 3D world happened at the same time as his studies were finishing, with initial projects undertaken in the field of architectural visualization for different studios. Since then, he's worked on many different 3D modeling and app development projects, first as a team member, and later as the Unreal Engine 4 lead developer at a company called AccuCities, based in London.
Read more about Brais Brenlla Ramos

author image
John P. Doran

John P. Doran is a passionate and seasoned Technical Game Designer, Software Engineer, and Author who is based in Incheon, South Korea. His passion for game development began at an early age. He later graduated from DigiPen Institute of Technology with a Bachelor of Science in Game Design. For over a decade, John has gained extensive hands-on expertise in game development working in various roles ranging from game designer to lead UI programmer working in teams consisting of just himself to over 70 people in student, mod, and professional game projects including working at LucasArts on Star Wars: 1313. Additionally, John has worked in game development education teaching in Singapore, South Korea, and the United States. To date, he has authored over 10 books pertaining to game development. John is currently a Technical Game Design Instructor at George Mason University Korea. Prior to his present ventures, he was an award-winning videographer.
Read more about John P. Doran