♪ [MUSIC] ♪ [NARRATOR] Welcome to Unite Now where we bring Unity to you
wherever you are. [ANDY] Hey, folks. So this is going
to be a Unite Now presentation covering the Universal
Render Pipeline, specifically, evolving
your game's graphics using that Render Pipeline. This presentation
is going to cover a wide range of different use cases and scenarios
with the Universal Render Pipeline and a couple of example projects
that are going be available for you to download pretty much right now. My name is Andy Touch.
I'm a Global Content Evangelist at Unity Technologies and I'm based
in the Unity Copenhagen office. And a lot of my job is around
working with R&D team, Product Managers,
Product Marketing Managers, and getting to use a lot of
the features Unity's developing and build example projects,
content, tutorials, and things like that
to teach how Unity is used. These are a couple of topics
I'm going to cover. The first one is a quick overview
of the Scriptable Render Pipeline direction and ethos, and also
the Universal Render Pipeline. These are both relatively
new features in Unity's history. So I want to focus on these
and give a quick overview of what they actually are
and why you would use them, and how you can make
the most of the settings that Universal Render Pipeline
comes with out of the box. Then I'm going to uncover
a couple of other areas. One is the foundation,
such as the Render Pipeline Asset, this is the core functionality
of any project that uses the Universal Render Pipeline. The next is a recent feature, so this was released
last year in 2019, and these are Scriptable
Renderer Features and also Custom Passes. And these are very unique
and a very powerful way that you can actually inject
custom effects into your project
and Custom Passes. You can achieve some
very interesting game results and game effects by using these. The next feature I'm going to cover
is Camera Stacking and this is very new
but also highly requested by our community and our users. And this allows you to take
multiple cameras that are rendering and stack them and render
certain content to them, basically, compositing a frame
of multiple cameras as opposed to just one camera. And this is quite typical
of any game of such a scale where they would have
different cameras rendering different forms of content. Then I'm going to give a quick
overview about future features, so these are features
currently in development and also going to be going into development
very, very soon. So let's give an overview of
the Scriptable Render Pipeline. This is a core focus
of Unity's graphics team and is a C# rendering API Layer. What that means, from this diagram,
is we have Unity C++, which is controlling the core and various elements
of rendering of Unity. And up until this point,
we've had the Built-in Renderer, which has had both deferred
and forward supported, and covers a wide range
of different uses. And what we asked
a lot of developers is what they would want us
to focus on in graphics and a lot of them wanted to focus
on a couple of things. One, is custom rendering solutions, they want to be able to
extend the renderer, able to implement
their different concepts, different effects,
different results, different things
they want to achieve. And with the old Built-in Renderer,
that was a little tricky, partly because it was
a bit of a black box. And there was a couple of
different things which were quite old. So what we wanted to do
with Scriptable Render Pipeline is create a new
C# rendering API Layer, which allows you to extend,
dig into the source, which is available publicly. If you go to
github.com/Unity-Technologies/Graphics you'll be able to get the source of
Scriptable Render Pipeline and also the tools
that come with it. And users wanted to be able
to dig in and modify and customize, and basically be able to extend
and create their own different custom systems
and results. So it's a C# rendering API Layer
that sits on top of Unity and can be plugged into
and modified. In creating the
Scriptable Render Pipeline, we also wanted to offer our own
Unity-developed rendering pipelines with different purposes
and different focuses. One of these is the
Universal Render Pipeline and the other one is the
High Definition Render Pipeline. If you've seen some of our videos,
or keynotes, or blog posts, you've probably seen them
mentioned quite a lot. We're investing heavily in them
and they're going to be very core and integral to pretty much
any graphics feature being developed in the future, or currently developed now. Systems such as Shader Graph
and VFX Graph are built on top
of these render pipelines, and are hooked and directly
working with them, so when you download
these render pipelines, you have the Shader Graph system
and the VFX Graph system, plus lots of other tools
at your disposal. The Universal Render Pipeline,
which is what this talk will focus on, covers a wide range
of different platforms. It's built for cross-platform
development, for performance,
and it's also built so you can customize
and stylize the rendering, as you'll see later
in this webinar. The High Definition Render Pipeline
is a little bit different. It's more for the high-end devices, such as consoles
and high-end desktops. And this one is focused more on
realistic graphics and rendering, and if you've seen our
demo projects, such as <i>The Heretic,</i> <i>Book of the Dead, Fontainebleau,</i>
these were all built using the High Definition
Render Pipeline. So we have these two render pipelines,
they have slightly different uses. They do have some overlaps,
so Shader Graph and VFX Graph work with both of them
with some slight differences. And we also have other systems,
such as Post-processing Volumes, which also works
with both render pipelines in slightly different ways. So even though we're developing
these two different render pipelines, and they do have their own
different sets of features, there is some overlap
in functionality. So what specifically
is the Universal Render Pipeline? The focus covers a wide range
of different areas. It focuses beautiful graphics,
and we're not trying to dictate whether you want to create
a realistic game, or a toon shaded game,
or a 2D game, we basically want to expose a lot of graphics tools
and functionalities so people can create
any type of game that they want, or type of project. Also focused on performance. So it's a continuation of
the Lightweight Render Pipeline, which is being developed
for a while. And the Lightweight
Render Pipeline was, and I say was because it's been
renamed and re-set up to be the Universal Render Pipeline,
was focused at performance. How can we take these shaders
and this lighting system and post processing,
make them as fast as possible? And what we noticed is
a lot of users wanted to use the Lightweight Render Pipeline
and have that performance but also have
that wide platform reach and be able to create
beautiful graphics. So we've evolved the
Lightweight Render Pipeline into the Universal Render Pipeline
to cater for that wide range. And the Universal Render Pipeline
is going to be the foundation for future rendering in Unity. So when you start
a new Unity project, or if you want to just get started
with 2D, or AR, or VR, Universal Render Pipeline
is basically going to be the place that you want to start with. So it's focused on graphics,
you're not limited on what you create. You can create 2D pixel art
if you want to, you can create toon shading
if you want to, you can also create high-end
graphics and also performance. The next point is platform reach,
so Universal Render Pipeline works on any platform
Unity currently supports, and it's also key to extensibility. I'll show you a little bit
of that later on. Whilst the Universal Render Pipeline
offers a variety of tools directly in the box, you can also extend it
and modify it and create your own custom
scriptable render passes, and different render features,
and things like that. So we tried to create it so that
you can extend it and modify it. A lot of core systems
are updated automatically, so there is an upgrade tool,
so if you do have your project and you take it
from the Built-in Renderer to the Universal Render Pipeline, I will warn you,
it is quite a destructive process, and it's destructive in that
you're upgrading your project, and usually when you upgrade it, it's difficult to downgrade it
afterwards. So a lot of the materials
and pretty much all the core Vanilla Shaders that come with
Unity can be upgraded to use the Universal Render Pipeline's Shader libraries
and built-in shaders. However, manual upgrade is required for UsePass or Shader.Find. These are a couple of old APIs and actually some of the tools
and systems I'm going to show you a bit later on in this webinar
is going to cover some of these use cases. So there are some old APIs
which aren't currently supported in general out of the box, and you will have to manually
upgrade them to use Universal Render Pipeline's
new systems. Another benefit is it's supported
in Unity 2019.4 LTS, and that's Long-Term Support. And we're really core focused on
the Universal Render Pipeline and making sure that it is
as powerful as it possibly be, and covers a wide range
of different platforms and uses. As I mentioned before, it supports
a wide variety of platforms, pretty much everything
Unity supports right now. And you can see everything from
mobile all the way to consoles, such as Nintendo Switch,
PlayStation 4, Xbox, also to VR, such as Oculus, and also AR, such as Magic Leap, ARCore and HoloLens. So if you're developing from
these platforms, which I'd probably say
you most likely are, then Universal Render Pipeline
works on these systems, you can use it today. So before I jump into Unity Editor, I want to cover an example project
that's been developed for a while using the Universal Render Pipeline. And it originally was developed
using the Lightweight Render Pipeline but it's evolved with
the Universal name change and Universal evolution, and I want to cover
a couple of facts about this. So this project
is called "Boat Attack" and it solves a variety
of different problems. It's a project developed in-house, so it's developed by
one tech artist developer, and it's focused on
production-driven development. So it's a vertical slice of
a real-world boat-racing game and it's targeted at a range
of different platforms: desktop, mobile and consoles. And it was created to be
a complex test bed for a variety of new features,
so as we develop new features and systems,
using Universal Render Pipeline or Unity in general,
then basically, rather than a simple test, such as a spinning cube
or some bouncing spheres, it was developed
as a vertical slice. So we can implement
different features and systems and see how they work
in this project. It's useful as a learning resource,
both internally and externally. Internally, so our developers
can use it as a proof of concept in a test and be able
to iterate and experiment with different systems
in a game scenario, but also external because
the project is actually public and you can download it right now. And I'm going to share a link
at the end of the presentation. And it's supposed to be representative
of what a small dev team can produce. So there's one tech artist developer
who's created this project and he's embedded into
our R&D graphics team, and he has helped
from that graphics team and a couple of other people,
to be able to develop and maintain this project.
He's been developing for quite a while and it's basically evolved
over the years and over the months. So "Boat Attack" has
a wide range of features, both Universal
Render Pipeline features, so it heavily uses Shader Graph. It also has a wide variety
of different custom Shaders, such as Water,
and things like that. And it also uses some custom
rendering features, such as Planar Reflections
on the water so you can see the rocks reflecting on the water's surface. And basically it's a nice marriage
of a wide variety of different features and systems
Universal Render Pipeline has. It probably uses about 90%
of URP's features. It also uses a wide variety
of other Unity features and this is to test relationships
between systems, and also stability
and co-compiling. So as you race around the track, you have text floating
above the boat's heads, the boat's bodies,
as you can see in this GIF here. There's also physics being used,
the new input system, audio, it's basically testing
a wide range of different features, making sure they all work
very nicely together. It's basically one person
dogfooding example projects. He also uses Vanilla Packages
that are not customized or modified and Vanilla Unity Binary
so it's using 2019.3 and there's a variety
of different branches, so it's not a custom
build of Unity, it's being developed
basically in-house using the tools that are available to you today. So it's using public custom tools
for gameplay and public custom tools
for utilities. In terms of Shaders,
they wanted to test a wide range of different uses and see
how much control they can have. So Shader Graph is used for
a wide variety of these rocks and different elements,
and including the boats. Geometry Shader is also used,
Compute Shaders is as well for water and things like that,
and they're highly complex uses, they're not something basic,
such as a gradient. They're basically Shaders
that cover wetness of rocks, or displacing the water, or having tessellation
as you move the camera around for the water and the environment. So the demo usage
is more scenario-based for a game like this. And if I jump out of these slides and jump over to Chrome here, what you'll notice is that
there's already a blog post written by the developer, Andre,
on this project. And as I scroll down, he's covered
a wide range of uses already, which I won't be going into
specifically into this demo. And you can obviously
read this blog post and learn from his different uses
and download the project as well. He also goes into great detail how the Planar Reflections
are implemented, and also how the Caustics
are implemented for the water. So if you're curious on how to
create water for your projects using Universal Render Pipeline,
you can download this project, extract the water and extract
the knowledge for your own uses. So I'm now going to
jump over into Unity and show you the project
in the Editor. So the project is an island
and it's a single race track that goes around this
cluster of rocks in the middle. Now, if I enter Play,
you can basically see that there's a lot of different
systems and features being used. Of course, got to turn this off. So Timeline is being used
to sequence using Cinemachine, this sort of camera intro
like in a typical racing game. Some boats have been spawned
and now I can control it using W, A, S, and D. We're also using UI to render
a mini map, some lap times, and there's just lots
of really pleasing things that are being rendered
in this project, such as the water,
these checkpoint gates, the rocks, and all the different
environment pieces around the outside, including the cloud Layers here. And if I leave Play mode,
let's have a look at how a lot of these systems
are being controlled in Assets. So when you have the
Universal Render Pipeline installed, and that's installed
from the Package Manager, you basically get these
Render Pipeline Assets, which look something like this. You create this
Render Pipeline Asset, which you can do
from the Project window, so Project > Rendering > Universal Render Pipeline >
Pipeline Asset and this gives you a wide range
of different features and systems that you can turn on and control. For example, here, I could disable
and re-enable HDR mode, I could turn off Anti Aliasing, I can also disable
Shadow Rendering in the project. You'll notice that the blue that pops up
is the Shaders refreshing. I could also control things
such as Shadow Resolution. If I get up close, I can switch it
and lower the Shadow Resolution. You get a lot of
global settings and effects that are all available to you here. And the way that "Boat Attack" works
is underneath Project Settings, and inside Quality, you'll notice that there are
three quality settings: Low, Medium, and High, and this has been in Unity
for ages, this is nothing new. But when I switch between
Low, Medium, and High, just wait for
the Shaders to refresh, as you can see, they're refreshing
in the bottom right-hand of the Editor. If I switch to Medium
and then High, you'll notice that the Shadow quality
and Shader quality is changing, and that's because
each of these quality tiers has a Render Pipeline Asset slot
so you can actually set up these different
Render Pipeline Asset settings for different types
of quality settings. So we can go Low quality,
Medium, and High, and set these
to different platforms. So you can not only create
a Render Pipeline Asset to control your shadows,
control your lighting, you can also hook this into
Unity's Quality setting system. Another interesting part
about "Boat Attack" is that a lot of the lighting
is actually real-time. If I select this Cameras option here
and move this Time of Day Slider, you'll notice that a directional light
will rotate around the world, basically casting
different types of lighting. So we can go from night time to dawn, to the middle of day, and then all the way
around to dusk again. Notice all the lighting is adapting
and changing using these settings. So using the
Universal Render Pipeline and targeting mobile,
and things like that, you can not only use real-time
lighting in different setups but you can also adapt it
and change it in your project. You don't have to necessarily
bake all the time, you can actually have the power
of using Directional Lighting and still get impressive
graphics and visuals. Another key component
of "Boat Attack" is Shader Graph. So Shader Graph is used to create and design
the different environments. So if I take this rock
and then move it around, you'll notice that as it moves
in and out of the water, this water line is forming
at the bottom. And as I move the rock up,
or move it around, this Triplanar Shader
is basically calculating that grass should be rendering
on top of the rock. So as I move
the rock's position up, the grass in then going to
adapt accordingly. So using Shader Graph,
the one developer was able to create a couple of these rocks
and then basically set dress the whole environment
and be able to litter the rocks all around to create this level without having to
retexture them constantly. You can use Shader Graphs
to create some really interesting, powerful effects. The next thing I'm going to cover,
before I jump into Scriptable Render Features
is the Water. So the Water is using a custom system
built for this project. But you can extract it
and put it in your own projects if you're using
Universal Render Pipeline. The Water has lots of
different settings and tools. You can switch between
Vertex Offset and also Tesselation for the Water Geometry Type. You can switch between Cubemap
for the reflections, so it's a pre-baked Cubemap,
doesn't look as nice as assigning a Reflection Probe,
or even Planar Reflections. And it's using
Universal Render Pipeline's features to be able to have Planar Reflections
as the camera moves around. So notice with this rock here,
we've then got some reflections that take place here,
and you might be able to notice it if I play around with
Water Visibility. So if I lower the Water's Visibility,
and tweak these settings, you can notice that we have
these Planar Reflection rocks that are happening, and also
these clouds in the sky here. The Water also has some settings
for not only how it renders or what it's hooked into,
in this case, Planar Reflections, but also things
like the Wave Settings. So I can actually adjust
the Water's Swell amount, set that back. I can also change the Swell Height,
so how high the water is. You basically get a lot of
interesting tools and systems to be able to allow you to control
how the water is rendered and how the water is rippling
throughout the environment, and how it intersects
with the edge wall as well. There's lots of
interesting things to dissect with this Water Shader,
and this Water System, and in the blog post
I showed you earlier on, and I link at the end
of the presentation, it goes into more
specifics and details on how a lot of these systems
are created and used. I'm going to set the lighting
back to something a bit more middle of the day, and then I'm going to
switch back to my slides. So I'm going to cover
the first features of systems and that's Scriptable
Renderer Features and Custom Passes. Universal Render Pipeline
was designed with a render flow with modularity in mind. So with modularity,
it means that you can have the typical Rendering Loop
and Camera Loop, as you can see here, such as the beginning
of the frame rendering and the end of the frame rendering, and all the steps in the middle,
such as Culling. But you can also extend it,
you can inject your own Render Passes
and additional features. So rather than it being a black box
and you can only inject, say, post-processing, you can also
hook into Camera callbacks and access the camera data
and be able to inject them, and basically add different effects
and systems into your projects. With these render effects,
you can also set up, using camera data,
custom rendering. For example,
you can create an effect that renders after the Opaque Pass
but before the Transparent Pass. Or you can create an effect
that uses the Depth Pass data and then applies it in a Water Pass
or a Caustic Pass. And that's basically
kind of what "Boat Attack" is actually doing
to render the water. It's created with modular rendering and you can extend
the Universal Render Pipeline without source modification. So you can actually do this
by downloading the Universal Render
Pipeline Package and setting your project to use it
and then straight out of the box, you can then start to extend
the Universal Render Pipeline using the Scriptable
Renderer Features. You don't have to
then modify the source. Of course, you can modify
the source if you want because we've made it available. You can inject in custom effects, use data from the Camera Renderer,
and these are all viewable and debuggable
in the Frame Debugger. And the Custom Renderer Asset
is built up of a couple of things. One is the Renderer settings,
such as Layers, and things like that. And the other is
the Render features list. So I'm going to jump over
to "Boat Attack" and show you a couple of different
systems and tools. So if I go to the
Render Pipeline High Asset, and let me just check
that I'm using this one. So I'm selecting
the high quality tier, we're using the PipelineAsset _High, which means a lot of systems
and effects are enabled. What you'll notice at the top here
is that we have a Renderer List. And we have one
CustomRenderer_Normal and another which is
CustomRenderer_Retro. I'm just going to remove
this Retro one for the time being. Removal of the Default, okay. I'm going to switch over to it
and I'm going to remove that. So what you'll notice is that
I have on this Renderer List, just one CustomRenderer, and I can select
this CustomRenderer, and on this CustomRenderer
you can notice that we've got a couple of different settings, such as Filtering
of different Masks, there's Transparent Receive Shadows, Stencil Overrides, and a list here
of Renderer Features. In this case,
the Water System is using this Scriptable Render Feature. The Water System is using
this Scriptable Render Feature to be able to render
the Caustics, and the Depth, and all sorts of different
features of the Water. If I actually switch in this debug
to the Caustics, you can see how the Caustics
are actually being drawn underneath the Water Layer
and how they're being calculated. The blog post I showed you
also has a link to a video which goes into a lot more detail
on how these Caustics are created. If I select this Water Effects here, you can notice
that it shows also the edge that the Water is intersecting
with the environment. And if I disable
this Renderer Feature, notice the Water
is going to be pretty flat. It's basically just a Mesh that's then having noise
pass through it, and is rippling. But as soon as I turn it on,
you can then enable and disable this Water System to then
add this Renderer Feature into your Renderer. Now, if I go to this
PipelineAsset_High, and it's using
this CustomRenderer here, maybe I want to have
a different CustomRenderer, one that basically has
different settings to this one that's set up here.
So I'm going to create this now and I'm going to create
a Retro Renderer which is going to show how
to do things like toon shading, and outlines,
and a pixelated effect, basically using the same project. So if I go into
the Rendering option, Universal Render Pipeline,
and create a Forward Renderer, and let's call this
"CustomRenderer_Retro." And we bring that back up
so everything's neat and organized. So I've now got
this CustomRenderer. And if I go into my
High PipelineAsset and add a new renderer, I can assign
this CustomRenderer to it. And if I set this as Default,
notice the water goes back to how it was. So you can switch between
these different CustomRenderers and be able to switch between them, not only in this global
Pipeline Asset Setting, but also on Cameras themselves. So if I select this CustomRenderer,
basically the water is not looking as nice as it did before because it's not using
that Water System Feature. So I'm going to re-add
to that Water System Feature. So it's going to look nice again. I'm going to set up
the name for this pass. I'll show you what this means
a bit later on. Notice that we also get
some extra settings, such as the Caustics
and how they're being rendered into the Scene
using this Render Feature. And what you'll notice here is
I can add multiple Render Features. So I've already got this
Water System Render Feature, but underneath here,
I can then add other ones, so I'm going to add
a Blit Render Feature. This Blit Render Feature
is going to be a Toon Outline. Here, I've got the Blit Material,
so I'm going to search for one, and I'm going to use this outline that I've already got pre-set up. And this is using the Sobel outline
technique with a Shader. And if I now... one sec. Where was it? Here. What you'll notice is that I've got
some different settings here, and also I've got some settings
to control on this material, so I can actually set
the outline Thickness, and also the Intensity Depth. So notice that everything has
this thick black outline around it. And I can also preview
what this actually looks like, so you'll notice here,
got a little toggle on this Shader that allows you to then specify
render only this Toon Outline. You might have noticed
that this Toon Outline is only being applied to
opaque objects, such as rocks, the buoys,
the plants, and things like that. It's not actually being applied
to the sky, the clouds, which are just billboard cutouts,
or even the water. So if I go back to that
Renderer Feature that I just added, you'll notice here that we can
choose different events. So we can actually choose
when this is actually rendering, or kind of inject it
into a specific point. We can say Before or After Shadows,
Before or After the Pre Pass. Currently it's rendering
After the Opaque objects. So if I do this
After rendering the Skybox, it's going to factor in the Skybox
into that outline calculation. But maybe we want to include,
for example, the Water. So let's do
After Rendering Transparents. Notice, now, in this Debug view
we can notice it's rendering all the transparent objects. Now, if I go back to my outline
and turn it off, let's have a look
and see what it looks like. And notice that we've got
some nice outlines that are currently being rendered.
I can increase the Intensity, increase the Thickness. Basically, we can now have a nice
Toon Outline shaded "Boat Attack." And notice that this is basically
injecting this outline effect without me having
to spend too much time in changing the source code
or writing an effect or a system. This is an outline
that's available to you, and I'll have a link
for the repository at the end of this presentation. And you can see it currently
being rendered here. Now, the power of
these Renderer Features is you can also enable
and disable them, so you can see
what they actually look like. So let's turn off the Water
and turn off the Toon Outline. So you can toggle them on and off,
and you can also add more than one. So I've got here this Toon Outline
that's being applied, so another thing to make this game
look a bit more retro and a bit more toon-like
is to add another Blit. Let's call this
the "Toon Posterize." And let's go to
my Toon Posterize Pass. So what this is now going to do
is it's basically going to take this material,
which is using a Shader Graph, and it's going to apply a
Posterize effect onto the renderer and it's basically then
going to Blit it to the screen. So notice that these buoys now have
a thick black outline, but then as I change
this Posterize effect, you can see that it's adding
different banding onto the buoys. So I can actually toggle
on and off this effect and actually see how much
it's applying to our Scene. It's actually applying quite a lot
and I can turn off the Toon Outline and re-turn it on. Let's check the Game view.
Okay, it's actually pretty dark so I'm going to go back
to the Toon Outline and lower down the Intensity. And you might also notice
that the Posterize is not actually
being applied to the water, and again, that's because
it's Rendering After Opaque. So we can actually set this
to Render After Transparents, so now the water is being affected into this Posterize,
even the Caustics. So if I go back to
that Caustic effect, I can actually see
the Caustics being affected by this Renderer Feature. The point I want to
drive home with this is that using these
Renderer Features, you can add different visual styles or add
different visual customizations and they all work
very nicely together. So here I've got three,
the Water System, which comes with "Boat Attack,"
a Toon Outline, which is doing a Blit, Rendered After Transparents,
and Toon Posterize, which is Rendered
After Transparents too. And the last one I want to add
is another Blit and this one is going
to be called "Retro Pixelation." And let's find that,
so this is already in the project. This is basically going
to pixelate all geometry. So as you can notice here,
we've got this nice, weird, retro pixelated effect. People seem to be very into doing
this kind of technique and style. I'm a big fan of<i>
Return of the Obra Dinn,</i> and games like this. So it's pretty cool to be able to
apply this effect into this project. And notice it's Rendering
After Opaques so it's not actually
applying to the water, so I can say, actually
Render After Transparents so now the water is getting
this pixelated effect with it. But maybe I don't want to do that,
maybe I want the water to be a bit higher detail
so let's just do Rendering After Opaques. So we can then basically customize
how our Renderer looks. So if I now go into Play mode, let's actually play the game
and see what it looks like. So we got the camera
flying over the top, we've got these Toon Outline, Posterization, Pixelation effects,
and things like this. Okay, it's looking
a lot more retro, for sure. Let's actually play with
the Outline a little bit. So let's change the Line Depth. And what you can notice is
that I've now got this game setup using these Renderer Features
being applied into the Scene. Actually, I feel like this
should be coming out of the wall. Actually, no,
After Rendering the Opaques. And I can switch back and forth. So if I go and switch back
to the original CustomRenderer, so this is the one with just water, switch back to the pixelated one
that's got the Toon Posterize, notice that basically you have
that control of being able to switch between these at runtime. So we can switch
between these effects and switch between these different
Renderer Feature Stacks and see what they look like
all within runtime and all within the Renderer. Now, the other thing
I want to show you is you can also add
more custom renderers. So I've got one already pre-made,
which is a Fog. This is a Gradient Fog
created at Unity by a developer, and notice that we're using
the Water System here, but it's a Gradient Fog... Scriptable Render Feature
that's been implemented. So here we can set things such as the Start Distance of the Fog, we can set the End Distance. It's just a really nice way
of being able to show you that you can actually add in
your own features and add in your own
rendering tricks and techniques without having to
extend the Renderer or wait until Unity
adds in the feature. You can say, "Hey,
I want to create this Gradient Fog and then inject it
into my project." I can actually say, "Let's do this
After Rendering Opaqes." Okay, that actually looks horrible. But you can see
that the Gradient Fog is being applied
to the opaque objects, and not necessarily the water. That actually looks quite cartoony,
which is kind of cool. So let's go back.
That Fog, I'm not too sure about it being there so let's
Rendering After Transparents. Now, if I go back to my
Render PipelineAsset and switch back
to my Retro Renderer, let's go to the Game view, and I've got this beauty shot
that looks like this, let's see what the
Frame Debugger looks like. So if I now open the Frame Debugger under
Window > Analysis > Frame Debugger, strategically named, and then enable it,
what you can notice is that we've got a couple of
passes, including new ones. So I've got here
a Render Water FX Pass, which is basically being added. You can see
it's also being added here. We've also got
the Render Opaques Pass. We can step through these passes
and preview what they look like. So notice that there's a couple of
new passes in here which are being added from this
Scriptable Render Features here. So we've got the Toon Outline Pass,
this Posterize effect, and we've also got
the Retro Pixelation, which is being applied
after the Opaque Pass. So we have different settings that can be previewed
in the Frame Debugger, and also if I now switch
one of these passes, so let's say, for example,
I turn off the Posterize Pass, the Posterize Pass then disappears. If I switch off these different
Gradient Passes, notice that these passes
are no longer being added. Now, let's turn on the
Posterize effects Pass, notice it's being rendered
after transparents. But if I then move this back up
to After Rendering Opaques, it then shuffles up the stack. So we can see from the beginning
of the Camera Render, all the way down,
we can see Render Opaques, then render the Posterize,
then render the Skybox. So as you switch these
Scriptable Render Features to different locations
in the Render order, in these different effects,
you can notice them switching up and down
in this Frame Debugger and you can also preview them. So let's switch back to my slides. So that's a quick overview
of the Scriptable Render Features and the system
and the Custom Renderer setup. Now, Universal Render Pipeline
also comes with a 2D Renderer. This is an extension
of the Universal Render Pipeline and it's a Custom Renderer, and it allows you
and it uses this system, so where I created
that Custom Renderer and also the Fog and applied it
to that Renderer List, you can also set up
the 2D Renderer. This unlocks extra features, unlocks features
such as 2D lights and shadows, Sprite Shader Graph,
2D mask system, and it also uses some
Universal Render Pipeline features, such as post-processing,
and also Shader Graph. And you can see
on the right here, at the top, you've got the "Robbie Swifthand
Platformer" project, which is using heavy amounts
of 2D lights and we have here, The "Lost Crypt" project,
which is available as well, which uses wind to move the trees, and also lights
coming through the trees, and lots of very beautiful things. So in using
the Universal Render Pipeline, and if you've been watching
up to this point thinking, "Oh, it's not really for me,
for 2D games, or 2D projects," you can also use these new
2D graphics features with the Universal Render
Pipeline's 2D Renderer to make your games
really standout and shine. The next system I want to
talk about is Camera Stacking. And Camera Stacking
is a highly requested feature. In fact, I think it's probably
the most requested feature alongside Screen Space
Ambient Occlusion. It allows you to overlay
multiple cameras and this allows you to do
layered frame compositing, meaning that you can
break up your end frame into multiple different cameras that are rendering
different forms of content, gives you individual
camera controls and it allows modular
game development so you can have someone
working on the first person gun, while someone else works on
the camera rendering the UI. And it allows the combining
of systems. So each Camera Stack
can use different Custom Renderers so it can use different settings
for those Scriptable Render Features. You can also set up different
volumes per camera as well. And I'm going to jump over
to this project and demonstrate how this works. So here I have a simple Scene
and if I enter Play mode, I can then walk around
in first person and see these dropships
from different angles, just like a typical
first person game. What's not typical about this
in a first person game scenario is there are no items, I don't have
a Gun rendering in front of me, or a Cockpit, or UI,
or something like this. This is where Camera Stacking
comes into play. Now, what I could do,
is I could go to the character, which is just here,
who's obviously invisible, and the character looks like this,
expertly modeled. And we could take this Camera
that's been rendered and we can put a bunch of stuff
right in front of it, but then you're gonna have
clipping issues, and it's going to be
a weird workflow and your artists are not
going to be very happy, especially the UI ones. So we want to use Camera Stacking
to be able to render content in front of this Camera,
or as an Overlay. So if I select this Camera that's being used
for this First Person view, and go to the Inspector, you'll notice that there's a new
Render Type that's called Base, and this will automatically
be applied if you're using the Universal Render Pipeline. Now, this is a Base Camera, meaning that you can add
other Overlay Cameras. So I've got up here, a Cockpit,
which has already been set up to be rendered as an Overlay. This Cockpit is 3D modeled by the same person
who created "Boat Attack" so he's very talented,
very multi-disciplined and skilled, and with this little Cockpit
we want to replicate this as kind of like a mech walker
and render this, obviously, in front of this
Camera's view here. Now, notice that the Cockpit
has a little Cockpit Camera. And this is using
Render Type of an Overlay and this has all the similar settings
that you'd expect a Camera to have, such as Field of View,
Projection Type, Clipping Planes,
and things like that. And it's rendering only things
on the Cockpit Culling Mask, which is this base structure
and things like this. So all these elements are rendered
on the Cockpit Layer Mask. Obviously, it's not currently
being rendered in front of our camera here,
so we want to set this up. So if I go to this Cockpit Camera, notice it's a Render Type
of Overlay. If I go to the First Person Camera,
which is this one which I'm currently rendering
the Scene with as I walk around, at the bottom you notice
that there's this new Stack option and the list is currently empty.
So if I click this, I can then add the Camera Cockpit,
and this basically scrapes the list of Cameras
from your Scene. This is now going
to render as an Overlay on top of our first person view. So we've now got this Cockpit
in place rendering statically. Well, not rendering statically,
it's being rendered here by this Camera, but rather than
being a render texture, it's now being rendered as an Overlay
on top of this Camera. The cool thing about this
is we can now, for example, select this Cockpit Camera
and adjust things, such as the Field of View. Okay, that's very Kubrickian, I guess. We can also set up
different things like does this include Post Processing, such as Bloom
that's currently being applied, does it use Occlusion Culling,
does it render Shadows or not. And one thing you'll notice
is that with Post Processing enabled, as you can see here, we can also set up
different Volume Masks. So this has got
a Volume Mask for Cockpit and I can adjust the Intensity
for these little glowing buttons, it's going to apply
to this stacked Camera. You can set up different
Post-processing Volumes for different Camera Stacks. So I'm walking around in my Scene and there's a couple
of things missing. One is that as I look up and down, notice that the lighting
is not really adapting or changing to this tilt,
it looks a bit static. I mean, this could be
an image, technically. So what we can then do
is if I go to my Cockpit, this is not actually a
Universal Render Pipeline feature, I just think it's very helpful
for situations like this, is we can actually use the
Constraints components, in this case Rotation,
we can constrain the rotation of this Cockpit
to that of the FPS Camera. Because I still want to have
my Cockpit up here so I can have my
3D modeler and lighting and texture artist,
and things like this, set up all the Cockpit
rendering off screen, but I don't want it
to be following my character. So with this active now,
what you'll notice is that the Cockpit now tilts. So let's actually split this. So notice as I move around, as we zoom in here a little bit, as I look around in my bottom view, notice that all the lighting
is adapting onto this Cockpit. But then it's still being rendered
by this Camera Stack here, floating in the air. Very handy. So that's got a little
Cockpit in place here. So let's actually add UI. So UI is obviously another
massive part of any game, or any interactive project. And here I've got this
Danger Shield Health UI that's being rendered
to its own UI Camera. This Canvas is currently
a Render Mode of Screen Space - Camera,
that's a bit of a tongue-twister, and it's being rendered by
this Camera UI. We want to stack this UI as well because we have the Cockpit Camera
and we also have the UI Camera. So if we go to this UI Camera, notice it's using
a Render Type of Overlay. And if I go to this FPS Camera, we've already got
this Cockpit Camera here, let's apply a UI Camera, and it's now being stacked as well. So we've now got this
little Cockpit walking around with Shield Health
Danger warning sign with some particles
being rendered to that UI Camera, and it's basically
being stacked as well, including lighting, adapting,
and using the lighting from the same tilt
as the FPS Camera. So we've now got
our Cockpit and our UI being stacked on top
of our First Person Camera. And of course, as you have
these different stacks, you can then rearrange them.
So if I then move the Camera UI up in the stack, it's now
being rendered behind this Cockpit so we're rendering
the UI Camera first and then we're rendering
the Cockpit Camera. That's obviously not realistic
but I want to switch these around just to show you can
move these stacks about. Now, if I select this Camera UI, notice that it's got
slightly different settings. So for example,
it's not using Post Processing, we're currently using
Panini projection to be able to warp the Camera, but we don't want
to use this on the UI, so we can turn
this Post Processing off. We're not Rendering Shadows to the UI
'cause that doesn't make any sense. We can also do different settings
such as Field of View. So let's make the UI
really stretched. It basically looks like
the Star Wars opening scene now. But you basically have these
different Camera settings per stacked camera,
which is very powerful and very useful
in a production like this, or in a scenario like this. The other thing I want to show you is kind of like Universal
Render Pipeline's system similar to UsePass and GrabPass. So if I enable this Screen, and this Screen is basically
just a Mesh that's being rendered inside the Cockpit,
and as I look around, I've then got this little Screen with these different panels,
which are glitching out, and these are all glitching
using Shader Graph. But what you'll notice
is that Shader Graph is actually taking the image
on the other side of the Screen, or the Camera's render,
and is then applying this glitch effect on the left, this little CRT scanlines
on the bottom, and this more black and white,
striped effect on the right. And if I go down to the Materials
being used for this Screen effect, I've also got an Invert Colors,
so I can invert the colors for the middle things,
so it's basically taking the image and it's manipulating it some way,
this is quite common for a game where you have a cockpit
or some kind of screen where you view the world through, you want to apply
these different effects. This is done using... Basically, you would use
UsePass and GrabPass before, to create an effect like this, if you want to blur
the middle image, or take the middle image,
or adjust the Seeds, or invert the colors,
and things like this. UsePass and GrabPass
aren't in Universal Render Pipeline but we can use different
other tricks and techniques. So if I go to the Renderer,
which is that RenderPipelineAsset, notice here we have an option
called Opaque Texture and this is turned on. What Opaque Texture does is
it allows you to grab the objects being rendered in the Opaque Pass and then use that texture
for different effects. And if I select that Screen, notice it's using a Shader Graph,
so if I now open this Shader Graph, and it will open. I won't go through every node
because that will probably take quite some time. But if I go to the... Whereabouts is it?
Scene Color, okay. So the Scene Color node,
what this does is this uses the Render Pipeline's
Opaque Texture, which is basically drawing all
the opaque objects into a texture, in the Opaque Pass. And Scene Color and Shader Graph,
this node allows you to get that UV and then output that color. So you can use it like an X-ray
or like a screen fade, or in this case,
these very glitchy effects. These Screens are using
that Opaque Texture and able to create
this glitchy effect without having to actually
write any code at all, you basically can use this
Shader Graph Scene Color node and there's also
a Scene Depth node, and basically be able to create
these weird glitchy effects using Camera Stacking and using all these different features
and systems together. Of course, you can do it
without Camera Stacking but this shows that you can render the opaque objects
of the main camera as a Texture and then apply them
into this other stack. So this end frame
is basically a composition of lots of different
features and tools. Now, this is all pretty cool
but another thing that a lot of people ask
and how to make, is First Person Controls. So here I've got this little
First Person Gun that's being rendered
in the Scene world. And this First Person Gun
has a Camera Gun Renderer. And you can see here
in this preview that it's basically then
just rendering the Gun and the Skybox behind it. Now, similarly, what we can then do
is go to the First Person Camera. I removed the stacks from this
because I left Play mode, and then I can add
the Camera Gun Renderer. So we've now got the Camera Gun
basically rendered as a Camera Stacked Overlay. A lot of people ask,
"Why would you do this?" And it's basically so that
you don't clip through geometry because now I'm inside the dropship,
I didn't add Colliders, and what you can notice is that
the Gun is still being rendered on top of the ship,
as opposed to clipping through it. At this point, the nose
would probably be, as you go down, the nose of the gun would probably be
directly inside the dropship and that's not actually
accurate at all. We have this Gun Renderer
that looks like this and notice it's automatically not clipping
because of the Camera Stack, but we could also get
some extra control. For example, you can change the Field of View
of this Gun Renderer. So I can make it a more zoomed view
and I can also control things such as does post-processing effects
like the Panini projection, also affects this Gun Render here. Another super cool thing you can do
with Camera Stacking is you can actually choose
these Custom Renderers and apply them
to different cameras. So remember when I showed you
the Retro Renderer and then the Gradient Fog Renderer,
it's basically the same concept. We have this CustomRenderer_Default, which is actually pretty default,
it hasn't got anything turned on. We've got this
CustomRenderer_GunOutline. If I open up the GunOutline,
it's going to have its own Scriptable Render Features
to render an Outline Pass on the gun, specifically. So if I go to the Gun Camera
and then choose that GunOutline, notice it now has this outline
and this would be similar to a game like <i>Overwatch</i>
or maybe even <i>League of Legends</i> where they have an outline
outside around the characters. So you can use Camera Stacking, we've got a stacked
camera of this gun using its own CustomRenderer. Then we've got the Main Scene using
a different CustomRenderer as well. So you can combine
Scriptable Render Features with Camera Stacks and combine them
in different ways like this. And the other really cool thing
you can do is different effects that allow you to use
these different Camera Stacks and use these
Scriptable Render Features for quite common gameplay scenarios
or graphic scenarios. So I've got this terraformer, or three terraformers actually,
and these are all enemies. And currently, they're quite big
compared to the dropship scale. And these enemies
are currently just standing here, and I can't see them
through these dropships, but quite a common aspect
of any kind of first person shooter is being able to see
your teammates through walls or maybe you get an ability
that allows you to see your enemies
through the walls. And we can do this using
Scriptable Render Features as well. So we're not going to apply this
to the GunOutline because the GunOutline
is just basically using your Render Objects Render Feature,
as you can see here, Render Objects, and it's basically
applying this Toon Outline to anything with First Person
Objects on the Layer Mask. So we're going to go to FPS Default because we can assume
that anyone using the FPS Camera is going to want to render
these enemies. And I'm going to use
the same Render Objects Scriptable Render Feature. So if I enable this Render Object's
Scriptable Render Feature, what you'll notice
is it's going to, after Opaques, render in the Render Queue
of Opaque, go to the Layer Mask of any enemy and render using this
Enemy XRay Material if the Depth Test is Greater. So notice you can now
see these enemies with this weird glitchy effect
I've created in Shader Graph. You can see them through the walls,
they're always being rendered because it's being rendered
when the Depth Test is Greater than these dropships. So we can see them through
the walls and this is pretty cool. So we've already got,
using Scriptable Render Features, we can already set up
First Person Shooter with this kind of
graphics functionality. Obviously, this doesn't really
make much sense when the X-ray seeing them
through the walls is actually rendering
on top of the character. Although, I think it does
actually look pretty cool. We've got here an Enemy Shaded Pass
Scriptable Render Feature. So what this does is it allows you
to re-render the enemies on this Layer Mask of Enemy, so now we're basically
re-rendering the enemies. So now if I look
through the dropship, if the Depth Test is Greater,
it renders the XRay Effect. If the Depth Test is not as great, such as we can actually see
this object on the Enemy's Layer, we can then see their Shaded Pass. And of course, with all
these different things in play, if I open up the Frame Debugger, and Enable, you can see here we have
the Enemy XRay Pass, we have the Enemy Shaded Pass,
we also have the Opaque Pass, the Rendered Opaque Pass,
the Transparent Pass. We've basically got
all these different passes, these custom passes,
and things like this, all basically viewable
in the Frame Debugger. So you can actually see
when they're being Shaded, or if they're being Shaded at all. So we have the Opaque Pass,
then the XRay, then the Shaded,
and then the Skybox Pass. So we can view all these
Scriptable Render Features and all these different
Camera Stacks and see them all
working together very nicely in a couple of different scenarios
and a couple of different ways. So I jump back to my slides. So let's talk about the future.
Those things that I showed you, Scriptable Render Features
and the Camera Stacking, and these Custom Render Passes,
and things like this, are all things that are available
to you right now. I was using 2019.3 for all of them and all those examples
I share in a slide in a second. I'll link you to the GitHub repos
and you can download them, and there's a lot of other
interesting tools and features in those projects. Let's talk about the future,
let's talk about some things that are coming out soon. So one thing that's under
heavy development is Screen Space Ambient Occlusion,
or SSAO for short. This is another
highly requested feature similar to Scriptable Render Features
and also Camera Stacking. And as you can see
on the right here, we have a GIF that loops through
this nighttime Scene, this is not using SSAO. and we also have
this half shaded Scene. This half shaded Scene is using
SSAO on the right in "Boat Attack." This is going to be implemented
as a Scriptable Render Feature, just like the Water System,
just like that Toon Outline, the XRay Effect,
and things like that. And you're going to have control
over global settings, such as how much is being blurred,
or how wide it is, and the intensity,
and things like this. It's a very cool
and very powerful system. Also working on deferred renderer. Currently, Universal Render Pipeline
uses a forward renderer and deferred will be an option
that's going to be available in a future release.
And this nighttime Scene is using an early version
of that deferred renderer. As I said earlier in this webinar,
we use "Boat Attack" quite heavily to test or use as an example project
for new features and things, so that's why you see SSAO
and also the deferred renderer in use with this project there. We also have Shadow Mask
support being added so this is going to add extra
features and functionality for Shadows,
as well as a Clear Coat, which isn't being applied
in this GIF at all on the boat. But Clear Coat is quite
a common request for things like shiny materials
or more glossy surfaces, such as on cars
or vehicles like that. Also Reflection Probe improvements, such as Blending
and also Box Projection and that will allow it to bring
Universal Render Pipeline up to more graphics feature parity
in the Reflection Probe areas to the Built-in Renderer
and also HDRP. And also Shadow improvements.
Masks I've already mentioned but also things
such as Distance fall-off. So pretty much all the features
that we have released recently, such as Scriptable Render Features, Custom Render Passes,
Camera Stacking, Screen Space Ambient Occlusion,
and all the things we're working on are all heavily requested
from our community and our users. You are the bread and butter
of why we create all these tools and example projects. And we want to drive
Universal Render Pipeline and Unity in general, to align more
with what you want to achieve and how you want to achieve it. I can also say
that we're also working on some exciting new example projects. So we already have
the "Boat Attack" project and the other examples I showed, such as the Cockpit demo,
and things like that. But we're also working on
some new Universal Render Pipeline, both 2D and 3D examples,
which are going to show other different types of scenarios,
other different types of uses. So we're heavily invested in
the Universal Render Pipeline and its future,
and also in making it the most powerful render pipeline, not only for desktops,
but also for mobile, AR, and VR. And consoles, of course. Here are some links
to the example projects. "Boat Attack"
has a GitHub repository, which you must clone
because it uses Git LFS. Everything I did in the webinar,
such as Gradient Fog and the Posterize effect, and the Retro effect,
and things like that, is in this branch of
demo/webinar-unitenow so you can go and download
that branch right now using 2019.3. Or you can just download
the master of the year repository, just to get "Boat Attack"
and dissect how it looks, or dissect all the different
systems and tools it offers. We also have
Universal Render Pipeline examples. So we have a GitHub repository
which has a wide variety of different examples
for you to use, such as the Toon Outline,
the Gradient Fog example, the Cockpit Camera Stacking demo,
First Person Render. Everything I showed there
is in that repository, or can be created
using that repository. I just used that repository
and then added a couple of little Shader Graphs,
and effects, and things like that. We have these different resources
which we're going to keep maintained and also update in the future
with new examples and new scenarios. We also have this blog post,
which I highly recommend you read. And this is basically
written by Andre McGrail. He is the tech artist
and developer of "Boat Attack" and a lot of the Universal
Rendering examples as well. And he goes through more specifics
on how he created different things, such as the Shader Graph
for the wet rock in "Boat Attack," to the Water Shader,
to Planar Reflections. And I highly recommend
you read that blog post because it's very insightful
on how to take your Universal Render
Pipeline projects to really the next level
by adding all these other features and functionality,
and tooling that he offers with the "Boat Attack" project
and with his knowledge in that blog post and video. I hope this was a helpful webinar. I hope the examples
were helpful as well. This is part of the
Unite Now webinar series and we're looking into doing more
of these in the future focused on graphics
and the Universal Render Pipeline. So if you do have any requests,
you can reach out to me, or reach out to us on the forums. I hope this was very helpful
in helping you choose in how the Universal Render Pipeline
can fit into your projects, or how the different features
can be used, even if what I showed you
doesn't necessarily align directly with what you're making,
in terms of genre, hopefully the
Scriptable Render Features, Camera Stacking,
and the tools that we're working on can allow you to achieve
your graphics goals and achieve your graphics visions. We're, of course,
always open to feedback so thank you for watching
and if you have any questions, I'll be hanging around
in the chat after this stream and you can ask them
to me there. Thank you. ♪ [MUSIC] ♪
Thanks for posting this. Recently jumped to URP :)
Is ambient occlusion on URP or is it still unsupported?