Reader small image

You're reading from  Unreal Engine 5 Shaders and Effects Cookbook - Second Edition

Product typeBook
Published inMay 2023
PublisherPackt
ISBN-139781837633081
Edition2nd Edition
Concepts
Right arrow
Author (1)
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

Right arrow

Making Translucent Objects

The previous chapter saw us dealing with multiple different materials, and even though they were all unique, they also shared a couple of important common characteristics: making use of Opaque Blend Mode and Default Lit Shading Model. This limits us a bit in terms of the effects that we can create, as not all of the objects that we see around us can be described using those settings.

It is now time for us to explore other materials that differ from the previous ones in at least one of those two attributes – so, get ready to talk about things such as translucency, refraction, and subsurface scattering. Knowing about those topics will help us create important materials such as glass or water, and this is the place where we will start looking at those types of effects.

To summarize, these are the recipes that we’ll be covering next:

  • Creating a translucent glass
  • Displaying holograms
  • Working with subsurface scattering
  • Using...

Technical requirements

As mentioned previously, this chapter will see us working with multiple material effects that are a bit more complex than the ones we’ve seen so far. In light of that, we’ll start to use some custom models, textures, and masks that will make our lives easier when it comes to demonstrating the different techniques we are about to see. Not wanting to leave you behind, we’ve made them available through the following link in case you want to download them: https://packt.link/A6PL9.

You’ll be able to find the complete project for this book there, granting you access to the same assets we’ll be using in the next few pages. All of those resources have been provided with the hopes that they can be used in case you are not able to author them, as we need access to specific software packages to create them (3D modeling tools, image editing software, and more). Having said that, feel free to use your own creations if you already know...

Creating a translucent glass

As indicated by the title of this chapter, we are going to dedicate the next few pages to studying, creating, and understanding some of the different types of translucent objects that can be created within Unreal. We are going to start with what is probably one of the most common translucent objects that I can think of: glasses. They are easy to create, and we will be able to explore different Shading Models and Blend Modes through them. Let’s jump right in and see what they are all about.

Getting ready

The look of the glass material we’ll be creating in this recipe can be achieved without the need for almost any additional assets – everything required is available as part of the Material Editor’s standard nodes. Having said this, the Unreal project we’ve been using so far includes the 3D model of a glass onto which we can apply said material, so feel free to use that resource if you want to. I’ve also included...

Displaying holograms

Now that we are a bit more familiar with translucent materials, why don’t we spice things up a little and see what other cool effects we can create with them? One that comes to mind is holograms – the ever-so-sci-fi, cool-looking effect that we can see in futuristic movies. This can be quite an interesting technique to implement, as not only are we going to have to deal with transparent surfaces, but also with animated textures and light-emitting properties.

All in all, we’ll also use this opportunity to introduce a few new features within the Material Editor, which will come in handy not just in this recipe, but in any animated material we want to create in the future. Let’s see what they are all about!

Getting ready

You’ll probably remember from previous recipes that we always provide you with the same assets you see on the pages of this book. This is, of course, so you can easily follow along. This time won’...

Working with subsurface scattering

The new material we’ll explore in this recipe is going to be wax. Wax! So, what is so interesting about it, you might wonder? Isn’t it just another opaque material, something we already covered before? Well, no! It’s a good example of the new Shading Model we’ll be using next, the SSS one – short for Sub Surface Scattering. This is different from the other ones we’ve seen so far, as light neither bounces completely off the objects onto which materials that use this Shading Model are applied nor does it go through them; instead, light penetrates their surface just enough that we can see its effects in the actual exterior, changing the color of the final pixels that are being rendered. It’s an interesting effect that affects multiple objects, such as the candle made out of wax we’ll see next to snow, skin, or thin opaque curtains. Let’s see how it works!

Getting ready

You can follow...

Using refraction in a body of water

Water is one of the most cherished materials in real-time visualizations, as shown by the continuous advances made to the materials that have tried to depict it over the years. We’ve come a long way from the days of early 3D graphics when simple planes and animated textures were used to represent it. Even though we can still use those older tricks, thankfully, we have more techniques at our disposal that can help us achieve richer results. Things such as refraction, displacement maps, tessellation, and caustics can add a bit of extra flair to our projects, and we are going to be looking at that first effect in this recipe.

Getting ready

More so than in previous recipes, this one will require us to set up the scene in a way that allows the effects that we are about to implement to shine. The first thing we’ll need is a plane onto which we can apply the water material we’ll be creating. Beyond that, we’ll also need...

Faking caustics with a Light Function

Nailing down the right look for a water surface can greatly increase the realism of our scenes, especially when dealing with tricky materials such as the ones that make use of translucency. Getting those nice reflections to show up, the refraction working in the right way, and the animation to feel believable is something we tackled in the previous recipe. On top of that, we can add an extra effect that is often seen in certain bodies of water: caustics.

This technique, which tries to mimic how the refracted envelope of light rays that the surface of a water body is projecting onto another object works, is difficult to calculate in real-time renderers. That being the case, we usually rely on approaches that try to fake the effect rather than realistically show it. We’ll be exploring one such method in the following pages.

Getting ready

Since this recipe is going to follow in the footsteps of the previous one, there’s nothing...

Animating a sea shader

Even though we’ve worked with water in the past two recipes, I couldn’t pass up the opportunity to talk about large-scale ocean shaders in UE5. I’ll admit it: this is one of my favorite subjects in computer rendering, and achieving great results is completely possible thanks to the methods we are about to see. However, this is not going to be a mere expansion of any of the previous topics. Instead, we are going to continue to learn new techniques and apply new concepts throughout the following pages. So, buckle up – there’s no time to rest in our journey!

Getting ready

There are going to be some big visual changes in this recipe but, despite this, everything you’ll need will be either provided by the project bundled with this book, included in the Starter Content, or part of the engine. Since we are going to be working on a large ocean material, it makes sense to move away from the familiar interior scene we’...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Unreal Engine 5 Shaders and Effects Cookbook - Second Edition
Published in: May 2023Publisher: PacktISBN-13: 9781837633081
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

Author (1)

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