Getting started with the Lightweight Render Pipeline - Unite LA

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so hello everyone I yeah I'm getting over jetlag you all have to travel about an hour so I mean yeah so this is going to be a talk about the lightweight render pipeline if you're in the wrong room then please stay there will be more British jokes then wherever else you go so this talks about 45 minutes long and I'm going to be giving a general getting started overview if the lightweights render pipeline there'll be a liberator code so anyone who's an artist don't be afraid and start crying anyone who's an artist anyone who's a program don't be afraid if there's a little bit of ups and we'll have some fun so my name is Andy I work at Unity Technologies based in the Copenhagen office in very cold Denmark and I'm basically a Global Content evangelist my family still has no idea what that is nor do I know so I build a lot of demos and work with R&D directly and then come and teach people how to use unity and use new features and things like that so if you see me wandering around just come up and say hi we'll talk about shaders likely around a pipeline 2d stuff England's you know pots of tea all the typical stuff people think I like talking about and I'm also on Twitter as everyone is it's just my name without a spacebar without a space so I just post all sorts of weird shade of stuff on there if you want to see that cool so one big question a lot of people ask when you talk about lightweight render pipeline on HD or render pipeline is what actually is a scriptable render pipeline you've probably heard script to render pipeline or SRP mentioned quite a lot so this is a big question a lot of people ask me so the general consensus is that it's a way of configuring and performing rendering in unity that is controlled from c-sharp so what we're doing is we're basically taking the render pipeline of how games and content and projects in unity are rendered and we're basically exposing this up so you can read it dissect it it's less of a black box so this is a screenshot of the current built-in render in unity so you have forward and shading and meandering with very stages where the image on the screen is drawn from lighting to depth texture to a fake objects to transparency and things like that and beforehand a lot of people complain because they are like we don't really know how the image is being rendered in unity and of course you're writing shaders you're writing image effects and you're doing all sorts of exotic stuff like you want your projects to look the way you want them to look and sometimes just sort scratching I've done it as well scratching your head you're not sure why something's being drawn and why it's not or how you can customize it so we're making unities rendering less of a black box opening and exposing different things we're allowing it our more choice in how a game or project is rendered allowing more customization if I exposed methods and parameters and I'll show you some of those today and we're allowing more control over how and where performance resources are used so the screw to render pipeline is currently optional so when you boot up a new unity project today by default it uses the built-in renderer it's the one that's been around for a long time with forward and deferred renderer pops and it's default today and is we used it to create pretty much all of our demo projects like atom and things like that but with this new dawn of the script of render pipeline API what we're doing is we're offering an API and a core set of libraries and shaders and things and we're using that ourselves to make to render pipelines as examples for people to use but we're also sharing the render pipeline API so if you create their own render pipelines if they want to so these are kind of opt-in currently the to render pipelines that we're actually working on internally at Unity currently is the HD render pipeline which you've probably seen if you've seen the book of the dead forest demo and at the keynote tonight I don't mean to spoil it so put your fingers in the ears if you don't want to hear like you're going to see some really cool stuff tonight and the other one we're working on is the lightweight render pipeline and they're being made for two different reasons one is the HD render pipelines to add more high-end fidelity graphics tools and features such as lighting and decal system finally and all these different things and the Lightwave in a Python it's kind of going down the other end of the scale is focusing more on optimization and more strip back renderer and the Lightwave render pipeline is going to be a good entry point for graphics programs to start to dissect our render pipeline is or how a script around a pipeline is made and how to customize it and things like that and then of course there's the custom render pipelines which some people have made so there's a guy on guy cuckoo zero which some of you have probably seen his github he's done like a retro render pipeline and all sorts of really cool stuff I'm gonna be talking about this one we have plenty of talks about the others so I figured I'll talk about the one thing we should probably talk about more which is the lightweight render pipeline so as a disclaimer the log of render pipeline is currently in preview and it's aimed to me preview sometime early next year and the information in this talk is as of 2018 dot three and this lightweight lightweight rendering package and the reason why I'm putting this up here so when people watch the video later they always use older versions and then send me an email getting really angry and stuff so this is why this is here but all the demos and things I'm going to show is available today and you can do today so I'm not showing any custom magical stuff that's like 2021 is when you can do this it's everything is using public stuff today we also have a current limitations in roadmap forum thread on the graphics forums so if you want to see like current limitations or what it can't do and when things are aimed for in 19.1 19.2 I highly recommend going to that and I've got a link to the I've got all the links in a slide at the end for you to take a photo of for reference so at a high level the lightweight render pipeline is a strip back optimized rendering pipeline focused on performance and targeting mobile and XR but it's also capable for pretty much every other platform like console and things like that it's a single pass forward renderer does single pass forward rendering and it's optimized in consistent PBR like I'm sure some of you have used like standard shader and lights and then you built a mobile looks completely different you're like why is it doing this so it's been made to be more consistent we have a whole new stack of new shader libraries so rather than a massive siege ink file which has all these crazy references there more broken down into individual parts so you can kind of see this is the shadow section this is the light section this is the main directional light section it's more more current current more modern and one of the benefits is can combine real-time lights in a single pass so you can have lots of like point lights and things flying around all combined into a single pass and have some examples later and there's also an API and this is hot out the oven like as of like three weeks ago or something to inject script or render passes so in the rendering process you can say after the 'epic pass inject a custom render pass to do something with a fake data so you can kind of customize the renderer without modifying the source code which is super cool because your modify the source and then we update it and things happen the source is actually in c-sharp then it's entirely on github right now you can go in and download it modify it break it learn from it add things rendering is less so a black box you can literally step through and see what it's being drawn and when so the rent process is readable and the reason why we're making it C sharp or making it publicly available both lightweight render pipeline and HD render pipeline some people can modify it so they can tweak things they can add features if they want to so a user added like real-time ssao and things like this you can also remove stuff like if you don't want lighting engine remove lighting if you want and you can also learn from it so we've had a lot of graphics program programmers come and say this is really useful to read how a render pipeline is set up like I've written shaders and image effects and things and now how to know how a renderer actually like could be implemented so that's why we're doing it we made a couple of demos and showed them so at GDC 2018 in March I showed this last and M I were just kind of our guest like a left for dead type thing so this was using the lightweight render pipeline so it has like all the typical things you'd expect from a render pipeline we have this new project called boat attack and this is a light wave render pipeline demo project made by one guy and basically you can download it as well from github and I'll have some links later on and this is a demo that's been created purely to show how you can do different things like custom render pass or shaders and things like this don't worry about the audio so for example it you have all this really nice pretty water this is all all these boats are crazy they just it's supposed to follow that boat but now Oh yep please go alright anyway I'll just can't seem doing fly around so you got there these wind surfers and you got wake and you got like new unity mode of transport I guess you have all these pretty cool stuff like planet reflections and things like this so this is a project that you can download dissect see how they did plan a reflection see how they did the shaders for like we were in the pipeline and it's been or you got these cool like things flying around so you can hopefully our boat is yep oh but rendering is broken law I'll stick to scene view so you can see how a project is built from the ground up for the lightweight render pipeline so that's pretty cool we also have the trash - project so this was like an endless-runner that was made by our one of our content teams so they ported it over to the Lightwave render pipeline and they've put it on github as well and again I blink towards the end and actually most of our shader graph demo projects are actually using lightweight render pipelines such as this island on that we seem to be obsessed with islands at unity maybe we'll have like unite Hawaii or something next year it hasn't happened yet but that would be cool I'm gonna get in trouble I'm gonna get an email from someone saying what's your not how I like when is this happening and so we have this example on the Left which is kind of like using vertex animation shaders created with the shitty graph and we also have this line up thing that I've been main line up library I've been maintaining of simple shader graphs so pretty much all of our shader graph demos have pretty much been made in light wave render pipeline which is really cool so you can download those and dissect them and learn from them and I've got a bit more about shader graph later on in the talk so now is demo time how to set up a project to actually use the lightweight render pipeline so I have here a new project because we have too many Island demos I'm going to show a dark scientific robot thing so this is a environment like a simple robot Factory this is kind of like a sequel to the old angry bolts demo from our unity three days if anyone recognizes that we're as old as I am and here we have a simple character lit by lots of real-time lights so there's no baked lighting in this scene so as I go into play mode I can run around and shoot stuff and it's affected by shadows and all this stuff so this is currently rendered in the built-in current renderer and I purposely will sort of purposely sort of cranked up the stats a little bit so we've got 1000 batches which a lot of that has kind of lights and things and shadows a good amount triangles set passes and things like this so it's kind of not particularly optimized I'll be honest and I should really bake lights and things but I really want to show off how lightweight handles real-time lights as I switch this project and if you haven't used it you should definitely start using the frame debugger this is gonna be incredibly useful when you start using s RP s so the frame debugger basically gives you a breakdown of all the batches and the order and what is being drawn and you can then open them up and isolate them individually so I can go here and sort of cycle through all the different things that are being drawn and some of you are probably having a heart attack how I optimized this thing is and stuff like this so the frame debugger is quite useful but with the built in renderer it kind of is a little jumbled and things and with the frame debugger it's a lot more organized and neat so you can actually see what is happening and when so we have this project here I've taken a screenshot of these stats so don't worry about it later on so to move this project or switch it to use the lightweight render pipeline you basically get the load light wave render pipeline either from github or from the package manager or pac-man as we call it please don't sue me so when you open up the package manager you basically have different packages or features you can install so rather than them being scattered across random forum posts and on Twitter or things or random Dropbox with China so consolidate a lot of the features into packages and distribute and update them kind of outside the unity release load so you have the lightweight RP sometimes you'll see it called LW RP but this is called a lightweight render pipeline which you click on you an install and once it's installed you can then create a lightweight render pipeline assets so I'll show you sorry I'm still jet-lagged so this will basically make an asset that you can then create called the lightweight render pipeline asset and same if you use HD render pipeline it reduces HD render pipeline asset I've already setup a light wave render pipeline asset and it basically looks like this this is kind of your overview of all the different things that you can by default ad and toggle and turn on and off in the render pipeline and a lot of these are actually hooked up to like shaded keywords so for example if you disabled like HDR or lighting and things they'll actually disable lighting from any shader using that keyword which is pretty cool and you basically have this overview of your render settings in one place rather than scattered across various windows which it currently is so let's say we wanted to you get the scene to use that render pipeline so underneath edit and settings thank God we have a unified settings window now like you have to jump between all these hoops underneath the graphic section we now have this script to run a pipeline settings option which has none means it's using the built in renderer but if you use HDR P or lightweight around a pipeline or you make your own custom render pipeline you basically would assign the render pipeline asset here telling the renderer to use this system so let's assign that when you assign that everything turns magenta I knew this would happen so if you want to target this as your your art director said we will need a magenta game then you can probably leave this talk and ship a game that looks like this with bloom but this is probably not what you want in your game and you'll notice that not only is everything magenta but there's some stuff that isn't magenta like these like little lights along the bottom so what this is doing is because it's switching the render pipeline and because we've actually changed a lot of like core shaders and shader libraries and things some of the older lighting shader libraries are not compare however if you have like unlit shaders those will all work by default so these these lights are using basically the particles additive shader so that will just work as intended so normally you'd have to go in and you'd have to go to your materials and with that package installed go to the lightweight render pipeline option and then basically we have different shaders for different purposes so you'd have to switch them over from one to the other so if I select a random objects can I even select a random object so here I've got this metal plating which is obviously using the standard shader like way around a pipeline if I switch this over to lit it's basically using kind of the light wave render pipelines PBR shader simple it is like blinn-phong or simplified so simplified blinn-phong shader we also have particles and terrain and unlit and things so why she set this to be lit and see it somewhere oh is this object here what you'll notice is that the lits light wave render pipeline lit shader has kind of very similar slots and similar properties or in texture inputs and things to the actual standard shader in the current built in renderer so when you move things over a lot of elements will basically can be assigned like albedo everyday emission emission and things like this now I'm not going to sit here for another like 30 minutes and move everything individually that would be like the worst talk ever so please don't expect I would ever put you through torture so instead what we did is we actually made a tool which basically upgrades the project materials and it will go through and it will get the mappings and basically remap from one to another so if you have like a four using standard shader and it's using underscore main text or whatever underscore albedo it will find the equivalent in the library render pipeline I've done this once before my run through so it's slightly faster then normally this scene takes like two seconds or three seconds so proceed and basically or go through all the materials and switch them to use the light we render pipeline as you can see it kind of looks almost similar but there's a few noticeable changes one is my batch count it looks almost identical and I have a comparison screen chelator you still have real-time lights and all this stuff hadn't had to touch post-processing because that just carries over and things where you'll notice that my batches is now basically half and my verts is kind of less 300k less but the interesting thing is set past is originally it were like 600 I think maybe and now it's 101 I don't know why shadow cast is is zero that I think that's a bug I don't know but now we have basically the same scene in the lightweight render pipeline with basically similar shade of properties but now it has significantly less patches and things like this I'll talk about why in a second so you can run around it looks basically the same so if I go back to my slides now I'll sort of show some comparisons and kind of what actually happened so the left is the built in renderer and right is the lightweight render pipeline or L WRP so one thing that's very obvious is that on the Left lights are significantly brighter or significantly more defined and on the right there a bit dimmer and that's partly because lights are now physically based and have physically-based attenuation and fall off as opposed to point lights and things before hands where you had to increase the range really really big for it to have some kind of nice fall off now all the lights by default fall-off is controlled through the intensity instead so it's basically more physically based light controls the notice that we still have real-time shadows and all sorts of things like this but lights are just a bit dimmer and I guess some comparison in screenshots is this almost half the number of batches because all these point lights so the scene is using one main directional light two point lights and two spotlights are all generally drawn together now and they're all real-time so rather than them having an extra pass each time per object they're hitting it's kind of significantly dropped it without as really having to do anything triangles and verts are less because of shadows and yeah set paths is 401 and now it's down to the 98 so by default it's basically drawing a lot of things together without actually really having to touch anything which is pretty cool so in terms of the lighting realtime likes a cold per object but shaded in a single pass so in this gif on the on the right which are one of our graphics guys made the left is the light wave render pipeline and the right is the built in renderer basically turning on the same lights you'll notice that atom individually as light is constantly adding each pass one by one by one I think he's actually just scrubbing through the frame debugger and he recorded this but on the Left they're kind of all shaded together so basically the lights colpo objects as intended but shaded together but there is current a current limitation power objects and that's one main directional light like a big fill light and then for additional lights there are both point and spot they're looking into increasing this in the future but this is as of today so that same scene is basically uses that one man light for additional lights on that sixteen lights total visible by the camera but they're also looking at how they can maybe increase that or maybe change that but that's currently what it is and lighting attenuation is now physically based so control to intensity not range shaders so there's new shader libraries so there's new core shader libraries and lightweight render pipeline shader libraries and these are split up into smaller chunks so rather than having one big ceej ink file which includes a lot of methods and includes a lot of things that instead split into smaller pieces and when you actually look through the lightweight shaders you'll notice they're referencing individual HLSL files in terms of compatibility the lightweight render pipeline comes with compatible shaders but there's no more surface shaders partly because they were kind of old and the libraries were kind of haven't been updated and things like this so that's kind of a bit of a downside that we don't have so if your shader support anymore but the benefit here is that shader graph will actually generate lightweight render pipeline shaders and code for you so if you're moving some surface shaders over with albedo emission things because with shader graph we try to make terminology similar you can actually put a lot of things through shader graph visually and then test and then re export the generated shader code which I'll show you in a second and any unlit built in show this will actually just render as usual because they're not touched by lit things in terms of the lightweight render pipeline source it's available on github I've said basically all of this already but one thing that we've seen a lot of people do is use as a foundation for making your own custom render pipelines they've taken it and modified it and tweaked it and things like this like removed or lighting and stuff and a good entry point which I'll show you in a second is this default renderer set up CS which is kind of handles or the logic to nquing render passes for execution so this is generally the entry point to understand how the renderer for lightweight render pipeline is during the whole frame and another benefit and this is really new and hot out the oven so I'll show you in a demo in a second is that we have this new script will render pass API so rather than you having the lightweight render pipeline and then you tweak something very slightly and then we update the source and then you're like oh no I've now got to merge all the stuff and get your changes we've added this new API called script or render pass which allows you to capture render States modify them or do something with shaders or something like this and then re-inject them into the render pipeline so for example you don't need to render a second camera for effects or depth or whatever you can instead capture these and use command buffers to then execute them so you can for example get the all elements drawn in the epic pass do something with that and then re-inject that before the transparent part even gets there with one camera so you can do some really cool clever stuff and dig through the lightweight render pipeline source and learn what you can access and what you can do John sets mer whose are basically me but in Australia some more Australian he has a github and I have a link at the end which has some examples of some script to render passes one being this kind of frosted glass so this is taking all the epic geometry and then applying kind of a blur effect and re-injecting that into kind of like this frosted wall the other one is kind of like selective emission so you can apply a small script on an object and say just this object glows and post-processing you can do some really cool stuff with this new script or render pass system and we're working on some more demos in the future one interesting thing with script or render passes oh yeah I need to go to that slide is in this boat demo they actually use it for the planet reflections so okay it's kind of broken here but you can see that we have this planet reflection taking place of objects in the distance in the water so you can download this project and literally lift that script to render part of the planet reflections and like drop it into your project if you want kind of this type of functionality it's basically capturing lots of a pic geometry flipping it and then Reap rejecting it into the water shader so you can do some cool stuff and there's gonna be lots of amazing things on the asset store as people do like colored shadow real-time colored shadows and all sorts of amazing stuff with this new script or render pass API so if I go back into this project here the doom and gloom one not the nice Island one we can now control and do different things now that we saw have had a quick run-through of the light right render pipeline features one is that the lightweight assets is kind of like the controller of all different things so if I go to quality and disable enable HDR well change the render scale and things like this so low the render scale this is basically enabling and disabling different keywords in the shaders automatically such as the lit shader I'm saying actually do no pixel lighting for example so there's no your pixel weighting I can switch between pixel and vertex lighting you can do all sorts of really cool stuff that's all exposed directly into the shittest so I can actually switch all lighting to use vertex lighting so you can see it's a lot simpler but to calculate and but it's a lot simpler lighting instead so you can enable that can just literally turn off all shadows if you really want to do stuff like this and you have a lot of control and if you go to the HD render pipeline you've got like a lot more settings like subsurface scattering and all this different stuff so we're kind of treating these render pipeline assets as kind of like the place where you stop to or add different things if you want to control different elements of your renderer so now that we have the scene all set up like this I'm gonna open up the frame debugger so the frame debugger beforehand showed this big camera renderer like lots of different things and what it's now actually doing is it's now split up into different chunks so if i zoom in here you'll notice that we can see each of the individual passes that are taking place and the different processes so it's basically rendering the main shadow map which is the main directional light then additional shadows then a pic geometry skybox and things like this so in the previous built in renderer basically was kind of all jumbled and it's a little bit difficult to navigate whereas now instead we've got this order from first things being drawn so the last things being drawn and this is really good because we can then look at specific things such as render post operations effects go to the lightweight render pipeline source and find out what's actually happening in that path so it's going to be a lot better in actually understanding how your scene is rendered I'll just I'll come back to you later so one of the benefits of this is shader graph so if you've used shader graph it basically gives you a node based system to create shaders and construct different visual effects in unity so if I open up an example of a shadow graph like okay this is literally the simplest way to go if you anyone could ever make so don't judge me so we have this so shader graph interface which is similar to sort of other shader editors like shader Forge where you have different nodes that plug into different things but the cool thing about shilla graph is it will also generates shaders for the render pipeline to targeting so like my render pipeline shaders is what it will spit out in HD and things like this and the other cool thing which not a lot of people know about is if you then copy the shader and I'm not going to click this because every time I click it doesn't work if I definitely shaming someone's going to someone in the graphics team is going to watch this talk and yeah anyway they'll fix it hopefully so if you then copy the shader and then go to your text editor of choice we then have the generated shader code including all the properties and names like a render pipeline things like this so if you're wanting to learn how to write shaders or what libraries it's using so here is the keywords it's using here is the define so it's using this shader library core it's using the lighting and things like this you notice that split up into smaller chunks so if you want to learn say how to do a dissolve shader and then modify it you can actually create that in shader graph get the generated code and then optimize or remove things from there if you really want to so yeah so we're using shader graph to generate a lot of shader code for people to play with if I switch over to the over to Google so I said that it was all in c-sharp so I'll show you basically where to go and what to look at so underneath the Unity Technologies github we have this script to run a pipeline repository and inside here you'll notice that we have the pipeline's call API so when I said there there's core API and shaders and things like this and scripts that is found in there HD you can literally go into the shader graph and see how the shader graph nodes are created which is pretty cool if you go into the lightweight not the testing oh the testing frameworks there if you really want to see it if you go underneath the lightweight you basically split things into different chunks like editor runtime the shader library and the shaders if I go underneath runtime you'll notice there as opposed to the renderer being kind of hidden and doing some stuff we've got all the individual passes all the interfaces the renderer even that asset that you assign into the script to render pipeline slots is like there so you can basically go in and toil it and play with it and see what happens so if I go to the entry point or sort of the recommended place to look at which is the default renderer setup you can see here that we have all the different passes and different things that are being queued up so depth only main shadow additional lights and from there you can dig into these individual classes and things basically yeah you can go through and actually read what order the renderer is going in so we have the transparent pass we have the fake pass the skybox pass and all these different things and you can go in dissect them and see what they're actually doing super cool if you go into the passes folder we've then got like the draw skybox pass for example so literally how the skybox is being drawn in this render pipeline so you can go in so we can modify I'm sure people who do all sorts of weird stuff as people tend to do with unity they make lots of weird things it's not all weirdest yeah and basically customize or modify this and so how these are executed and stuff like this so you can go through have a look and see what's actually happening so if I go back into here now what I'm going to show you is I'm going to show you a thing which is one of those script or render passes so what the script will render pass now does oh actually I want to show you a light so if you now selects one of the lights sorry about this so let's say this point like here when I said the lights were basically based off of PBR so the attenuation is get better by default when you obviously increase intensity and lower the range and things it's now has a much nicer fall-off than the previous unity light which kind of like fell off gradually and just looked a bit weird now because it has more physically-based values lights just but I've just found lights by default now look just look better and it's pretty cool I like making that light really bright and then yep so Oh custom render pass so this is kind of one of the big newer things I was going to show some other shader graph stuff but I found like there's lots of shady graph information online in blogs and projects and things so I figure I'll show you something brand new which I got working last night whilst jet-lagged so let's hope this works so what the custom render pass allows you to do is it allows you to get a render States such as all up a geometries been drawn or all transparent geometries been drawn capture that do something with it and then choose where it goes who you want to be lit it so here do an applied to here and things like this that's how the planner reflections are being done in the boat demo and if I switch back to my slides here you'll notice here we have these different points so each you can inject this custom render pass into so for example you can go to the depth pre pass capture all the stuff the width the depth and then do something with that what I'm going to do is I'm going to take this frosted glass and after the apaec inject that directly into shade for doing cool screen space effects with no cameras and stuff kind of like grad pass without but without actually doing a grab pass yeah so I have a script already written because if you ride it live things horribly brick as I found before and what you do is you basically go to your camera go to this blur grab pass that I've written and if I set this value so your notice here that I can actually increase the value I automatically have something looks kind of like an image effects yeah this was definitely not a fun demo to make whilst jet lagged by the way because my eyes were freaking out and the the weird thing that you can see here is we have this weird frosting effect that's being applied but you'll notice that the transparent elements here aren't being affected what's actually happening is that this blur is being applied between your peak pass and the transparent pass as opposed to an image effect at the end and what's even cooler is if I open up the friendly bugger add a lot of fun with this right in people's names we have that custom blur pass literally there so you know beforehand I showed it without and it was like opaque skybox stuff like this I literally have the the actual render pass that I've injected taking place at that particular point so if I said I'll open a trend past a second if I said render this after the skybox it will actually appear somewhere else so the cool thing about this is you can not only inject render passes you can also preview them and see what they're actually doing so I'll open up the blur and see what it's doing so it it down scales it it fuzzies it it fuzzies it again and then it read blitz it back to the screen before all the transparent and skybox stuff is rendered so if I go over and actually have a look at this blur grab pass let's have a look at it I'm sorry artists I really am but this is what actually this will be good because then you can go to program and say hey write me a render pass that captures all the shadows and then I can do something cool with it in shader graph which I'll show you in a second so what it's doing is it's a monitor it has a monitor behavior class and it has I after a peak pass and that might seem familiar because if I then go back to the Lightwave render pipeline source we have the eye after a peg pass that takes place at some point in the stage so here we go I after a peck pass so this is partly the cool thing with the render pipeline being exposed as you could say oh well such you're happening in the skybox let's make the skybox and now have like scrolling matrix text or something you can go into the skybox pass and then do something with that later on so that's pretty cool so if I go hip I after a peck pass I then have a basic blitz shader and a basic blur shader lifted from that project that John made so thank you John if you're going to watch this later on then I have this script around a pot render pass which basically in queues a render pass and it feeds in the render texture so is capturing things to a render texture the color handle of the screen and also the depth and if you use other things like transparent and skybox you get some other properties and then it's passing into that grab pass materials vector twos and things like this like the blur amount now if I go down to script a render pass I have this render pass tag so this is how it appears in the frame debugger so someone shouts out a name has anyone got a name what was that testing come on something more fun yeah oh yeah Chuck Tucson tech Denmark blur pass thank you yeah cheers so here's the denmark blur pass that will now appear in the free Neuberger is Denmark blur Pass okay let's go on for andis Denmark bypass just some self marketing why not and then when it finishes compiling the friendly bugger will close and then reopen because let's have a look do we have a andis denmark pass way there we go so you can now actually name render passes and see how there you can I had a lot of fun in adding this to people's projects and just having weird names everywhere so Denmark blur pass why not then in that blur pass it then gets the information from the mana behavior earlier on and then it actually then executes the renderer and you can see you get some information such as the script to render out the context of the renderer the rendering data so if you want to get the depth stuff like this and then it basically creates a command buffer with that render pass tag and then it does a bunch of things so if you've written image effects or all sorts of different graphics related things before some of this is familiar for the blur it literally copies the screen gets the opaque elements sets the filter mode and then blitz it to a screen copy then it's down scales it for blurring makes you render textures it's busy just blitzing stuff left right center is what you saw in the frame debugger is you break it down then applies it to that blur shader and then I basically relit it back to the screen but when you read bliss it back to the screen because it's happening after the epic pass that's when it's being injected into so I could set this after the transparent person or you'll have to take place at that point now this is okay or maybe maybe this wouldn't be a very nice sort of custom render pass that you apply to your game or you also have some glass over here I think where's the glass yeah so this glass here you notice isn't really that blurry it's taking because it's being drawn after that render pass so this is okay people's eyes are probably really hurt I'm really sorry about this I know it's early for game developers in the day so what instead gonna do is do something fun which definitely I didn't get fixed last night is take this render pass and take that result and inject it into shader graph so this is pretty cool because then developers could then create custom render passes and then artists can use shader graph to then do something with that render pass so I'm instead going to comment out that blitz to the screen definitely don't uncommon that and I'm then sending this global texture with this command buffer of underscore grab blur texture yeah some people someone was probably like well just turn into a beach so that kind of disappears but if I turn on this big screen display this screen displays using a shader graph shader to basically project this kind of filter and you can notice you can still control different things and make things all warped and stuff like this so it's basically kind of doing a grab pass blur but it's still injected render pass directly to the shader graph shader which means you now have the power of shader graph to do some nice effects using that result so here if you hadn't use shader graph before you basically have this end master node which is where the shader outputs things into color and position and stuff like that now basically taking underscore grab blur texture what I wrote earlier last night and then it's basically applying that out here of course you can now do things so here I've got a simple kind of pasta right post erase filter and then color and tint and basically you can kind of preview the this below results so if I now plug this into here and save the assets I now get this effect pretty much almost entirely mated made in shader graph but now you have like all these sliders and things so I now have kind of this real-time with one camera kind of custom render pass which still appears as the Danmark render pass like so so the demo render pass is actually drawing directly into that screen before the screen is then drawn with the transparent pass so now you can kind of have real-time weird effects or have real-time different things using render passes so I can then run the character in and basically have this with one camera drawing things because if we're already exposing the camera renderer and exposing what's happening in the pass is rather than rendering something to a second camera and then writing a stencil shader for that or doing well doing all this stuff you can now just have a graphics program someone hey I want to get this data hey oh now want to feed this into shader graph three four one two and things like this so someone give me a different color not green or red yeah virtual boy here we go I'm not confirming virtual boy support before anyone asks we're not doing that yep so we now have this weird frosting someone's like that take on me music video now but more Nintendo yep yep so basically using custom render passes you can inject things and do lots of different cool stuff I've got a couple more minutes do you wanna see something that might break cool so one thing I one thing I tried to do is lift the planner reflections from the boat attack them and put in here and I've got it working let's see if it's there working so what I have here let's turn off the screen because it's a big and obnoxious so in bode attack demo we have a basically script render pass oh it might break because it sometimes does this so we have a custom render pass that's basically capturing the screen and then creating planner reflections for the water all in real time which is pretty cool now as we know unity kind of doesn't have this out of the box so what I decided to do is I pretty much lifted that script commented out use the name space of water system which is what Andre originally wrote and then I set it to use a similar global texture that basically that other render pass was using and let's see if this works so I've got the planer even with the spelling mistake that someone wrote that's a turn this on so this is currently not doing anything and then if I select this ground layer I have a customer graphs the effects metal floor plan a reflection graph and let's see if this works so you now have a planner reflection that's basically being projected and you see it kind of doesn't work because you've got it's kind of confused between the scene view and game view does that make sense so maybe if we're going to play mode it would work nope usually if I close one it's kind of now she needs us here I've now got this kind of plan a reflection that's taking place on the floor it might be a little tricky to see and as the character walks around and shoots you can notice that planner reflection is taking place fullscreen so you now have this character obviously this was made for water but yet we've got this or reflecting and because the custom render pass outputs like this planner reflection texture in shader graph you can kind of see this coming in so we have planner reflection which is kind of using the same system as the the weird Virtual Boy effect we have the results of the camera texture that's basically been output and then I put it through some reflection and different things you can actually see the preview directly in shader graph so if you're an artist you can say hey give me the plan of reflection and then you can do what you want with it and do all sorts of frosting and make it look weird I don't know do some lots of cool stuff so let's just brighten this up so we now have this pretty cool effect here and because I'm curious what it's going to happen let's turn back on that blur and the display and let's see if it actually does a plan a reflection pass and sort of I guess people won't know this okay so yeah that's using plain reflection pass with a custom sort of like red effect pass as well so that's kind of something cool I'm really happy that worked actually yeah I'm pretty much at the end of the talk if I now switch to I did that so this is the thank you this is the photo slide I usually call it we're pretty much all the links that I referenced are here everything I did you can do right now today and if you go to this extending like render pipeline I basically lifted that blurring directly from there and the boat attack I lifted that planet reflections from there so you can download these projects and download these links and kind of learn a bit more about it we are still developing like a render pipeline so it will be adding more different things and more performance and stuff like this in the future and more features but that's currently what you can do with it today and it's already pretty cool that you can inject different render passes at various points and do stuff with it I think I'm just pretty much the end of the talk I'll be wandering around so I'll be outside and I'll be downstairs in Expo and walking around so come say hi if you're working on a project like to see it or if you toy around with this we'd like to know there's also a forum thread for feedback directly to our D so if you want to like give them feedback or have requests for things and that to them and I hope this was informative and was okay thanks for coming and have a good you know it Los Angeles [Applause] you
Info
Channel: Unity
Views: 31,938
Rating: undefined out of 5
Keywords: Unity3d, Unity, Unity Technologies, Games, Game Development, Game Dev, Game Engine
Id: n8Q4lvhi_Gc
Channel Id: undefined
Length: 47min 1sec (2821 seconds)
Published: Mon Nov 19 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.