Lost Crypt: Explore Unity's new 2D features

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
this is going to be a session about the lost crypt Bert which is a sample project that's we a unity recently released on the asset store we first showed off this project a unite Copenhagen 2019 which was last September where we showed it in the keynote and various tools that used to create the project from rigging to lighting to sprite shape and all kinds of different 2d tools but this specific webinar session is can be focused on the new 2d graphics features because we've added a wide range of new graphics features to the 2d toolset and I'm mostly gonna be showing off how these tools work and how they could be used in the scenario of the law scripts but also in general purpose for your projects so you should be able to learn how to add 2d lights to your project or to shader graph and things like this so my name is Andy I am a global content evangelist at beauty technologies I joined midst 2013 so I've been a company while I don't forgive C had any 2d tools when I first joined no it definitely didn't have any 2d tools when I first joined so it's been interesting to see the evolution of the 2d tools being added and then improved and evolved over the last six and a half years and it's really really exciting to see all the different things that are adding and sort of opening the doors to I'm based in Copenhagen where it's currently raining and very very cold right now I'm sure a lot of people on the call are in much warmer touch woman nicer places weather-wise I'm also on Twitter where I kind of share different unity information tips tricks different things so feel free to chat and talk about it talk afterwards so I've got a rage deferred talk topics to look at so the first one is the universal render pipeline and how this has a 2d renderer sort of integrated and set up which you need to enable to be able to use a lot of new 2d graphics tools so I'll show a little bit of how these things to set but we have lots of information afterwards we have lots of information on blogs and videos and how on about the universe around a pipeline in general this sessions going to specifically look at the 2d renderer and with the 2d renderer comes a set of different things so one on one thing I'm gonna look at studi lights and there's different types of lights different settings and we also have this light blend style system so I could have a look at as well which allows just set up some interesting light influences to your sprites and art assets I'm also gonna look at 2d shader graph shader graphs a feature that we've been showing off for maybe like two years or so since the beginning of 2018 actually and shadow graph has evolved to add sprites support and also support for say 2d lights and things like this or sprites do have influence from two delights and these things sort of go very well hand-in-hand so I'm gonna show how these things are configured to work together and I'll show a little bit about the post-processing which comes with Universal render pipeline and is used in this project so before I jump into the editor and and spend time in general what I would give a big THANK YOU to back to the game studio based in Montreal the great studio that we worked with collaborated with and pretty much all the art work that you're gonna see is is provided and drawn and created by them so huge thank you to them and Richard from the studios in the chat as well if you have any more direct questions about what they do and also how the artwork was generated and things like that so big thank you to them there's a lot of fun working with them there's a there's a great experience so I literally have four slides so I'm going to spend the rest of the presentation actually in the editor having fun and doing different things so if you haven't seen it before this project is called lost crypt and lost crypt is a basically a vertical slice project that uses a wide range of different 2d tools to create a side score platformer with lots of different effects everything I'm showing you now it's actually downloadable from the Asus store I actually downloaded it this well downloaded this version that I'm showing right now this morning obviously I had it before when I'm working on it so everything you can see you can download right now or straight after this presentation as is I haven't actually changed anything so if I go into play mode let's have a look at what is actually this project save a bunch of shader graphs so you might not be able to hear audio but that's fine I can I can talk over it talk over what you're gonna see so the project has a character and this character's called Sara and she runs around and she's actually rigged and animated using the new 2d rigging and I K system including her hair her hair is physics driven so that's also using the AI K system but it moves dynamically and flows when she moves around what you can see is that we have different types of environments so we've got this forest environment with particles in the air we've got some swaying trees we've also got some flowers and things lit up on the grounds those will put together all those all lit and illuminated using the 2d lighting system she also moves down into these sort of like rooms where we have sort of different types of light influence different types of highlights on the environment and we also have down here a crypt area and this crypt area shows kind of lights and particles and shaders and things in a inside environment so we've got these flames here you also have these sort of like emblems we have this water as well which is created using shadow graph now if I move along to the ends I'm going to pick up this staff and then this is this then plays a timeline timeline sequence controlling particles controlling lights and all kinds of different things notice the fades from day to night all the particles then converge and then a big ripple shockwaves through the environment that ripples actually done with a 2d light which I just scaled up very very quickly um and now we have the character has changed form she's got this new scrub this new outfit but she also got wand in her hands which is using a 2d light that's lighting up different things around around her so you notice them normal maps of the cave are being influenced the light is shining on her and it's also getting picked up in the reflective water at the bottom and as we leave the temple or leave the Crypt even and come out into this environment what you'll notice is that the environment has changed to be this more nighttime darker scene and we have these little fireflies floating around this tree and we have these first spirits at these forest spirits you'll notice with this kind of I guess dog dog one dog creature they had this very subtle for an L around the outside but as the wands and the character gets closer you'll notice that finally details appear this is done entirely with shader graph as well so there's lots of different parts of this demo is very simple vertical slice but it shows off lots of different things in this kind of one level environment from rigging to you graphics to physics to all kinds of different things now I'm going to specifically focus on the graphics parts so if I leave play mode and switch to the scene view let's have a look at the graphics so as I mentioned earlier on yeah there's no audio playing there's actually audio in the demo just no audio coming through zoom that so I could kind of talk over it I guess so as I mentioned this project uses the universal render pipeline the universal render pipeline is a render pipeline using the script of render pipeline technology they'll be working on that opens up a wealth of different tools and features once you apply it to your project I have this installed through the package manager so if I go to window and package manager of the universal render pipeline installed and once it's installed we can then adds the 2d renderer to then use in here I have two assets one is the universal render pipeline assets this is kind of like global graphics controls of different things like HDR anti-aliasing lighting post-processing all kinds of different things one of the most important things to look at or when all the word when most want things to to apply if you want to use the 2d renderer is to go to the renderer list and add to this 2d renderer option with the universal red a pipeline installed if I would go down to rendering universe render pipeline we have this 2d renderer option here which then creates the asset that is assigned here if I have a look at that 2d renderer asset where you'll notice that we have some more 2d renderer specific options such as light blend styles HDD emulation scale and a couple of other things I'm going to go into a little bit later and with that assigned and also in the project settings under the graphic section with the universal render pipeline assigned you can then get going once you download this project it automatically has all this stuff set up so it could be useful resource if you want to then set up in your own projects so with this assigned this opens up a wider door to a lot of new tools what are these tools is shaders so we obviously have shader graph which we can use to author shaders and effects but what are the things that Universal render pipeline comes with and you notice it this material option here is under 2d is this sprite let's default and sprite let default shader is one that is influenced by 2d lights so once you start placing 2d lights around anything using this built in shader or a sprite lit shadow shadow graph which I'll show you later will be influenced by two delays in this project a couple of the elements are using this in a most of the actual elements are using shader graph and once you have that set up you can then start to use the 2d lighting system and what you'll notice here in this scene is there's already a lot of 2d lights at work what I'm actually going to do is rather than focusing on these lights that already set up I'm actually going to hide them so we've then got this very dark environment so you can kind of clearly see what it what I'm about to do and you'll notice that in the background we've we've got these uh the environment pieces all already lit up and these are because they're using unlit shaders so they're not influenced by 2d lighting because they're just in the background so let's have a look at different types of TD lights so with that Universal render pipeline installed and set up if you go into the game object window and go to lights you'll notice there's a new 2d option we have several different settings and different types of 2d lights just like in 3d we have directional light point by area lights spotlights in 2d we have similar similar versions such as global lights point by it's sprite sprite lights so the first one to show you is a global lights so if I turn on a this global lights here what it does is it applies a singular global color to pretty much all the sprites so you notice I can sort increase the intensity darkly HD you bathe is kind of like a directional lights but in a 2d world so it's influencing everything that it's targeting so if I choose like kind of this like blue type of hue you notice that all these trees which are using a sprite lit shader are they're being influenced by this blue global hue so you use it to kind of set a nice ambience to everything in the environment you different controls such as color and intensity which you're probably familiar with if you've used lights before but one thing that is different with the 2d system is you can target the 2d lights to different sorting layers so if you've used the 2d system before for painting tile maps or just creating 2d games you've probably used the sorting layer system to put sprites onto different layers such as background foreground UI layer and things like this the 2d lighting system ties into this you can have certain lights pointed at different types of layers so currently this global lights this global blue fill lights is currently applied to all sorting layers now if I go to no sorting layers I can actually say it's actually placed only on this near background layer so only the trees are gonna get this off nourish layer you could actually choose sort of which elements you want to be included in this with this lights so notice here I'm actually going to set it up so only certain elements are actually being lit by this global lights if I go to none and do like foregrounds we could then just have the floor lit by this global light whereas the background isn't so the really cool thing with the 2d system to do lighting system is you can only create different types of lights but you can also filter them to different different layers in different channels so that's the global lights so next one you look at is the point lights which is up here so the 2d point light is basically an equivalent of the spot lights at a 3d spot lights in the 3d point light and notice as I move it around the environment it's going to cast this kind of circular range onto pretty much anything that is when well within the range and if I position it somewhere like let's position it in the trees such as here we have these extra settings and extra handles to play with so we can obviously do things like you know make it sort of like a more red tinted light or change the intensity of how bright this light is there is some post-processing bloom being applied so you notice it will glow a little bit more but we also get some other settings and controls such sort of the angles and sort of the area that the light has been cast on T so if I actually grab this handle we can take the point light the to new point light from being you know a entire circle we could actually change it into a spot light quite easily and place them in the in place in the environment so I'm going to cast it across these tree branches let's say we don't want this we've now got this like hard edge across here which might be cool for like I know a searchlight from an enemy in a game or something but what I could actually do is that should grab these handles it's very intuitive the congrats handles and smooth out smooth out or position it in a way that you want it to to look or render and all of these settings are actually applying here so we can actually just set the inner angle not just from gizmos but also in the inspector so we can actually control a lot of how this light is rendering entirely from the scene view or the inspector view here we could also do things like fall-off intensity so if I want to have you know a lot more faded lights that actually is faded over its range then we can change this or if I want some more harsh intense lights I can set this up as well we can also change the fill basically you just get a lot of tools they're a lot of fun to play with to really influence these lights and I think Richard from back to the game studio back to the game in Montreal said it was kind of like painting with lights which is pretty cool that you can sort of place these lights and paint them and think of them as kind of like light shapes that you can then combine the other cool thing is you can actually stack these sort of stack and blend these lights and Torrie each other so if I now duplicate this lights let's make another one here let's make like a more of a red tone let's lower down the intensity a little bit notice that we have like this red and green lights inhabiting the same space I could actually select these lights and click alpha blend on overlap so rather than its additive here we can actually blend multiple lights together and they sort of bleed very nicely into each other so now everyone's going to turn all their games as disco games with disco spotlights everywhere but that that would still be pretty cool but you can take these lights and overlap them in lots different ways this project when you dissect it has lots of these lights scattered everywhere on the trees on the grounds that that uses all these different overlapping lights to create kind of the end result so that's the point light it's pretty cool that we can control like this angled range so if I go back to this lights and let's reset it let's actually reset it to a point light so we've now got this point light here [Music] just make a new one so another thing that a lot of people have been asking about is a point is normal Maps so we got this light here so this light is obviously defining this range that light is being influenced here so if I now go over to actually let's keep on these trees what you'll notice is that this light is just filling up this space it's not really influencing the normal maps these trees have and these are these this foliage if I select the foliage basically has this sprite sheet of all these different foliage types or foliage forms we also have normal maps here which are being applied to determine the influence from from lights you could also set up set this up using the sprite editor as well so going into the sprite editor so we have this foliage piece here you can go to this new secondary textures drop-down and we can now ceccolini sprites different types of secretary textures that are going to come with it through the shaders so you can set up these normal maps and bind it to these sprites so these trees are all using these Noor maps so if I now go to this this 2d point light here currently it's not influencing than the wall maps now if I click this use normal map button change the distance down just a little bit we all notice now as as the light moves around these trees is actually using that normal map influence so if I now like increase this a little bit you'll notice that it's not as flat anymore there's a bit more depth and a bit more detail to it you can actually notice this a lot more inside the caves so if I go down to the caves here trim down the intensity just a little bit maybe increase the actual volume passed to you so what you'll notice here is as I if I turn off the normal Maps the environment is like very sky look at these skulls here it's kind of a little bit flat right well it looks pretty cool they were lighting up this environment but if you're Nabal use no warm up on the lights notice that as the light goes around these skulls and around this normal map which is part of the tar map it's actually influencing the fall off or the the result of that noir map it's tying into that so you can now use these lights with these different Noor map influences it's pretty cool it's nice when it all ties very neatly together and this project uses normal Maps for tar maps the foliage pretty much most things in the project is using normal maps so it's a very good study or case study piece if you want to learn how to apply the steering games so the next light type I want to have a look at is freeform lights so let's turn this on here so a free-form lights kind of fits into not quite global lights or point lights which are more well global light is global across things on a layer point light is more like a range based erm shape or freeform lights is kind of I guess similar technology just sprite shape and that you define out an area for lights to to influence so here we've got this shape which kind of wouldn't be easy or straightforward to create using using a point lights but instead here with a free-form light you can actually grab different points and kind of sculpt your lights so I can actually create this this shape around this tree and create this lights highlight so I'd know some kind of area of my game which is like a little bit more toned or stylized so let's say say at this point in the game it's a bit darker moodier let's turn on the normal map influence as well so we've now got like a little bit of maps change this a little bit we could also set up like the volume opacity so we could have this like a nice thick area that this light is influencing you can do things like have to fall off intensity so we could have a basically like a sharp sort of lights cookie or light area but we could also in crease the fall-off as well so very nice sort of fall-off range with this with this light so you can really use this to kind of block out different areas of lights or areas of influence for different tones and different feelings and moods this also works with a sorting layer system so pretty much all the 2d lights will use the sorting layer system so I could say this area only influences or we could have this nice fog in front of the silhouette in the background it's just a lot of fun to be able to set up these lights and put them at different locations and places so if you want to sculpt lights definitely free from light is a pretty cool way to go and they use free foam light in the project at their very end so if I go over to this very ends here and so this lights here you'll notice that we have this lens shaft or then shot I'd be like shaft coming through the rocks here this is actually a free-form light being used to define this space and how sort of like this light is influencing this tile Maps here so you can use this to sculpt it's actually used inside the lights inside this these little alcoves as well so you can get some really nice effects but using the freeform light and notice as I turn on the lights we've got this nice blue haze of nice blue mist in this environment I didn't really intend for that to happen I'll be honest but it looks pretty cool so that's the freeform light there's one more light type I want to show you before I show you a couple of other really cool things and that is a sprite lights and ten points if you can guess what the sprite light does it allows you to choose the sprite that you have in your project and use that as the light source or as the shape of the light so if I go down here I have all the sprites on my project let's go down here and let's use these sprite shafts so you notice that this sprite that it's been imported that looks basically the shaft so the sprite is pretty pretty simple actually it looks like this yep it's simple sprite that's just been painted it's been created and what you'll notice here is that as I apply this it's basically gonna cast lights and you get all the same settings you can set the intensity you can set like the color that's looking you can set like the normal maps you basically get a lot of similar settings but you're now using a sprite as kind of the filtering there's a lot of fun to play with it's a lot of fun to set up set this up for I don't people could put Batman logos in the sky now they're gonna have lots of different interesting rooms and lights and actually these rooms here I think they use it or they could use it yeah so you can use sprite lights for lots of different sprite types so we have this one here as well so you can have some like lights influencing the environment here we could use it as like I mean they're just we have these are sunspots as well this project has lots of these like four or five or five or six of these different types of lights sort of scattered around so you can do some really neat really neat effects using these sprite lights so if I now go back and turn on the lights for the environment let's have a look at kind of how these things actually applied to this project so we've got a global light that's being applied to everything at the scene so you've got that like global fill light which if I turn off notice that we have less fill we also have just as a side note I have set up this sort of discovery window which basically when you start up the project we'll be available and you can when you start out the project it will pop up or if you go to this lost script discovery asset you'll notice that this discover window here is basically bound to lots of different elements and has information so if I got a 2d lighting here I've then set it up a link to global light 2d so I've can select this and then we've now got the light selected we've then got some lights at the tops of the trees so it shows how this has been used to sort of set up the the highlighting or the tops of the trees we also got the free-form lights we basically got all these different different light settings here so you can go through and play around with them we also have here lots of different sun spots and then show light shafts all on the ground so everything's stacked on top of each other and everything's combined to make this very visually pleasing scene another interesting part of this project this isn't part of the 2d tools system specifically but it's actually part of a script or a tool but back to the game created was this a day/night controller so if I move this slider and it you saw this in the cutscene if I move this slider in this light controller system you'll notice it actually blends all the lights from a day setting to a nighttime setting and it does this by using this route script which then goes to the child objects and samples these gradients and applies them to the different lights so you have this kind of centralized controller which then influences all the lights so all the lights are actually technically real-time you can have them flying around you can have them on a lamp the character was holding one when she gets the wand and all of them can change as well so you can dynamically blend your lights without or blend your light details without having to import lots of different types of sprite setups a lots of different you know versions of your sprites so as you can see here when it's nighttime we have this nice blue highlights along the tops of the trees and that's just changing the color of the that highlight light which I just showed you and again like the discovery window has a lot more information on how like a lot of this works and also pre binds so you to all the selections you don't have to go hunting in the hierarchy you can click the buttons and it will select it for you so that's lights let's talk about masking or light blend styles so one thing you might have noticed is that certain parts of the trees have a little bit more detail or a little bit more lights influencing them so the tops here of the trees have a little bit more light influence in them but not necessarily at the bottom this could be done in a couple of ways but one way that's been implemented into the 2d renderer system is a light blend styles our light blend styles and if I go to the 2d renderer data asset where you'll notice here is that we have a couple of Styles set up and a couple not set up so one that's automatically set up is default which means that anything on the default light blend style will just receive lights as normal everything I've just shown you is how its received so up to this point it's all exactly the same placing a light and it influences everything there and if I go back to this back to this point lights which is here if I actually move this point light over here it'll be interesting to show you this if I move this point light here and turn it down just a little bit you'll notice that as I move the point light round it's actually going to light up everything that it influences is a very hot spot light that's then lighting up everything in basically the same natural way but maybe we don't want this this point light to influence everything inside its radius to be you know very harsh and intense maybe we want just the tips of the trees or the tops of these ruins here well this is done using this masking or light blend system so I have this default layer here but we you can add extra blend styles so this one is for direct lighting so just type some direct lighting you can call this anything you want emission glow it's up to you we also have this mask texture channel which you can choose so here it's using the red Channel so anything using the red mask on a mask map for the sprite using the red channel will be influenced by these lights on this particular layer we get a couple of other settings such as is it multiply blend mode is additive blend mode subtractive and things like that so if I now go to this point lights and change this specific point lights from default lighting so as its lighting up everything that it's that that's within that range to direct sliding what you'll notice is it's only signing lights or only influencing lights on the tops of the trees you notice as I place it here this area is not being influenced as such whereas the tops of the light the tops of trees are being influenced now for bring it over to these ruins as well notice that the lights placed here is not influencing the underside of this ruins it's actually the outside edge so we're getting a more harsher direct lighting we're controlling how this light is actually influencing on this sprites and it's funny because I was doing this in the office and someone was playing around this the office so I was like well that looks really cool that 3d lighting and I was like it's not it's actually a sprites we're actually just painting or setting up where the light is is where the light is being influenced this is actually done by importing another type of texture so if I select these ruins we've got the ruined sprite which you just import as normal you place in it looks like this it's pretty standard we also have this ruins mask map here and this is very similar to physically based rendering if you've done something like this before so PBR will have a mask that has like one of the channels is metallic one of the channels is smoothness one of the channels is ambient occlusion one might be a mission you basically bake into red green blue and alpha different data to use and it's kind of the same principle when using it with this lighting system in the red Channel you can bake in direct lighting such as this green channel you can bake in emission blue channel you could bake in i'd know silhouettes and things like this you can use these chant these sprite channels so we have the Bruins here you'll notice that it's pretty it's a typically painted color or diffuse and then here we have a influence in the color so if I look at this red channel here we've got a harsher tone of red that's been painted around the outside of the ruins where is the inside it's a little bit darker if I actually go to the foliage it's actually similar so I go to this foliage piece here notice that we have the normal map which looks like this if you have a look at the mask here this is the same mask map the red is applied to the tops of the trees so it's being influenced here and the green Channel you'll notice is actually got little highlights of little spikes here so we could actually have like a even finer glow or even finer detail just applied to the green Channel so using this light blend system you can actually have lots of really cool effects like a mission direct lighting and things like this and this in this specific project we use it for highlighting the tops of the trees and highlighting the sort of outsides and areas of the of these ruins as well it's very fun to play with and you get some really neat effects and any light can influence this as well so if I go to my global lights and turn this on as tunnel lights off just to just to show that the global light works with this so the global lights now influence everything notice the blue is being applied to every type of sprites if I now switch this from default direct lighting you'll notice that now this blue light is only influencing the area the mask map that I've defined it to that the red Channel is to find it to influence so you can really be nice and selective and place lots of global light influence without having to really you know manually offer a lot of a lot of unique versions of sprites it's very dynamic and very flexible it's a lot fun to play with so we've now covered that masking system the next thing I want to cover is shader graph so switching a little bit but I'll come back to masking in a little bit so shader graph this isn't going to be an introduction to shader graph this is gonna be more like the updates for 2d we have got some materials and resources shada graph and getting started with that this is can cover how what we've actually done to extend it for the sprite workflow or 2d renderer workflow so everything you see on screen is pretty much using shader graph in some form and there are some more obvious uses such as this foliage here or the wind is actually swaying backwards forwards that's all done procedurally through shader graph and actually the tree trunks use the exact same shader to sway a little bit it's not as no spool this notes ball here sees tree trunks actually swaying backwards and forwards using that exact same shader graph as well and we tried to tidy up the shadow graphs as much as possible so you could actually lift this out from this project and actually use it in your own project so if you want to apply winds different to foliage or rocks or whatever it doesn't matter you can actually use the shader graph in your projects another use of shader graph that's interesting is the water so we have the water down here that reflects everything above it as the character walks through the environment and things like this this is done using a second camera that renders it to a render texture and then we have a shader graph that then applies refraction and caustics let's have a look at how these shade graphs are set up so this is the vegetation shader graph I won't go through every single node because that will take a long take probably an extra hour but I'm just going to call out a couple of key interesting points so if i zoom into the top here and I'll try to group these blocks in these sections as much as possible so that we you can either extract them or learn how the flow of data is going through and a lot of these nodes here are actually all nodes you could use for 3d shadow graphs and we have noise we have world's position we've got UVs it's all pretty standard stuff but the interesting change here is when you get down to the very end we have this master node and the master node is then the output of the shader graph is how your shader nodes and your visual effects from these nodes are then going to get output and then rendered onto your sprites or onto your mesh or into your particles and if I open up the shader graph menu and go to master we have PBR and unlit and visual effect which are already shown and already released but with 19.3 we now have sprite lit and sprites unlit master notes you'll notice that they're actually very similar we have the sprite lit master node and the spray unlit and the only notable differences here is the mask and normal outputs into the sprite lips so you can actually use the procedural you can actually use like noise and procedural shaders to actually output the mask value that the mask lights influences which is pretty cool so you don't just have to use the mask texture you can actually use say you could actually apply noise to something and then output noise through the red channel and have noise affected by lights just specifically noise it's pretty cool and we also have the normal Maps as well the normal influenced sprite and it doesn't have these things it's pretty standard for typical sprite sprite shade our vertex position and color but the other thing spritely unlocks is 2d lighting so actually any shader graph any sprite using a material using the shader graph with sprite let master will be influenced by 2d lights and you can see there's some pretty cool stuff in this foliage here so in this shader here so if you want to have just sprites have their sprite renderer asset so if I find one of these vegetation or you'll notice in the sprite renderer is we've got a reference to the sprites here and we have the shader here and if you want to take whatever sprite is being used in the sprite renderer you can go to shader graph and actually type in reference underscore main text and it will automatically call it in so you can create one shader graph in this case vegetation wind and use it across all sort of influences from sprite vendors or all sprite renderers use this so you don't have to make a new shader graph for each individual element you can kind of make very one global one and apply it so all the particles in this project you use two shader graphs for everything from the big exploding artifacts to the dust motes they use like the same shader graph just using this reference allows you to unlock reusability so the foliage uses diwali add the foliage is affected by a kind of wind we do this using a vertex position as well so the vertex position is basically changing the offset of the of the wind of this sprite and if I then go back to the scene view let's go find this footage here and select one of the foliage parts there's a bunch of different settings exposed from Shirdi graph so we could actually change the wind scale we could actually change the strength so how much the wind sways backwards or forwards the speed okay that's a bit too much we could also change the wind wind direction as well basically you can control sort of how this wind is actually influencing the shader so we go although all those wind is generated procedurally and they're all swaying backwards and forwards very nicely using entirely using shader graph let's have a look at water so water here is using a second camera and that second camera is being rendered to a render texture and if I now open up the water shader graph you have a pretty cool a cube visualization of this and zoom into this node setup here we've then got that rendered texture being passed in to the shader graph so you can actually take a camera rendering to a texture and then feed that into shader graph to use and if I go a bit further up the shader graph and zoom in you'll notice that the core sticks so the the deformation of that texture is being used by noise being scroll together we shared a graph you can visualize how the noise is being influenced we have two noises scrolling in different directions they're sort of being merged and combined here to create the core sticks and if we go down all the way down to the very end we're just using a sprite and let master to then render out that water shader so you can take this water shader graph for sprites and apply it to your projects qnet tweak it so here we've got some settings such as strength that you could change that the wave amounts because it changed the caustic brightness so if you want so I guess more oily you could change the ripple scale as well because it changed like how much the caustics actually influencing the texture you get lots of different settings all created from shadowgraph I don't think any code was put together so this will create this water effect and one of the last things I want to show you are those spirits so in the project [Music] day shifts to nights and as we do this these little spirits pop out and these spirits is you can see how this kind of like Fran L outside edge and if I enable this wand here this is basically a duplicate ones than what the character picks up as the wand comes into this area notice it's lighting up the tree and lighting up different areas but you notice that the details on this spirit are actually becoming more profound more basically more noticeable this is all done through shader graph as well now if I actually select this spirit you might be surprised to notice that the spirit imported asset actually looks like this it's actually a series of different details baked into different channels so we have the red channel which has this kind of I guess evil mode of the spirits the green channel which is this kind of like good spirits I guess and then the blue channel is that kind of edge edge glow as well and it kind of looks a little bit tribal here I guess but it doesn't look like that here so how is it going from this kind of setup to this one here and how can actually select this sprites and actually move the slider you notice actually blends from like an evil like a I guess like a and evil spirits - like a good spirits how's this all possible so if I open up the shader graph for these spirits again there's a bunch of nodes where you'll notice here is that we use sampling that sprites and we're actually splitting out the different channels so we can actually take these channels and get the red channel the green Channel and blue channel and use them in different scenarios so we can split these all out and then we can blend them and apply lights to them and use it with the masking system to be able to highlight different areas and if I go to this blackboard on the left here what you might notice is that we have this vector to a one position with this reference to source position and from script you can say get the position of the ones and pass it in here and this is then in highlighting the influence that the one has inside the shader so it's getting that one position and it's calculating the distance and then setting up kind of like a range that is being highlighted or not so you can feed in positions of assets or positions of transforms or data from components if you're a programmer feed that into shader graph and actually use that in your effects which is how these spirits are then being influenced by this one's position if you want to learn how to do that with shader graph you can actually just look at this project look at this little script on the ones and then see how this effect was created and of course because with shader graph here you can expose different things I could make this like spirit I don't know like well yellowy we could have the edge to be a bit more red you could basically do some really needs procedural changes and basically change the visuals of your project quite a lot it's very fun to play with and of course you can output the masking as well so you get lots of different things and to play around with so if I then turn the lights back today let's have a look at post-processing very quickly and then I'll jump to some questions so Universal render pipeline when you install it comes with post processing this post processing has been built to be very heavily ingrained with the Universal render pipeline and that is performance it works very nicely on devices it's very fast you can have bloom on some mobile platforms and it's actually quite performance you get a lot of these different settings and in this project there's a post processing volume being used to light everything up so if I finds this volume which is here what you'll notice if I turn off the volume its might be a little tricky to see at first but if I turn off this volume notice that we don't have as much glow around the edges of the trees and if I get that point light back that bright point like that I'm using notice that we have more of a harsh edge without the post-processing enabled there's when I turn it on notice that there's a bit more of a glow so with using post-processing you can actually make your light stand out even more you can go from lights being a little a little flats or a little a little simple I guess or it still looks pretty cool and still great to sample it to different parts of a sprite but you with applying post-processing you can really make it feel like the light is really hitting the different sprites and hitting the different environment parts and if you have a look at this post-processing stack it's actually quite simple there's a couple of settings for the white balance so we can actually tune and change the temperature of the whole scene so you can actually tune the white boats temperatures so it's more of a cold icy environment this Denmark currently or more warmer climates which which would be nice to go visit we have tinting as well so you can make things more more garish and more brights we could have things a bit more saturated you also get some settings with blooms so we can actually like make the bloom even more intense we could search as this or all the hot spots from the lights are actually being influenced now you might be able to notice the influence of post-processing a lot more with the 2d renderer where it's turned off when it's turned on we also have a little bit of vineya as well just to darken the edges so post-processing works with the universe render pipeline and also the 2d render as well so you can apply a really beautiful post-processing to your 2d projects when you use this this tooling and it ties very nightly which very neatly with shaders and also to delays so let's just go back to my slides so that's pretty much the end of this of this session I have a little bit more information to show you just kind of where to go where to get started so if you go this 2d tools evolved so the unity features 2d tools we have a page which basically has a link to pretty much everything I said but like maybe in more detail and lots of other extra information so as we go down here we've then got individual videos or individual examples on the animation system the lighting system share graph tile maps because this project uses tar maps for the crypt environment sprite shape sprite tools vector graphics pixel perfect retro games we've got blog posts all these different things so this is a really great starting point to go through and find all these different resources and find all these different videos and blogs we also have a link to the lost script project so everything I just showed you is available right now for free if you go to the asset store and go to the Unity Technologies publisher page or follow it through this 2d tools evolution page you can then download this project dissector play it have fun with it it's running on 19.3 so down in 19.3 and then open it myself and other people from unity and the R&D team and marketing know all sorts of people arts or having a look through comments or feedback and things so if there's anything you you want to give feedback on or you're curious about so you want to know how something was done that this video or this webinar or information we already have inspired let us know and then we're happy to amend or create more materials or answer your questions so yeah you can download it and get started with it study with it right now hopefully this webinar was helpful I know it's only one hour I could probably sit here for five hours just showing up playing with more lights making disco law script level if someone does make a disco law script level please send it to me because that would be that would be amazing to see I'm now gonna have a look at the chat and see if there's nice or extra questions that people want - any questions that people might have so let's have a look here how did the day tonight change happen so this was done by so I explained this a little bit earlier on but basically it's a script that references a series of subscripts that basically have gradients and settings for what the light should be at different points of when it's laid has changed so if I actually jump back into the editor or where that bloom is very very bright right now let's turn this down so we have here this light color controller script with the slider that goes from 0 to 1 so 0 being daytime one being nighttime what this script actually does and if you can open up and study the code it goes to the child objects and these child objects basically have this like material a material color sets with this lights color setter this light color setter basically has this gradient to say when it's 0 this is what the color of the light is when it's 1 this is what the color of the light is so from day to night so as you move that slider that as you move that slider it's basically gonna change set the color of lights like you have a script or an animation clip that says change this color of fire from red to yellow or something like this it's exactly the same thing you have the script that basically changes change these settings so you can set up different gradients for daytime nighttime dusk all these different things so definitely download the project have a look at this light color controller and then have a look at these little light color set of scripts as well in these gradients you could play around with them make some disco law script different types of moods different types of styles would be really cool to see really cool to see this so let's have a look at a couple of other questions so day/night post-processing is supposed to select they're so affected by a volume sorting layers I'm not sure render layers I think you can but that's all the top of my head don't don't quit me on this I have to go test that bunch of errors when you open the project if you can share the errors or message the errors to me or message it so one of us we can have a look in we need more information what those errors are if we are going to fix them or see if the errors or if we need to add some more information the cost performance of these lights post processes post process so yeah obviously the more you have the more it costs but for my perspective what are the things you to watch the effect performance so someone from the 2d R&D team could probably chip in a little bit more about this but basically the lights are then drawn on to the sorting layers that they are targeting so if you say this point light goes on to background and this light the same light goes on to foreground is then gonna shade for these different sorting layers I think there's some discussion about combining this or reworking this or something but that's how it currently is so the more you have the more point lights that you have in for this different layers the more lights there are kind of like the more performance you're gonna have this project has a lot of lights like I don't know how many but quite a few for 4050 lights or something and it runs on a phone at 30fps all the real-time lights without was having to do really much changes or much restructure in the light so yet definitely be careful with taking lights and if you have many sorting layers like 20 and then placing a light casting onto all 20 it's gonna be slower than say that light casting onto like one sorting layer for example does this work on UTC why in general the 2d lighting system I don't think works on unity UI I haven't tried that but that's interesting use case the UI does work with the universal render pipeline and a 2d renderer we actually have unity UI in this project just as a sidenote completely unrelated to kind of anything I talked about so if you actually build the project on mobile we actually have these like little on-screen buttons where you can like run and jump and test on a mobile device so that's all using unity UI lighting affecting it I guess you'd have to use like shader graph to influence that I haven't tried that so don't quote me on that I had to try this up yeah I'm just having a look through the questions explain how to start on a quick setup to use the volume script you just showed I just tried on my project and I can't me the volume script to make any fit at all so let's see if I can answer this question so currently there's no curly I turned off this volume so we don't have a volume applied basically when you install the universal render pipeline and you go to the render pipeline asset we have here a option yeah I know it's on the camera now yeah so we have on the camera this post-processing toggle I think by default this is turned off for some reason I don't really know why so if you turn on that post-processing toggle and then if you go to like game objects let's just create a get empty game objects create a volume create volume as well this is a global volume and make a new profile I can then basically add so you know how bloom influencing onto different parts of our scene now so if you just add that volume and make sure on your camera you have main camera you have post-processing enabled you can then just add your volume component which comes with Universal red a pipeline and HD render pipeline as well and then you create new and then basically you can then start playing with it it's kind of it's very straightforward yeah very straightforward and actually we got this pretty cool sparkling on top of the lights now which is which is pretty neat a couple of people are asking for what's the link to get the project so if you go the asset store and search lost crypts then you can get it but this is the main page so I'll leave this I'll leave this link up so this link is et comm slash unity slash features / - D tools okay let's have a look at the other questions Shh question about is the session it's quite similar as my presentation at Copenhagen Trinity it's very similar it's basically very similar tooling that we showed but one I showed it you know Copenhagen was a little bit this project and a little bit of the Robbie Swift town project and this time just showing this project because it's quite new more up-to-date thing and this project has a lot more use cases as well so it's very similar look what what I said is almost almost similar as well yeah so I think we're over time how if you have some other questions reach out to me on Twitter or I assume this link he sent out or some kind of follow up will be sent out as well thanks dialing in from wherever you are from the if it's your morning breakfast while watching this if you're watching lunch if it's dinner doesn't matter where you are thanks for tuning in hope it's a lot of fun hope a lot of people are gonna download this project or play around the 2d tools I can't wait to see lots of really cool things that people are going to make disco modes emission glow modes people can make some really really beautiful stuff it's a lot of fun playing with it I kind of forget that I'm at work yes sometimes playing with it so much so yeah and thank you yeah back to the game they were great to work with super super cool bunch of folks reach out to them if you want to work with them they're awesome highly recommended thanks for joining and I'll be monitoring like comments and stuff not munching I mean looking at the comments and stuff on the video if you have any further questions they want more information on so yeah thanks for coming along hopefully we could do more of these and futures a lot of fun welcome to new decade and the first webinar of the decade it's it's all all up from here so that's great cool thanks - thanks for joining in
Info
Channel: Unity
Views: 59,084
Rating: undefined out of 5
Keywords: Unity3d, Unity, Unity Technologies, Games, Game Development, Game Dev, Game Engine
Id: vRPW3H4X9PE
Channel Id: undefined
Length: 58min 51sec (3531 seconds)
Published: Thu Feb 06 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.